A Collider representing the rectangle with the rounded edges, forming a 2D capsule.

Constructor

inlinenew(x:Float, y:Float, w:Float, h:Float, rotation:Float)

Create a new RoundRect instance.

Parameters:

x

The horizontal position of the rectangle center.

y

The vertical position of the rectangle center.

w

The width of the rectangle.

h

The height of the rectangle.

rotation

The rotation of the rectangle.

Variables

x:Float

The horizontal position of the rectangle center.

y:Float

The vertical position of the rectangle center.

Methods

contains(p:Point):Bool

Tests is given Point p is inside the capsule area.

inlinedistance(p:Point):Float

Returns the distance of the Point p to the edge of the capsule.

inlinedistanceCenterSq(p:Point):Float

Returns the squared distance of the Point p to the central segment of the capsule

inlinegetNormalAt(p:Point):Point

Returns an outwards normal of of the capsule edge in the direction of the Point p.

Normal points outwards regardless of the Point being inside or outside of the capsule.

inlineinside(p:Point):Bool

Tests is given Point p is inside the capsule area.