Exemplo n.º 1
0
        public AnimatorList(FBXModel model)
        {
            /// Note these are only setting up capacity, they're still empty.
            animList     = new List <AnimationInstance>(model.NumLODs);
            restPalettes = new List <Matrix[]>(model.NumLODs);
            lastUpdates  = new List <int>(model.NumLODs);

            for (int lod = 0; lod < model.NumLODs; ++lod)
            {
                AnimationInstance animator = model.MakeAnimator(lod);
                if (animator != null)
                {
                    animList.Add(animator);
                    lastUpdates.Add(0);

                    Matrix[] animPalette = animList[lod].Palette;
                    int      boneCount   = animPalette.Length;

                    Matrix[] palette = new Matrix[boneCount];
                    for (int bone = 0; bone < boneCount; ++bone)
                    {
                        palette[bone] = animPalette[bone];
                    }
                    restPalettes.Add(palette);
                }
            }
        }
Exemplo n.º 2
0
 private void LoadAnimations(FBXModel sro)
 {
     _animator   = sro.MakeAnimator();
     _animOpenA  = new AnimationController(null, _animator.Animations["open_A"]);
     _animCloseA = new AnimationController(null, _animator.Animations["close_A"]);
     _animOpenB  = new AnimationController(null, _animator.Animations["open_B"]);
     _animCloseB = new AnimationController(null, _animator.Animations["close_B"]);
     // test: just to show that animation is loaded and working
     _animOpenA.SpeedFactor = 0;
     SetAnimation(_animOpenA);
 }