Changed of _firstTime intial values of 0 to DBL_MAX.
This commit is contained in:
parent
c51c2893ce
commit
b89ec5dcf9
@ -20,6 +20,7 @@
|
||||
#include <osg/NodeCallback>
|
||||
|
||||
#include <map>
|
||||
#include <values.h>
|
||||
|
||||
namespace osg {
|
||||
|
||||
@ -188,7 +189,7 @@ class SG_EXPORT AnimationPathCallback : public NodeCallback
|
||||
AnimationPathCallback():
|
||||
_timeOffset(0.0),
|
||||
_timeMultiplier(1.0),
|
||||
_firstTime(0.0),
|
||||
_firstTime(DBL_MAX),
|
||||
_latestTime(0.0),
|
||||
_pause(false),
|
||||
_pauseTime(0.0) {}
|
||||
@ -213,7 +214,7 @@ class SG_EXPORT AnimationPathCallback : public NodeCallback
|
||||
_useInverseMatrix(false),
|
||||
_timeOffset(timeOffset),
|
||||
_timeMultiplier(timeMultiplier),
|
||||
_firstTime(0.0),
|
||||
_firstTime(DBL_MAX),
|
||||
_latestTime(0.0),
|
||||
_pause(false),
|
||||
_pauseTime(0.0) {}
|
||||
|
@ -147,7 +147,6 @@ class AnimationPathCallbackVisitor : public NodeVisitor
|
||||
bool _useInverseMatrix;
|
||||
};
|
||||
|
||||
|
||||
void AnimationPathCallback::operator()(Node* node, NodeVisitor* nv)
|
||||
{
|
||||
if (_animationPath.valid() &&
|
||||
@ -159,7 +158,8 @@ void AnimationPathCallback::operator()(Node* node, NodeVisitor* nv)
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user