---------------------------------------------------------------------
| 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 ) |
nothing calls this directly
no test coverage detected