Controls how animations are played and interpolated.
Inheritance: IAnimationController, IBlendable
        /// <summary>
        /// Initializes a new instance of the <see cref="AnimatedController"/> class.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="StartAnimationName">Start name of the animation.</param>
        /// <param name="changeOnlyWhenDifferentAnimation">if set to <c>true</c> [change the current animationonly only when different animation is set].</param>
        public AnimatedController(IAnimatedModel model, String StartAnimationName = null,bool changeOnlyWhenDifferentAnimation = true)            
        {
            skinnedModel = model.GetAnimation() as SkinnedModel;
            animationController = new AnimationController(skinnedModel.SkeletonBones);            
            this.StartAnimationName = StartAnimationName;
            this.actualAnimation = StartAnimationName;
            if(StartAnimationName != null)
                animationController.StartClip(skinnedModel.AnimationClips[StartAnimationName]);
            this.changeOnlyWhenDifferentAnimation = changeOnlyWhenDifferentAnimation;

        }
        private void reinitialize2(SkinnedModel skinnedModel)
        {
            this.skinnedModel = skinnedModel;
            //setNewEffect();

            // Create an animation controller and start a clip
            animationController = new AnimationController(skinnedModel.SkeletonBones);
            animationController.Speed = 0.5f;

            animationController.TranslationInterpolation = InterpolationMode.Linear;
            animationController.OrientationInterpolation = InterpolationMode.Linear;
            animationController.ScaleInterpolation = InterpolationMode.Linear;

            //animationController.StartClip(skinnedModel.AnimationClips[animation]);
        }
        public AnimatedModel(Game1 game,SkinnedModel skinnedModel)
            : base(game,skinnedModel.Model)
        {
            this.skinnedModel = skinnedModel;
            //setNewEffect();

            // Create an animation controller and start a clip
            animationController = new AnimationController(skinnedModel.SkeletonBones);
            animationController.Speed = 0.5f;

            animationController.TranslationInterpolation = InterpolationMode.Linear;
            animationController.OrientationInterpolation = InterpolationMode.Linear;
            animationController.ScaleInterpolation = InterpolationMode.Linear;

            //animationController.StartClip(skinnedModel.AnimationClips[animation]);
        }
Exemplo n.º 4
0
        public AnimatedModel3D(string nameCharacter, SceneManager scene, Vector3 position, Vector3 scale, float speed = 1)
        {
            ModelName = nameCharacter;
            Model = Global.RessourceProvider.AnimatedModels[ModelName];
            Scene = scene;
            Position = position;
            Scale = scale;
            _animClip = 0;

            AnimationController = new AnimationController(Model.SkeletonBones)
            {
                Speed = speed,
                TranslationInterpolation = InterpolationMode.Linear,
                OrientationInterpolation = InterpolationMode.Linear,
                ScaleInterpolation = InterpolationMode.Linear
            };

            _speed = speed;

            SetAnimation(Animation.Default);
        }
Exemplo n.º 5
0
        private void LoadContent()
        {
            // Load the skinned model
            skinnedModel = Game1.Content.Load<SkinnedModel>(@"Models\PlayerMarine");
            finalBoneTransform = new Matrix[skinnedModel.SkeletonBones.Count];

            // Create an animation controller and start a clip
            animationController = new AnimationController(skinnedModel.SkeletonBones);
            SetAnimation("Idle");
        }
Exemplo n.º 6
0
        public void init()
        {
            animationController = new AnimationController(model.SkeletonBones);

            animationController.StartClip(model.AnimationClips.Values[activeAnimationClipIndex]);
        }