MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / buildInterpolationSplines

Method buildInterpolationSplines

OgreMain/src/OgreAnimationTrack.cpp:545–580  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

543 }
544 //---------------------------------------------------------------------
545 void NodeAnimationTrack::buildInterpolationSplines() const
546 {
547 // Allocate splines if not exists
548 if( !mSplines )
549 {
550 mSplines = OGRE_NEW_T( Splines, MEMCATEGORY_ANIMATION );
551 }
552
553 // Cache to register for optimisation
554 Splines *splines = mSplines;
555
556 // Don't calc automatically, do it on request at the end
557 splines->positionSpline.setAutoCalculate( false );
558 splines->rotationSpline.setAutoCalculate( false );
559 splines->scaleSpline.setAutoCalculate( false );
560
561 splines->positionSpline.clear();
562 splines->rotationSpline.clear();
563 splines->scaleSpline.clear();
564
565 KeyFrameList::const_iterator i, iend;
566 iend = mKeyFrames.end(); // precall to avoid overhead
567 for( i = mKeyFrames.begin(); i != iend; ++i )
568 {
569 TransformKeyFrame *kf = static_cast<TransformKeyFrame *>( *i );
570 splines->positionSpline.addPoint( kf->getTranslate() );
571 splines->rotationSpline.addPoint( kf->getRotation() );
572 splines->scaleSpline.addPoint( kf->getScale() );
573 }
574
575 splines->positionSpline.recalcTangents();
576 splines->rotationSpline.recalcTangents();
577 splines->scaleSpline.recalcTangents();
578
579 mSplineBuildNeeded = false;
580 }
581
582 //---------------------------------------------------------------------
583 void NodeAnimationTrack::setUseShortestRotationPath( bool useShortestPath )

Callers

nothing calls this directly

Calls 7

setAutoCalculateMethod · 0.45
clearMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
addPointMethod · 0.45
getScaleMethod · 0.45
recalcTangentsMethod · 0.45

Tested by

no test coverage detected