コード例 #1
0
        /// <summary>
        /// Gets the current transform for the given BonePose object in the animation.
        /// This is only called when a bone pose is affected by the current animation.
        /// </summary>
        /// <param name="pose">The BonePose object querying for the current transform in
        /// the animation.</param>
        /// <returns>The current transform of the bone.</returns>
        public virtual Matrix GetCurrentBoneTransform(BonePose pose)
        {
            AnimationChannelCollection channels = animation.AnimationChannels;
            BoneKeyframeCollection     channel  = channels[pose.Name];
            int boneIndex = channel.GetIndexByTime(elapsedTime);

            return(channel[boneIndex].Transform);
        }
コード例 #2
0
 // Internal because it should only be created by the AnimationReader
 internal AnimationInfo(string animationName, AnimationChannelCollection
                        anims)
 {
     this.animationName = animationName;
     boneAnimations     = anims;
     foreach (BoneKeyframeCollection channel in anims)
     {
         if (channel.Duration > duration)
         {
             duration = channel.Duration;
         }
     }
 }