Пример #1
0
        public Actor(ContentRegister content, UpdateManager updateManager)
        {
            //load the model
            model = new ModelInstance();
            content.Add(this);

            //create the animation controller
            animationController = model.GetAsyncAnimationController(updateManager);

            //NEW CODE
            //create the animation modifier

            int rotateBoneIndex = model.ModelData.Skeleton.GetBoneIndexByName("Bip01_Spine2");

            this.animationModifer = new AnimationModifier(rotateBoneIndex, model.ModelData);

            //set the modifier on the animation controller
            this.animationController.AnimationBoneModifier = this.animationModifer;

            //play the run animation
            int animationIndex = animationController.AnimationIndex("Jog");

            this.animation = animationController.PlayLoopingAnimation(animationIndex);
        }
		public Actor(ContentRegister content, UpdateManager updateManager)
		{
			//load the model
			model = new ModelInstance();
			content.Add(this);

			//create the animation controller
			animationController = model.GetAsyncAnimationController(updateManager);

			//NEW CODE
			//create the animation modifier

			int rotateBoneIndex = model.ModelData.Skeleton.GetBoneIndexByName("Bip01_Spine2");
			this.animationModifer = new AnimationModifier(rotateBoneIndex, model.ModelData);

			//set the modifier on the animation controller
			this.animationController.AnimationBoneModifier = this.animationModifer;

			//play the run animation
			int animationIndex = animationController.AnimationIndex("Jog");
			this.animation = animationController.PlayLoopingAnimation(animationIndex);
		}