コード例 #1
0
        /// <summary>
        /// Constructor for the animation player. It makes the
        /// association between a clip and a model and sets up for playing
        /// </summary>
        /// <param name="clip"></param>
        public AnimationPlayer(AnimationClip clip, AnimatedModel model)
        {
            this.clip  = clip;
            this.model = model;

            // Create the bone information classes
            boneCnt   = clip.Bones.Count;
            boneInfos = new Dictionary <string, BoneInfo>();

            for (int b = 0; b < boneCnt; b++)
            {
                // Create it
                boneInfos[clip.Bones[b].Name] = new BoneInfo(clip.Bones[b]);

                // Assign it to a model bone
                boneInfos[clip.Bones[b].Name].SetModel(model);
            }

            Rewind();
        }
コード例 #2
0
 /// <summary>
 /// Assign this bone to the correct bone in the model
 /// </summary>
 /// <param name="model"></param>
 public void SetModel(AnimatedModel model)
 {
     // Find this bone
     assignedBone = model.FindBone(ClipBone.Name);
 }