Drag[en]gine Script Module DragonScript Script API
1.0
|
Bezier curve. More...
Public Member Functions | |
Constructors | |
CurveBezier | new () |
Create bezier curve with CurveBezier.BEZIER interpolation. More... | |
Management | |
int | getPointCount () |
Number of points. More... | |
Vector2 | getPointAt (int position) |
Point at position. More... | |
int | findPointPriorTo (float coordinate) |
Index of point with matching x coordinates or point right before coordinate. More... | |
int | addPoint (Vector2 point, Vector2 handle1, Vector2 handle2) |
Add point returning index where it has been added. More... | |
void | removePointFrom (int position) |
Remove point from position. More... | |
void | removeAllPoints () |
Remove all points. More... | |
int | getInterpolationMode () |
Interpolation mode. More... | |
void | setInterpolationMode (int mode) |
Set interpolation mode. More... | |
float | evaluateAt (float x) |
Evaluates curve at position. More... | |
Static Public Attributes | |
static final int | BEZIER = 2 |
Bezier interpolation. More... | |
static final int | CONSTANT = 0 |
Constant interpolation. More... | |
static final int | LINEAR = 1 |
Linear interpolation. More... | |
Bezier curve.
Control points composes of a position and two handles. The handles are only used if CurveBezier.BEZIER interpolation is used. With CurveBezier.CONSTANT interpolation the same value is used from the starting coordinates up to but excluding the coordinates of the next point.
Bezier curves are two dimensional.
This is a native class.
Add point returning index where it has been added.
float evaluateAt | ( | float | x | ) |
Evaluates curve at position.
int findPointPriorTo | ( | float | coordinate | ) |
Index of point with matching x coordinates or point right before coordinate.
This method can be used to find the interval a point is located in by returning the most prior point. Returns -1 if there are no points satisfying this criteria.
int getInterpolationMode | ( | ) |
Interpolation mode.
Vector2 getPointAt | ( | int | position | ) |
Point at position.
EOutOfBoundary | position is less than 0 or larger than or equal to getPointCount(). |
int getPointCount | ( | ) |
Number of points.
CurveBezier new | ( | ) |
Create bezier curve with CurveBezier.BEZIER interpolation.
void removeAllPoints | ( | ) |
Remove all points.
void removePointFrom | ( | int | position | ) |
Remove point from position.
EOutOfBoundary | position is less than 0 or larger than or equal to getPointCount(). |
void setInterpolationMode | ( | int | mode | ) |
Set interpolation mode.
EInvalidParam | mode is not a valid value. |
|
static |
Bezier interpolation.
|
static |
Constant interpolation.
|
static |
Linear interpolation.