Static methods

staticpoint_on_cubic_curve(t:Float, ax:Float, ay:Float, bx:Float, by:Float, cx:Float, cy:Float, dx:Float, dy:Float):Vector2

Gets the point at the defined t (a value between 0.0 to 1.0) from a Cubic Bezier Curve constructed out of points (ax, ay), (bx, by), (cx, cy), and (dx, dy).

staticpoint_on_quadratic_curve(t:Float, ax:Float, ay:Float, bx:Float, by:Float, cx:Float, cy:Float):Vector2

Gets the point at the defined t (a value between 0.0 to 1.0) from a Quadratic Bezier Curve constructed out of points (ax, ay), (bx, by), and (cx, cy).

staticsubdivide_cubic_bezier_curve(ax:Float, ay:Float, bx:Float, by:Float, cx:Float, cy:Float, dx:Float, dy:Float, ?points:Array<Vector2>, options:BezierSubdivisionOptions):Null<Array<Vector2>>

Ported from https://github.com/mattdesl/adaptive-bezier-curve

staticsubdivide_quadratic_bezier_curve(ax:Float, ay:Float, bx:Float, by:Float, cx:Float, cy:Float, ?points:Array<Vector2>, options:BezierSubdivisionOptions):Null<Array<Vector2>>

Ported from https://github.com/mattdesl/adaptive-quadratic-curve

Constructor

@:value({ curve_mode : Cubic })new(?control_points:Array<Vector2>, curve_mode:BezierCurve = Cubic)

Variables

read onlycontrol_count:Int

The amount of control points in this Curve.

@:value(0)read onlycurve_count:Int = 0

read onlylength:Float

@:value(Subdivisions())line_mode:BezierLineMode = Subdivisions()

The method used to construct lines from the Curve.

@:value([])read onlylines:Array<Line> = []

Cached Array of Lines that represents the current state of the Curve.

@:value([])read onlypoints:Array<Vector2> = []

Cached Array of Points that represents the current state of the Curve.

Methods

@:value({ start_index : -1 })inlineget_point(t:Float, start_index:Int = -1):Null<Vector2>

Gets the point on the Curve at the defined t.

Parameters:

t

A value between 0.0 to 1.0.

start_index

Determines the starting control point that will be used to construct the Curve. If set to -1, this will be determined automatically based on t.

@:value({ move_neighbors : true })set_control_point(index:Int, x:Float, y:Float, move_neighbors:Bool = true):Void