AABB2D
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructs an axis aligned bounding box
- applyTransform() : void
- Applies the given transform to the AABB
- contains() : bool
- Returns true if the given point is inside the AABB
- containsAABB() : bool
- Returns true if the given AABB is inside the current AABB
- copy() : AABB2D
- Returns a copy of the current AABB
- extend() : void
- Extends the current AABB to include the given AABB
- getCenter() : Vec2
- Returns the center of the AABB
- height() : float
- Returns the height of the AABB
- intersects() : bool
- Returns true if the given AABB intersects with the current AABB
- union() : AABB2D
- Creates a union AABB from the given AABBs
- width() : float
- Returns the width of the AABB
Properties
$max
public
Vec2
$max
$min
public
Vec2
$min
Methods
__construct()
Constructs an axis aligned bounding box
public
__construct(Vec2 $min, Vec2 $max) : mixed
Parameters
- $min : Vec2
- $max : Vec2
applyTransform()
Applies the given transform to the AABB
public
applyTransform(Transform $transform) : void
Parameters
- $transform : Transform
contains()
Returns true if the given point is inside the AABB
public
contains(Vec2 $point) : bool
Parameters
- $point : Vec2
Return values
boolcontainsAABB()
Returns true if the given AABB is inside the current AABB
public
containsAABB(AABB2D $aabb) : bool
Parameters
- $aabb : AABB2D
Return values
boolcopy()
Returns a copy of the current AABB
public
copy() : AABB2D
Return values
AABB2Dextend()
Extends the current AABB to include the given AABB
public
extend(AABB2D $aabb) : void
Parameters
- $aabb : AABB2D
getCenter()
Returns the center of the AABB
public
getCenter() : Vec2
Return values
Vec2height()
Returns the height of the AABB
public
height() : float
Return values
floatintersects()
Returns true if the given AABB intersects with the current AABB
public
intersects(AABB2D $aabb) : bool
Parameters
- $aabb : AABB2D
Return values
boolunion()
Creates a union AABB from the given AABBs
public
static union(AABB2D ...$aabbs) : AABB2D
Parameters
- $aabbs : AABB2D
Return values
AABB2Dwidth()
Returns the width of the AABB
public
width() : float