Creates a new Curve instance.
Optional
data: number[]An array of keys (pairs of numbers with the time first and value second).
The keys that define the curve. Each key is an array of two numbers with the time first and the value second.
Controls how CURVE_SPLINE tangents are calculated. Valid range is between 0 and 1 where 0 results in a non-smooth curve (equivalent to linear interpolation) and 1 results in a very smooth curve. Use 0.5 for a Catmull-Rom spline.
The curve interpolation scheme. Can be:
Defaults to CURVE_SMOOTHSTEP.
Adds a new key to the curve.
Time to add new key.
Value of new key.
The newly created [time, value]
pair.
Gets the [time, value]
pair at the specified index.
The index of key to return.
The [time, value]
pair at the specified index.
Sorts keys by time.
Returns the interpolated value of the curve at specified time.
The time at which to calculate the value.
The interpolated value.
A curve is a collection of keys (time/value pairs). The shape of the curve is defined by its type that specifies an interpolation scheme for the keys.