Changed of _firstTime intial values of 0 to DBL_MAX.

This commit is contained in:
Robert Osfield 2004-01-12 13:53:04 +00:00
parent c51c2893ce
commit b89ec5dcf9
2 changed files with 5 additions and 4 deletions

View File

@ -20,6 +20,7 @@
#include <osg/NodeCallback> #include <osg/NodeCallback>
#include <map> #include <map>
#include <values.h>
namespace osg { namespace osg {
@ -188,7 +189,7 @@ class SG_EXPORT AnimationPathCallback : public NodeCallback
AnimationPathCallback(): AnimationPathCallback():
_timeOffset(0.0), _timeOffset(0.0),
_timeMultiplier(1.0), _timeMultiplier(1.0),
_firstTime(0.0), _firstTime(DBL_MAX),
_latestTime(0.0), _latestTime(0.0),
_pause(false), _pause(false),
_pauseTime(0.0) {} _pauseTime(0.0) {}
@ -213,7 +214,7 @@ class SG_EXPORT AnimationPathCallback : public NodeCallback
_useInverseMatrix(false), _useInverseMatrix(false),
_timeOffset(timeOffset), _timeOffset(timeOffset),
_timeMultiplier(timeMultiplier), _timeMultiplier(timeMultiplier),
_firstTime(0.0), _firstTime(DBL_MAX),
_latestTime(0.0), _latestTime(0.0),
_pause(false), _pause(false),
_pauseTime(0.0) {} _pauseTime(0.0) {}

View File

@ -147,7 +147,6 @@ class AnimationPathCallbackVisitor : public NodeVisitor
bool _useInverseMatrix; bool _useInverseMatrix;
}; };
void AnimationPathCallback::operator()(Node* node, NodeVisitor* nv) void AnimationPathCallback::operator()(Node* node, NodeVisitor* nv)
{ {
if (_animationPath.valid() && if (_animationPath.valid() &&
@ -159,7 +158,8 @@ void AnimationPathCallback::operator()(Node* node, NodeVisitor* nv)
if (!_pause) if (!_pause)
{ {
if (_firstTime==0.0) _firstTime = time; // Only update _firstTime the first time, when its value is still DBL_MAX
if (_firstTime==DBL_MAX) _firstTime = time;
update(*node); update(*node);
} }
} }