public AnimEvaluator(Animation anim) {
     LastTime = 0.0f;
     TicksPerSecond = anim.TicksPerSecond > 0.0f ? (float)anim.TicksPerSecond : 920.0f;
     Duration = (float)anim.DurationInTicks;
     Name = anim.Name;
     Channels = new List<AnimationChannel>();
     foreach (var channel in anim.NodeAnimationChannels) {
         var c = new AnimationChannel {
             Name = channel.NodeName,
             PositionKeys = channel.PositionKeys.ToList(),
             RotationKeys = channel.RotationKeys.ToList(),
             ScalingKeys = channel.ScalingKeys.ToList()
         };
         Channels.Add(c);
     }
     LastPositions = Enumerable.Repeat(new MutableTuple<int, int, int>(0, 0, 0), anim.NodeAnimationChannelCount).ToList();
     Transforms = new List<List<Matrix>>();
     PlayAnimationForward = true;
 }
Esempio n. 2
0
 public AnimEvaluator(Animation anim) {
     LastTime = 0.0f;
     TicksPerSecond = anim.TicksPerSecond > 0.0f ? (float)anim.TicksPerSecond : 920.0f;
     Duration = (float)anim.DurationInTicks;
     Name = anim.Name;
     Channels = new List<AnimationChannel>();
     foreach (var channel in anim.NodeAnimationChannels) {
         var c = new AnimationChannel {
             Name = channel.NodeName,
             PositionKeys = channel.PositionKeys.ToList(),
             RotationKeys = channel.RotationKeys.ToList(),
             ScalingKeys = channel.ScalingKeys.ToList()
         };
         Channels.Add(c);
     }
     LastPositions = Enumerable.Repeat(new MutableTuple<int, int, int>(0, 0, 0), anim.NodeAnimationChannelCount).ToList();
     Transforms = new List<List<Matrix>>();
     PlayAnimationForward = true;
 }