A raycast from the given position in a specified direction.

Static methods

staticinlinefromPoints(p1:Point, p2:Point):Ray

Returns a new Ray starting at Point p1 and pointing at Point p2.

staticinlinefromValues(x:Float, y:Float, dx:Float, dy:Float):Ray

Returns a new Ray at given position and direction.

Constructor

inlinenew()

Create a new Ray instance.

Variables

lx:Float

X normal of the ray direction.

ly:Float

Y normal of the ray direction.

px:Float

X position of the ray start.

py:Float

Y position of the ray start.

Methods

inlinegetDir():Point

Returns new Point containing Ray direction.

inlinegetPoint(distance:Float):Point

Returns a new Point containing the Ray vector with specified length.

inlinegetPos():Point

Returns new Point containing Ray starting position.

inlineside(p:Point):Float

Returns a positive value if Point p is on the right side of the Ray axis and negative if it's on the left.