Struct Curve
A mathematic curve.
struct Curve
;
A curve that can be saved and re-used for other objects. By default, it ranges between 0
and 1
on the Y axis and positions points relative to the 0.5
Y position.
Properties
Name | Type | Description |
---|---|---|
_data [get, set]
|
Array | |
bakeResolution [get, set]
|
long | The number of points to include in the baked (i.e. cached) curve data. |
maxValue [get, set]
|
double | The maximum value the curve can reach. |
minValue [get, set]
|
double | The minimum value the curve can reach. |
Methods
Name | Description |
---|---|
_getData
|
|
_setData
|
|
addPoint
|
Adds a point to the curve. For each side, if the *_mode is constant 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 constant TANGENT_FREE .
|
bake
|
Recomputes the baked cache of points for the curve. |
cleanDupes
|
Removes points that are closer than CMP_EPSILON (0.00001) units to their neighbor on the curve.
|
clearPoints
|
Removes all points from the curve. |
getBakeResolution
|
|
getMaxValue
|
|
getMinValue
|
|
getPointCount
|
Returns the number of points describing the curve. |
getPointLeftMode
|
Returns the left tangentmode for the point at index .
|
getPointLeftTangent
|
Returns the left tangent angle (in degrees) for the point at index .
|
getPointPosition
|
Returns the curve coordinates for the point at index .
|
getPointRightMode
|
Returns the right tangentmode for the point at index .
|
getPointRightTangent
|
Returns the right tangent angle (in degrees) for the point at index .
|
interpolate
|
Returns the Y value for the point that would exist at the X position offset along the curve.
|
interpolateBaked
|
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.
|
removePoint
|
Removes the point at index from the curve.
|
setBakeResolution
|
|
setMaxValue
|
|
setMinValue
|
|
setPointLeftMode
|
Sets the left tangentmode for the point at index to mode .
|
setPointLeftTangent
|
Sets the left tangent angle for the point at index to tangent .
|
setPointOffset
|
Sets the offset from 0.5 .
|
setPointRightMode
|
Sets the right tangentmode for the point at index to mode .
|
setPointRightTangent
|
Sets the right tangent angle for the point at index to tangent .
|
setPointValue
|
Assigns the vertical position y to the point at index .
|
Enums
Name | Description |
---|---|
Constants
|
|
TangentMode
|