This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between 0
and 1
on the Y axis and positions points relative to the 0.5
Y position.
See also Gradient which is designed for color interpolation. See also Curve2D and Curve3D.
TANGENT_FREE = 0
The tangent on this side of the point is user-defined.
TANGENT_LINEAR = 1
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
TANGENT_MODE_COUNT = 2
The total number of available tangent modes.
The number of points to include in the baked (i.e. cached) curve data.
The maximum value the curve can reach.
The minimum value the curve can reach.
The number of points describing the curve.
Adds a point to the curve. For each side, if the *_mode
is TANGENT_LINEAR, the *_tangent
angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the *_tangent
angle if *_mode
is set to TANGENT_FREE.
Recomputes the baked cache of points for the curve.
Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve.
Removes all points from the curve.
Returns the left TangentMode for the point at index
.
Returns the left tangent angle (in degrees) for the point at index
.
Returns the curve coordinates for the point at index
.
Returns the right TangentMode for the point at index
.
Returns the right tangent angle (in degrees) for the point at index
.
Removes the point at index
from the curve.
Returns the Y value for the point that would exist at the X position offset
along the curve.
Returns the Y value for the point that would exist at the X position offset
along the curve using the baked cache. Bakes the curve's points if not already baked.
Sets the left TangentMode for the point at index
to mode
.
Sets the left tangent angle for the point at index
to tangent
.
Sets the offset from 0.5
.
Sets the right TangentMode for the point at index
to mode
.
Sets the right tangent angle for the point at index
to tangent
.
Assigns the vertical position y
to the point at index
.