public override bool HasNonZeroKeyFrames()
{
for ( int i = 0; i < keyFrameList.Count; i++ )
{
KeyFrame keyFrame = keyFrameList[ i ];
// look for keyframes which have any component which is non-zero
// Since exporters can be a little inaccurate sometimes we use a
// tolerance value rather than looking for nothing
TransformKeyFrame kf = (TransformKeyFrame)keyFrame;
Vector3 trans = kf.Translate;
Vector3 scale = kf.Scale;
Vector3 axis = Vector3.Zero;
Real angle = 0f;
kf.Rotation.ToAngleAxis( ref angle, ref axis );
float tolerance = 1e-3f;
if ( trans.Length > tolerance ||
( scale - Vector3.UnitScale ).Length > tolerance ||
!Utility.RealEqual( Utility.DegreesToRadians( angle ), 0.0f, tolerance ) )
{
return true;
}
}
return false;
}