protected unsafe override void ProcessChannel(ref Channel channel, CompressedTimeSpan currentTime, IntPtr location, float factor)
 {
     if (channel.InterpolationType == AnimationCurveInterpolationType.Cubic)
     {
         *(float *)(location + channel.Offset) = Interpolator.Cubic(
             channel.ValuePrev.Value,
             channel.ValueStart.Value,
             channel.ValueEnd.Value,
             channel.ValueNext.Value,
             factor);
     }
     else if (channel.InterpolationType == AnimationCurveInterpolationType.Linear)
     {
         *(float *)(location + channel.Offset) = Interpolator.Linear(
             channel.ValueStart.Value,
             channel.ValueEnd.Value,
             factor);
     }
     else if (channel.InterpolationType == AnimationCurveInterpolationType.Constant)
     {
         *(float *)(location + channel.Offset) = channel.ValueStart.Value;
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Ejemplo n.º 2
0
 /// <inheritdoc/>
 public override void Linear(ref float value1, ref float value2, float t, out float result)
 {
     result = Interpolator.Linear(value1, value2, t);
 }