Exemplo n.º 1
0
        public AnimationInstance(ModelInstance modelInstance, W3DAnimation animation,
                                 AnimationMode mode, AnimationFlags flags)
        {
            _animation     = animation;
            _mode          = mode;
            _flags         = flags;
            _boneInstances = modelInstance.ModelBoneInstances;

            _keyframeIndices = new int[animation.Clips.Length];

            if (_flags.HasFlag(AnimationFlags.StartFrameFirst) ||
                _flags == AnimationFlags.None)
            {
                _currentTimeValue = TimeSpan.Zero;
            }
            else if (_flags.HasFlag(AnimationFlags.StartFrameLast))
            {
                _currentTimeValue = _animation.Duration;
            }
            else
            {
                //TODO: implement other flags
                //throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
 private void ResetTimeStamps()
 {
     if (_flags.HasFlag(AnimationFlags.StartFrameFirst) ||
         _flags == AnimationFlags.None)
     {
         _currentTimeValue = TimeSpan.Zero;
     }
     else if (_flags.HasFlag(AnimationFlags.StartFrameLast))
     {
         _currentTimeValue = _animation.Duration;
     }
     else
     {
         //TODO: implement other flags
         //throw new NotImplementedException();
     }
 }
Exemplo n.º 3
0
 private void ResetTimeStamps()
 {
     if (_flags == AnimationFlags.None ||
         _flags.HasFlag(AnimationFlags.StartFrameFirst) ||
         _flags.HasFlag(AnimationFlags.StartFrameLast))
     {
         if (Reverse || _flags.HasFlag(AnimationFlags.StartFrameLast))
         {
             _currentTimeValue = _animation.Clips.Max(c => c.Keyframes.LastOrDefault().Time);
         }
         else
         {
             _currentTimeValue = TimeSpan.Zero;
         }
     }
     else if (_flags.HasFlag(AnimationFlags.RandomStart))
     {
         _currentTimeValue = TimeSpan.FromMilliseconds(_random.Next((int)_animation.Duration.TotalMilliseconds));
     }
     else
     {
         //TODO: implement other flags
         //throw new NotImplementedException();
     }
 }