VISU - PHP Game Framework

AABB
in package

Table of Contents

Properties

$max  : Vec3
$min  : Vec3

Methods

__construct()  : mixed
Constructs an axis aligned bounding box
contains()  : bool
Returns true if the given point is inside the current AABB
copy()  : AABB
Returns a copy of the current AABB
depth()  : float
Returns the depth of the AABB
extend()  : void
Extends the current AABB to include the given AABB
getCenter()  : Vec3
Returns the center of the AABB
getCorners()  : array<string|int, Vec3>
Returns an array of 8 Vec3 representing the corners of the AABB
getTranslationToAvoidIntersection()  : Vec3
Returns a Vec3 representing a translation that could be applied to the current AABB to make it not intersect with the given AABB
height()  : float
Returns the height of the AABB
intersectRay()  : Vec3|null
Returns the intersection point of the current AABB and the given Ray
intersectRayDistance()  : float|null
Retuns the intersection distance of this AABB and Ray
intersects()  : bool
Returns true if the given AABB intersects with the current AABB
width()  : float
Returns the width of the AABB

Properties

Methods

__construct()

Constructs an axis aligned bounding box

public __construct(Vec3 $min, Vec3 $max) : mixed
Parameters
$min : Vec3
$max : Vec3

contains()

Returns true if the given point is inside the current AABB

public contains(Vec3 $point) : bool
Parameters
$point : Vec3
Return values
bool

copy()

Returns a copy of the current AABB

public copy() : AABB
Return values
AABB

depth()

Returns the depth of the AABB

public depth() : float
Return values
float

extend()

Extends the current AABB to include the given AABB

public extend(AABB $aabb) : void
Parameters
$aabb : AABB

getCenter()

Returns the center of the AABB

public getCenter() : Vec3
Return values
Vec3

getCorners()

Returns an array of 8 Vec3 representing the corners of the AABB

public getCorners() : array<string|int, Vec3>
Return values
array<string|int, Vec3>

getTranslationToAvoidIntersection()

Returns a Vec3 representing a translation that could be applied to the current AABB to make it not intersect with the given AABB

public getTranslationToAvoidIntersection(AABB $aabb) : Vec3
Parameters
$aabb : AABB
Return values
Vec3

height()

Returns the height of the AABB

public height() : float
Return values
float

intersectRay()

Returns the intersection point of the current AABB and the given Ray

public intersectRay(Ray $ray) : Vec3|null
Parameters
$ray : Ray
Return values
Vec3|null

intersectRayDistance()

Retuns the intersection distance of this AABB and Ray

public intersectRayDistance(Ray $ray) : float|null
Parameters
$ray : Ray
Return values
float|null

intersects()

Returns true if the given AABB intersects with the current AABB

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

width()

Returns the width of the AABB

public width() : float
Return values
float

        
On this page

Search results