Added AnimationPathCallback::getAnimationTime() method
This commit is contained in:
parent
434e16598e
commit
d83fa3fca5
@ -232,6 +232,10 @@ class SG_EXPORT AnimationPathCallback : public NodeCallback
|
||||
|
||||
void setPause(bool pause);
|
||||
|
||||
/** get the animation time that is used to specify the position along the AnimationPath.
|
||||
* Animation time is computed from the formula ((_latestTime-_firstTime)-_timeOffset)*_timeMultiplier.*/
|
||||
double getAnimationTime() const;
|
||||
|
||||
/** implements the callback*/
|
||||
virtual void operator()(Node* node, NodeVisitor* nv);
|
||||
|
||||
|
@ -168,12 +168,15 @@ void AnimationPathCallback::operator()(Node* node, NodeVisitor* nv)
|
||||
NodeCallback::traverse(node,nv);
|
||||
}
|
||||
|
||||
double AnimationPathCallback::getAnimationTime() const
|
||||
{
|
||||
return ((_latestTime-_firstTime)-_timeOffset)*_timeMultiplier;
|
||||
}
|
||||
|
||||
void AnimationPathCallback::update(osg::Node& node)
|
||||
{
|
||||
double animationTime = ((_latestTime-_firstTime)-_timeOffset)*_timeMultiplier;
|
||||
|
||||
AnimationPath::ControlPoint cp;
|
||||
if (_animationPath->getInterpolatedControlPoint(animationTime,cp))
|
||||
if (_animationPath->getInterpolatedControlPoint(getAnimationTime(),cp))
|
||||
{
|
||||
AnimationPathCallbackVisitor apcv(cp,_useInverseMatrix);
|
||||
node.accept(apcv);
|
||||
|
Loading…
Reference in New Issue
Block a user