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

Method hasNonZeroKeyFrames

OgreMain/src/OgreAnimationTrack.cpp:593–617  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

591 void NodeAnimationTrack::_keyFrameDataChanged() const { mSplineBuildNeeded = true; }
592 //---------------------------------------------------------------------
593 bool NodeAnimationTrack::hasNonZeroKeyFrames() const
594 {
595 KeyFrameList::const_iterator i = mKeyFrames.begin();
596 for( ; i != mKeyFrames.end(); ++i )
597 {
598 // look for keyframes which have any component which is non-zero
599 // Since exporters can be a little inaccurate sometimes we use a
600 // tolerance value rather than looking for nothing
601 TransformKeyFrame *kf = static_cast<TransformKeyFrame *>( *i );
602 Vector3 trans = kf->getTranslate();
603 Vector3 scale = kf->getScale();
604 Vector3 axis;
605 Radian angle;
606 kf->getRotation().ToAngleAxis( angle, axis );
607 Real tolerance = 1e-3f;
608 if( !trans.positionEquals( Vector3::ZERO, tolerance ) ||
609 !scale.positionEquals( Vector3::UNIT_SCALE, tolerance ) ||
610 !Math::RealEqual( angle.valueRadians(), 0.0f, tolerance ) )
611 {
612 return true;
613 }
614 }
615
616 return false;
617 }
618 //---------------------------------------------------------------------
619 void NodeAnimationTrack::optimise()
620 {

Callers 3

optimiseOldNodeTracksMethod · 0.80
optimiseVertexTracksMethod · 0.80

Calls 10

RealEqualFunction · 0.85
hasMoreElementsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getScaleMethod · 0.45
ToAngleAxisMethod · 0.45
valueRadiansMethod · 0.45
emptyMethod · 0.45
getNextMethod · 0.45

Tested by

no test coverage detected