VISU - PHP Game Framework

AABB2D
in package

Table of Contents

Properties

$max  : Vec2
$min  : Vec2

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

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
bool

containsAABB()

Returns true if the given AABB is inside the current AABB

public containsAABB(AABB2D $aabb) : bool
Parameters
$aabb : AABB2D
Return values
bool

extend()

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
Vec2

height()

Returns the height of the AABB

public height() : float
Return values
float

intersects()

Returns true if the given AABB intersects with the current AABB

public intersects(AABB2D $aabb) : bool
Parameters
$aabb : AABB2D
Return values
bool

width()

Returns the width of the AABB

public width() : float
Return values
float

        
On this page

Search results