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

Method _applyBaseKeyFrame

OgreMain/src/OgreAnimation.cpp:773–824  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

771 }
772 //-----------------------------------------------------------------------
773 void Animation::_applyBaseKeyFrame()
774 {
775 if( mUseBaseKeyFrame )
776 {
777 Animation *baseAnim = this;
778 if( mBaseKeyFrameAnimationName != BLANKSTRING && mContainer )
779 baseAnim = mContainer->getAnimation( mBaseKeyFrameAnimationName );
780
781 if( baseAnim )
782 {
783 for( OldNodeTrackList::iterator i = mOldNodeTrackList.begin();
784 i != mOldNodeTrackList.end(); ++i )
785 {
786 OldNodeAnimationTrack *track = i->second;
787
788 OldNodeAnimationTrack *baseTrack;
789 if( baseAnim == this )
790 baseTrack = track;
791 else
792 baseTrack = baseAnim->getOldNodeTrack( track->getHandle() );
793
794 TransformKeyFrame kf( baseTrack, mBaseKeyFrameTime );
795 baseTrack->getInterpolatedKeyFrame( baseAnim->_getTimeIndex( mBaseKeyFrameTime ),
796 &kf );
797 track->_applyBaseKeyFrame( &kf );
798 }
799
800 for( VertexTrackList::iterator i = mVertexTrackList.begin();
801 i != mVertexTrackList.end(); ++i )
802 {
803 VertexAnimationTrack *track = i->second;
804
805 if( track->getAnimationType() == VAT_POSE )
806 {
807 VertexAnimationTrack *baseTrack;
808 if( baseAnim == this )
809 baseTrack = track;
810 else
811 baseTrack = baseAnim->getVertexTrack( track->getHandle() );
812
813 VertexPoseKeyFrame kf( baseTrack, mBaseKeyFrameTime );
814 baseTrack->getInterpolatedKeyFrame(
815 baseAnim->_getTimeIndex( mBaseKeyFrameTime ), &kf );
816 track->_applyBaseKeyFrame( &kf );
817 }
818 }
819 }
820
821 // Re-base has been done, this is a one-way translation
822 mUseBaseKeyFrame = false;
823 }
824 }
825 //-----------------------------------------------------------------------
826 void Animation::_notifyContainer( AnimationContainer *c ) { mContainer = c; }
827 //-----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 8

getOldNodeTrackMethod · 0.80
_getTimeIndexMethod · 0.80
getVertexTrackMethod · 0.80
getAnimationMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getHandleMethod · 0.45

Tested by

no test coverage detected