Axis Aligned Bounding Box (AABB)
Note that in many cases of an AABB object being returned by a Nape function
the AABB object will be marked internally as an 'immutable' AABB. This will
always be documented and trying to mutate such an AABB will result in an
error being thrown.
Constructor
new(x:Float = 0, y:Float = 0, width:Float = 0, height:Float = 0)
Construct a new AABB.
As input width/height are permitted to be negative it is not guaranteed
that the resultant AABB will have the same parameters as those
specified as the AABB parameters are guaranteed to always have positive
width/height, and for x/y to always be the top-left corner.
Parameters:
x | The x coordinate of the top-left corner of the AABB. (default 0) |
---|---|
y | The y coordinate of the top-left corner of the AABB (default 0) |
width | The width of the AABB. This value may be negative. (default 0) |
height | The height of the AABB. This value may be negative. (default 0) |
Returns:
The newly constructed AABB object.
Variables
min:Vec2
The minimum bounds for the AABB.
Euivalent to the top-left corner.
This Vec2 is intrinsically linked to the AABB so that modifications
to this object are reflected in changes to the AABB and vice-versa.
If the AABB is immutable, then this Vec2 will also be immutable.
This value can be set with the = operator, equivalent to performing
aabb.min.set(value)
.
max:Vec2
The maximum bounds for the AABB.
Euivalent to the bottom-right corner.
This Vec2 is intrinsically linked to the AABB so that modifications
to this object are reflected in changes to the AABB and vice-versa.
If the AABB is immutable, then this Vec2 will also be immutable.
This value can be set with the = operator, equivalent to performing
aabb.max.set(value)
.