Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AnimationCurveEvaluatorOptimizedVector3Group.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using SiliconStudio.Core.Mathematics;
5 
6 namespace SiliconStudio.Paradox.DataModel
7 {
8  public class AnimationCurveEvaluatorOptimizedVector3Group : AnimationCurveEvaluatorOptimizedGroup<Vector3>
9  {
10  protected unsafe override void ProcessChannel(ref Channel channel, CompressedTimeSpan currentTime, IntPtr location, float factor)
11  {
12  if (channel.InterpolationType == AnimationCurveInterpolationType.Cubic)
13  {
14  Interpolator.Vector3.Cubic(
15  ref channel.ValuePrev.Value,
16  ref channel.ValueStart.Value,
17  ref channel.ValueEnd.Value,
18  ref channel.ValueNext.Value,
19  factor,
20  out *(Vector3*)(location + channel.Offset));
21  }
22  else if (channel.InterpolationType == AnimationCurveInterpolationType.Linear)
23  {
24  Interpolator.Vector3.Linear(
25  ref channel.ValueStart.Value,
26  ref channel.ValueEnd.Value,
27  factor,
28  out *(Vector3*)(location + channel.Offset));
29  }
30  else
31  {
32  throw new NotImplementedException();
33  }
34  }
35  }
36 }
AnimationCurveInterpolationType
Describes how a curve should be interpolated.
unsafe override void ProcessChannel(ref Channel channel, CompressedTimeSpan currentTime, IntPtr location, float factor)
Represents a three dimensional mathematical vector.
Definition: Vector3.cs:42