public AnimatableModel(Game1 game, ANSKModelContent model, Vector3 pos)
        {
            _game = game;
            _model = new ANSKModel(model);
            _modelTexture = null;

            //_model = ModelRegistry.GetModel("TestNormalBlendOppCorners2");

            _ansk = new ANSK( _model, game);
            //_skinData = _model.Tag as ANSKTagData;

            //if (_skinData == null)
            if (_ansk.SkinningAndBasicAnims == null)
                throw new InvalidOperationException("The model " + _model.ToString() + " does not contain the data needed for animations.");

            //_player = new AnimationPlayer(_skinData);
            _player = new AnimationPlayer(_ansk.SkinningAndBasicAnims);

            _currentClip = null;

            _player.Looped = false;

            _collisionSphereRadius = 0.1f;
            _parentCollisionSphereRadius = 0.6f;

            GenerateBoundingSpheres(Matrix.Identity);
        }
        public void StartClip(AnimationClip clip, bool looped)
        {
            if (clip == null)
                throw new ArgumentNullException("clip");

            currentClipValue = clip;
            currentTimeValue = TimeSpan.Zero;
            currentKeyframe = 0;
            _isPaused = false;

            // Initialize bone transforms to the bind pose.
            skinningDataValue.BindPose.CopyTo(boneTransforms, 0);
            _looped = looped;
        }
        public void PlayAnimation(string name)
        {
            //_currentClip = _skinData.AnimationClips[name];
            _currentClip = _ansk.SkinningAndBasicAnims.AnimationClips[name];

            _player.StartClip(_currentClip);

            _player.Looped = true;
        }
        public void PlayAnimation(string name, bool looped)
        {
            //_currentClip = _skinData.AnimationClips[name];
            _currentClip = _ansk.SkinningAndBasicAnims.AnimationClips[name];

            _player.StartClip(_currentClip, looped);
        }
示例#5
0
        public void PlayAnimation(string name)
        {
            _currentClip = _skin.AnimationClips[name];

            _player.StartClip(_currentClip);
        }