4 using SiliconStudio.Core.Mathematics;
6 namespace SiliconStudio.
Paradox.DataModel
12 SetTime(ref channel, newTime);
14 var currentTime = channel.CurrentTime;
15 var currentIndex = channel.CurrentIndex;
17 var keyFrames = channel.Curve.KeyFrames;
18 var keyFramesItems = keyFrames.Items;
19 var keyFramesCount = keyFrames.Count;
22 int timeStart = keyFrames[currentIndex + 0].Time.Ticks;
23 int timeEnd = keyFrames[currentIndex + 1].Time.Ticks;
26 float t = ((float)currentTime.Ticks - (
float)timeStart) / ((
float)timeEnd - (float)timeStart);
30 Interpolator.Quaternion.Cubic(
31 ref keyFramesItems[currentIndex > 0 ? currentIndex - 1 : 0].Value,
32 ref keyFramesItems[currentIndex].Value,
33 ref keyFramesItems[currentIndex + 1].Value,
34 ref keyFramesItems[currentIndex + 2 >= keyFramesCount ? currentIndex + 1 : currentIndex + 2].Value,
36 out *(
Quaternion*)(location + channel.Offset));
40 Interpolator.Quaternion.SphericalLinear(
41 ref keyFramesItems[currentIndex].Value,
42 ref keyFramesItems[currentIndex + 1].Value,
44 out *(
Quaternion*)(location + channel.Offset));
48 throw new NotImplementedException();
AnimationCurveInterpolationType
Describes how a curve should be interpolated.
Represents a four dimensional mathematical quaternion.
unsafe override void ProcessChannel(ref Channel channel, CompressedTimeSpan newTime, IntPtr location)