aabb

From Teverse

Axis Aligned Bounding Box

Constructors

aabb

aabb aabb(vector3 min, vector3 max) Creates a bounding box with the minimum and maximum vectors provided.

Properties

min

Type: vector3

max

Type: vector3

Methods

getCentre

vector3 aabb:getCentre()
Returns the centre of the bounding box

expand

aabb aabb:expand(vector3 vector)
Expands the current vector to include the vector provided.
Example:
local bounds = aabb()
bounds:expand(vector3(1,1,1))
-- min is now 0,0,0
-- max is now 1,1,1