Table of Contents

Class ComputeAnimationCurve<T>

Namespace
Stride.Animations
Assembly
Stride.Engine.dll

A node which describes a binary operation between two compute curves

[DataContract(Inherited = true)]
[Display("Animation", null, Expand = ExpandRule.Never)]
public abstract class ComputeAnimationCurve<T> : Comparer<AnimationKeyFrame<T>>, IComparer<AnimationKeyFrame<T>>, IComparer, IComputeCurve<T>, IComputeCurve where T : struct

Type Parameters

T

Sampled data's type

Inheritance
ComputeAnimationCurve<T>
Implements
Derived
Inherited Members

Properties

KeyFrames

public TrackingCollection<AnimationKeyFrame<T>> KeyFrames { get; set; }

Property Value

TrackingCollection<AnimationKeyFrame<T>>

Methods

Compare(AnimationKeyFrame<T>, AnimationKeyFrame<T>)

When overridden in a derived class, performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.

public override int Compare(AnimationKeyFrame<T> x, AnimationKeyFrame<T> y)

Parameters

x AnimationKeyFrame<T>

The first object to compare.

y AnimationKeyFrame<T>

The second object to compare.

Returns

int

A signed integer that indicates the relative values of x and y, as shown in the following table.

Value Meaning
Less than zerox is less than y.
Zerox equals y.
Greater than zerox is greater than y.

Exceptions

ArgumentException

Type T does not implement either the IComparable<T> generic interface or the IComparable interface.

Cubic(ref T, ref T, ref T, ref T, float, out T)

public abstract void Cubic(ref T value1, ref T value2, ref T value3, ref T value4, float t, out T result)

Parameters

value1 T
value2 T
value3 T
value4 T
t float
result T

Evaluate(float)

Evaluates the compute curve's value at the specified location, usually in the [0 .. 1] range

public T Evaluate(float location)

Parameters

location float

Location to sample at

Returns

T

Sampled value

Linear(ref T, ref T, float, out T)

public abstract void Linear(ref T value1, ref T value2, float t, out T result)

Parameters

value1 T
value2 T
t float
result T

SampleRaw(float)

Unoptimized sampler which searches all the keyframes in order. Intended to be used for baking purposes only

protected T SampleRaw(float t)

Parameters

t float

Location t to sample at, between 0 and 1

Returns

T

Sampled and interpolated data value

UpdateChanges()

Updates any optimizations in the curve if data has changed.

public bool UpdateChanges()

Returns

bool

true there were changes since the last time; otherwise, false.