Class CurveBase
An animation spline represented by a set of read-only keyframes, each representing an endpoint of a curve.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Animations/Curve.h
Syntax
public class CurveBase<T, KeyFrame>
Type Parameters
class T
|
typename KeyFrame
|
Constructors
~CurveBase()
CurveBase()
CurveBase(const T& defaultValue)
Initializes a new instance of the Curve class.
Declaration
public CurveBase(const T& defaultValue)
Parameters
T
defaultValue
The default keyframe value. |
Fields
_default
Declaration
protected T _default
Field Value
T
|
Methods
Evaluate(const KeyFrameData& data, T& result, float time, bool loop=true)
Evaluates the animation curve value at the specified time.
Declaration
public void Evaluate(const KeyFrameData& data, T& result, float time, bool loop=true) const
Parameters
KeyFrameData
data
The keyframes data container. |
T
result
The interpolated value from the curve at provided time. |
float
time
The time to evaluate the curve at. |
bool
loop
If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped. |
EvaluateFirstDerivative(const KeyFrameData& data, T& result, float time, bool loop=true)
Evaluates the first derivative of the animation curve at the specified time (aka velocity).
Declaration
public void EvaluateFirstDerivative(const KeyFrameData& data, T& result, float time, bool loop=true) const
Parameters
KeyFrameData
data
The keyframes data container. |
T
result
The calculated first derivative from the curve at provided time. |
float
time
The time to evaluate the curve at. |
bool
loop
If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped. |
EvaluateKey(const KeyFrameData& data, KeyFrame& result, float time, bool loop=true)
Evaluates the animation curve key at the specified time.
Declaration
public void EvaluateKey(const KeyFrameData& data, KeyFrame& result, float time, bool loop=true) const
Parameters
KeyFrameData
data
The keyframes data container. |
KeyFrame
result
The interpolated key from the curve at provided time. |
float
time
The time to evaluate the curve at. |
bool
loop
If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped. |
FindKeys(const KeyFrameData& data, float time, int32& leftKey, int32& rightKey)
Returns a pair of keys that can be used for interpolating to field the value at the provided time.
Declaration
protected void FindKeys(const KeyFrameData& data, float time, int32& leftKey, int32& rightKey) const
Parameters
KeyFrameData
data
The keyframes data container. |
float
time
The time for which to find the relevant keys from. It is expected to be clamped to a valid range within the curve. |
int32
leftKey
The index of the key to interpolate from. |
int32
rightKey
The index of the key to interpolate to. |
GetDefaultValue()
Gets the default value for the keyframes.
Declaration
public T GetDefaultValue() const
Returns
T
|