Changed M_PI to osg::PI.

This commit is contained in:
Robert Osfield
2004-04-28 15:07:08 +00:00
parent 678c456fc8
commit 181761e56f
3 changed files with 5 additions and 5 deletions

View File

@@ -402,7 +402,7 @@ ConvertFromInventor::preLight(void* data, SoCallbackAction* action,
SoSpotLight* spotLight = (SoSpotLight *) node;
osgLight->setSpotExponent(spotLight->dropOffRate.getValue() * 128.0);
osgLight->setSpotCutoff(spotLight->cutOffAngle.getValue()*180.0/M_PI);
osgLight->setSpotCutoff(spotLight->cutOffAngle.getValue()*180.0/osg::PI);
osg::Vec3 transVec;
thisPtr->transformLight(action, spotLight->location.getValue(), transVec);
@@ -764,7 +764,7 @@ ConvertFromInventor::preRotor(void* data, SoCallbackAction *,
osg::Vec3 axis(ivAxis[0], ivAxis[1], ivAxis[2]);
osgUtil::TransformCallback* rotorCallback
= new osgUtil::TransformCallback(pivot, axis,
2 * M_PI * ivRotor->speed.getValue());
2 * osg::PI * ivRotor->speed.getValue());
// Set the app callback
rotorTransform->setUpdateCallback(rotorCallback);

View File

@@ -35,10 +35,10 @@ void PendulumCallback::operator() (osg::Node* node, osg::NodeVisitor* nv)
if (nv->getTraversalNumber()!=_previousTraversalNumber)
{
double currentTime = fs->getReferenceTime();
_angle += (currentTime - _previousTime) * 2 * M_PI * _frequency;
_angle += (currentTime - _previousTime) * 2 * osg::PI * _frequency;
double frac = 0.5 + 0.5 * sin(_angle);
double rotAngle = _endAngle - _startAngle - M_PI
double rotAngle = _endAngle - _startAngle - osg::PI
+ (1.0 - frac) * _startAngle + frac * _endAngle;
// update the specified transform

View File

@@ -34,7 +34,7 @@ void ShuttleCallback::operator() (osg::Node* node, osg::NodeVisitor* nv)
if (nv->getTraversalNumber()!=_previousTraversalNumber)
{
double currentTime = fs->getReferenceTime();
_angle += (currentTime - _previousTime) * 2 * M_PI * _frequency;
_angle += (currentTime - _previousTime) * 2 * osg::PI * _frequency;
double frac = 0.5 + 0.5 * sin(_angle);