Drag[en]gine Script Module DragonScript Script API  1.0
CurveBezier Class Reference

Bezier curve. More...

Inheritance diagram for CurveBezier:

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...
 

Detailed Description

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.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ addPoint()

int addPoint ( Vector2  point,
Vector2  handle1,
Vector2  handle2 
)

Add point returning index where it has been added.

§ evaluateAt()

float evaluateAt ( float  x)

Evaluates curve at position.

§ findPointPriorTo()

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.

§ getInterpolationMode()

int getInterpolationMode ( )

Interpolation mode.

§ getPointAt()

Vector2 getPointAt ( int  position)

Point at position.

Exceptions
EOutOfBoundaryposition is less than 0 or larger than or equal to getPointCount().

§ getPointCount()

int getPointCount ( )

Number of points.

§ new()

CurveBezier new ( )

Create bezier curve with CurveBezier.BEZIER interpolation.

§ removeAllPoints()

void removeAllPoints ( )

Remove all points.

§ removePointFrom()

void removePointFrom ( int  position)

Remove point from position.

Exceptions
EOutOfBoundaryposition is less than 0 or larger than or equal to getPointCount().

§ setInterpolationMode()

void setInterpolationMode ( int  mode)

Set interpolation mode.

Exceptions
EInvalidParammode is not a valid value.

Member Data Documentation

§ BEZIER

final int BEZIER = 2
static

Bezier interpolation.

§ CONSTANT

final int CONSTANT = 0
static

Constant interpolation.

§ LINEAR

final int LINEAR = 1
static

Linear interpolation.


The documentation for this class was generated from the following file: