Static methods

@:value({ dy : 1, dx : 1, y : 0, x : 0 })staticinlineget(x:Float = 0, y:Float = 0, dx:Float = 1, dy:Float = 1):Line

staticinlineget_from_vector(start:Vector2, degrees:Float, length:Float):Line

Gets a Line with the defined start point, angle (in degrees), and length.

Parameters:

start

A Vector2 describing the starting position of the Line.

degrees

The angle of the Line (in degrees).

length

The length of the Line.

staticinlineget_from_vectors(start:Vector2, end:Vector2):Line

staticget_pool():Pool<Line>

Variables

@:alias(end.x)dx:Float

@:alias(end.y)dy:Float

@:alias(start.distanceTo(end))read onlylength:Float

@:value(false)read onlypooled:Bool = false

read onlyradians:Float

@:alias(start.x)x:Float

@:alias(start.y)y:Float

Methods

inlinebounds(?aabb:AABB):Null<AABB>

inlinepoint_along_ratio(ratio:Float):Vector2

Gets a position on the Line at the specified ratio.

Parameters:

ratio

The ratio from the Line's start and end points (expects a value between 0.0 and 1.0).

Returns:

Vector2

@:value({ clamp : true })inlineproject_point(point:Vector2, clamp:Bool = true):Vector2

inlineput():Void

@:value({ clamp : true })inlineratio_of_point(point:Vector2, clamp:Bool = true):Float

@:value({ dy : 1, dx : 1, y : 0, x : 0 })inlineset(x:Float = 0, y:Float = 0, dx:Float = 1, dy:Float = 1):Line

set_from_vector(start:Vector2, degrees:Float, length:Float):Line

Sets the Line with the defined start point, angle (in degrees), and length.

Parameters:

start

A Vector2 describing the starting position of the Line.

degrees

The angle of the Line (in degrees).

length

The length of the Line.

inlineside(point:Vector2, ?set:Vector2):Vector2

Gets the Line's normal based on the relative position of the point.

@:value({ put_self : false })inlineto_aabb(put_self:Bool = false):Null<AABB>