예제 #1
0
        public AnimatedModel model;//, animation;

        public R_Animation(string assetName, int animationClip, RenderMethod renderMethod = RenderMethod.Deferred)
        {
            model = new AnimatedModel(assetName);
            model.LoadContent(renderMethod);
            if (animationClip >= model.Clips.Count)
            {
                animationClip = -1;
            }

            if (animationClip == -1)
            {
                IdentityPose();
            }
            else if (animationClip >= 0 && animationClip < model.Clips.Count)
            {
                AnimationClip   clip   = model.Clips[animationClip];
                AnimationPlayer player = model.PlayClip(clip, true);
            }
        }
예제 #2
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, float start)
        {
            this.clip  = clip;
            this.model = model;

            // Create the bone information classes
            boneCnt   = clip.Bones.Count;
            boneInfos = new BoneInfo[boneCnt];

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

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

            Rewind(start);
        }
예제 #3
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);
 }