Class CurveBase<T>
An animation spline represented by a set of keyframes, each representing an endpoint of an curve.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public abstract class CurveBase<T> : Object where T : new()
Type Parameters
T
The animated value type. |
Constructors
CurveBase()
Declaration
protected CurveBase()
Fields
_accessor
The keyframes data accessor.
Declaration
[NoSerialize]
protected readonly CurveBase<T>.IKeyframeAccess<T> _accessor
Field Value
CurveBase.IKeyframeAccess<T>
|
Methods
Evaluate(out T, Single, Boolean)
Evaluates the animation curve value at the specified time.
Declaration
public abstract void Evaluate(out T result, float time, bool loop = true)
Parameters
T
result
The interpolated value from the curve at provided time. |
System.Single
time
The time to evaluate the curve at. |
System.Boolean
loop
If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped. |
FindKeys(Single, out Int32, out Int32)
Returns a pair of keys that can be used for interpolating to field the value at the provided time.
Declaration
public abstract void FindKeys(float time, out int leftKey, out int rightKey)
Parameters
System.Single
time
The time for which to find the relevant keys from. It is expected to be clamped to a valid range within the curve. |
System.Int32
leftKey
The index of the key to interpolate from. |
System.Int32
rightKey
The index of the key to interpolate to. |
TransformTime(Single, Single)
Applies the linear transformation (scale and offset) to the keyframes time values.
Declaration
public abstract void TransformTime(float timeScale, float timeOffset)
Parameters
System.Single
timeScale
The time scale. |
System.Single
timeOffset
The time offset. |
Trim(Single, Single)
Trims the curve keyframes to the specified time range.
Declaration
public abstract void Trim(float start, float end)
Parameters
System.Single
start
The time start. |
System.Single
end
The time end. |
WrapTime(ref Single, Single, Single, Boolean)
Wraps the time for the curve sampling with looping mode.
Declaration
protected static void WrapTime(ref float time, float start, float end, bool loop)
Parameters
System.Single
time
The time to wrap. |
System.Single
start
The start time. |
System.Single
end
The end time. |
System.Boolean
loop
If set to |