Drag[en]gine Script Module DragonScript
1.23
|
Bezier curve. More...
Public Member Functions | |
Management | |
int | getPointCount () |
Number of points. More... | |
Vector2 | getPointAt (int position) |
Point at position. More... | |
Vector2 | getHandle1At (int position) |
First handle at position. More... | |
Vector2 | getHandle2At (int position) |
Second handle 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... | |
int | addPoint (float pointX, float pointY, float handle1X, float handle1Y, float handle2X, float handle2Y) |
Add point returning index where it has been added. More... | |
int | addPoint (Vector2 point) |
Add point returning index where it has been added. More... | |
int | addPoint (float pointX, float pointY) |
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... | |
CurveBezierInterpolation | getInterpolationMode () |
Interpolation mode. More... | |
void | setInterpolationMode (CurveBezierInterpolation mode) |
Set interpolation mode. More... | |
void | setDefaultLinear () |
Set curve to linear mapping from (0,0) to (1,1). More... | |
void | setDefaultBezier () |
Set curve to default bezier curve from (0,0) to (1,1). More... | |
float | evaluateAt (float x) |
Evaluates curve at position. More... | |
Constructors | |
CurveBezier | new () |
Create bezier curve with CurveBezierInterpolation.bezier interpolation. More... | |
CurveBezier | new (CurveBezier bezier) |
Create copy of bezier curve. More... | |
static CurveBezier | newDefaultLinear () |
Create bezier curve set to linear mapping from (0,0) to (1,1). More... | |
static CurveBezier | newDefaultBezier () |
Create bezier curve set to default bezier curve from (0,0) to (1,1). More... | |
Bezier curve.
Control points composes of a position and two handles. The handles are only used if CurveBezierInterpolation.bezier interpolation is used. With CurveBezierInterpolation.constant 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.
int Dragengine.Scenery.CurveBezier.addPoint | ( | float | pointX, |
float | pointY | ||
) |
Add point returning index where it has been added.
int Dragengine.Scenery.CurveBezier.addPoint | ( | float | pointX, |
float | pointY, | ||
float | handle1X, | ||
float | handle1Y, | ||
float | handle2X, | ||
float | handle2Y | ||
) |
Add point returning index where it has been added.
int Dragengine.Scenery.CurveBezier.addPoint | ( | Vector2 | point | ) |
Add point returning index where it has been added.
Add point returning index where it has been added.
float Dragengine.Scenery.CurveBezier.evaluateAt | ( | float | x | ) |
Evaluates curve at position.
int Dragengine.Scenery.CurveBezier.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.
Vector2 Dragengine.Scenery.CurveBezier.getHandle1At | ( | int | position | ) |
First handle at position.
EOutOfBoundary | position is less than 0 or larger than or equal to getPointCount(). |
Vector2 Dragengine.Scenery.CurveBezier.getHandle2At | ( | int | position | ) |
Second handle at position.
EOutOfBoundary | position is less than 0 or larger than or equal to getPointCount(). |
CurveBezierInterpolation Dragengine.Scenery.CurveBezier.getInterpolationMode | ( | ) |
Interpolation mode.
Vector2 Dragengine.Scenery.CurveBezier.getPointAt | ( | int | position | ) |
Point at position.
EOutOfBoundary | position is less than 0 or larger than or equal to getPointCount(). |
int Dragengine.Scenery.CurveBezier.getPointCount | ( | ) |
Number of points.
CurveBezier Dragengine.Scenery.CurveBezier.new | ( | ) |
Create bezier curve with CurveBezierInterpolation.bezier interpolation.
CurveBezier Dragengine.Scenery.CurveBezier.new | ( | CurveBezier | bezier | ) |
Create copy of bezier curve.
|
static |
Create bezier curve set to default bezier curve from (0,0) to (1,1).
|
static |
Create bezier curve set to linear mapping from (0,0) to (1,1).
void Dragengine.Scenery.CurveBezier.removeAllPoints | ( | ) |
Remove all points.
void Dragengine.Scenery.CurveBezier.removePointFrom | ( | int | position | ) |
Remove point from position.
EOutOfBoundary | position is less than 0 or larger than or equal to getPointCount(). |
void Dragengine.Scenery.CurveBezier.setDefaultBezier | ( | ) |
Set curve to default bezier curve from (0,0) to (1,1).
void Dragengine.Scenery.CurveBezier.setDefaultLinear | ( | ) |
Set curve to linear mapping from (0,0) to (1,1).
void Dragengine.Scenery.CurveBezier.setInterpolationMode | ( | CurveBezierInterpolation | mode | ) |
Set interpolation mode.
EInvalidParam | mode is not a valid value. |