Axis Aligned collision primitive for Excalibur.
Constructor allows passing of either an object with all coordinate components, or the coordinate components passed separately.
Either x coordinate of the left edge or an options object containing the four coordinate components.
y coordinate of the top edge
x coordinate of the right edge
y coordinate of the bottom edge
Returns the calculated height of the bounding box
Returns the calculated width of the bounding box
Draw a debug bounding box
Returns the perimeter of the bounding box
Return whether the bounding box has zero dimensions in height,width or both
Test wether this bounding box intersects with another returning the intersection vector that can be used to resolve the collision. If there is no intersection null is returned.
A Vector in the direction of the current BoundingBox, this <- other
Returns true if the bounding boxes overlap.
Optionally specify a small epsilon (default 0) as amount of overlap to ignore as overlap. This epsilon is useful in stable collision simulations.
Determines whether a ray intersects with a bounding box
Rotates a bounding box by and angle and around a point, if no point is specified (0, 0) is used by default. The resulting bounding box is also axis-align. This is useful when a new axis-aligned bounding box is needed for rotated geometry.
Scale a bounding box by a scale factor, optionally provide a point