Added new osganimate demo which demonstrate the osg::AnimationPath in action.
Added extra parameters to the AnimationPath callbacks to allow finer control.
This commit is contained in:
@@ -42,7 +42,7 @@ void MatrixTransform::AnimationPathCallback::operator()(Node* node, NodeVisitor*
|
||||
double time = nv->getFrameStamp()->getReferenceTime();
|
||||
if (_firstTime==0.0) _firstTime = time;
|
||||
Matrix matrix;
|
||||
if (_animationPath->getMatrix(time-_firstTime,matrix))
|
||||
if (_animationPath->getMatrix(((time-_firstTime)-_timeOffset)*_timeMultiplier,matrix))
|
||||
{
|
||||
mt->setMatrix(matrix);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void PositionAttitudeTransform::AnimationPathCallback::operator()(Node* node, No
|
||||
double time = nv->getFrameStamp()->getReferenceTime();
|
||||
if (_firstTime==0.0) _firstTime = time;
|
||||
AnimationPath::ControlPoint cp;
|
||||
if (_animationPath->getInterpolatedControlPoint(time-_firstTime,cp))
|
||||
if (_animationPath->getInterpolatedControlPoint(((time-_firstTime)-_timeOffset)*_timeMultiplier,cp))
|
||||
{
|
||||
pat->setPosition(cp._position);
|
||||
pat->setAttitude(cp._rotation);
|
||||
|
||||
Reference in New Issue
Block a user