Class BezierCurve<T>
An animation spline represented by a set of keyframes, each representing an endpoint of a Bezier curve.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public class BezierCurve<T> : CurveBase<T> where T : new()
Type Parameters
T
The animated value type. |
Constructors
BezierCurve()
BezierCurve(BezierCurve<T>.Keyframe[])
Initializes a new instance of the BezierCurve<T> class.
Declaration
public BezierCurve(params BezierCurve<T>.Keyframe[] keyframes)
Parameters
BezierCurve.Keyframe<>[]
keyframes
The keyframes. |
BezierCurve(IEnumerable<BezierCurve<T>.Keyframe>)
Initializes a new instance of the BezierCurve<T> class.
Declaration
public BezierCurve(IEnumerable<BezierCurve<T>.Keyframe> keyframes)
Parameters
System.Collections.Generic.IEnumerable<BezierCurve.Keyframe<>>
keyframes
The keyframes. |
Fields
Keyframes
The keyframes collection. Can be directly modified but ensure to sort it after editing so keyframes are organized by ascending time value.
Declaration
[Serialize]
public BezierCurve<T>.Keyframe[] Keyframes
Field Value
BezierCurve.Keyframe<>[]
|
Methods
Evaluate(out T, Single, Boolean)
Evaluates the animation curve value at the specified time.
Declaration
public override 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. |
Overrides
EvaluateKey(out BezierCurve<T>.Keyframe, Single, Boolean)
Evaluates the animation curve key at the specified time.
Declaration
public void EvaluateKey(out BezierCurve<T>.Keyframe result, float time, bool loop = true)
Parameters
BezierCurve.Keyframe<>
result
The interpolated key 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 override 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. |
Overrides
TransformTime(Single, Single)
Applies the linear transformation (scale and offset) to the keyframes time values.
Declaration
public override void TransformTime(float timeScale, float timeOffset)
Parameters
System.Single
timeScale
The time scale. |
System.Single
timeOffset
The time offset. |
Overrides
Trim(Single, Single)
Trims the curve keyframes to the specified time range.
Declaration
public override void Trim(float start, float end)
Parameters
System.Single
start
The time start. |
System.Single
end
The time end. |