aabbΒΆ

class aabb

An axis aligned bounding box (aabb) class

Members

Constructors:

aabb result create ( ) Create an empty aabb
aabb result create ( aabb other ) Duplicate an aabb
aabb result create ( float xmin , float xmax , float ymin , float ymax , float zmin , float zmax ) Create an aabb with initial bounds

Methods:

nil clear ( ) Empty the aabb
nil extend ( aabb|point3 extension ) Extend the aabb
nil extendsize ( point3 p ) Extend the size of the aabb
nil extendsize ( float x ) Extend the size of the aabb
nil extendsize ( float x , float y , float z ) Extend the size of the aabb
point3 result getcenter ( ) Returns the center of the aabb
aabb result getextended ( aabb|point3 extension ) Returns an extended aabb
nil getextendedsize ( float x , float y , float z ) Returns an aabb with an extended size
nil getextendedsize ( float x ) Returns an aabb with an extended size
aabb result getextendedsize ( point3 p ) Returns an aabb with an extended size
point3 result getmax ( ) Return the max values on axis i, j, k
point3 result getmin ( ) Return the min values on axis i, j, k
float result getradius ( ) Returns the radius of the bounding sphere of the aabb
point3 result getsize ( ) Return the size of the aabb on i, j, k
aabb result gettransformed ( matrix matrix ) Transform the aabb using a matrix
bool result isempty ( ) Return true if the aabb is empty
nil transform ( matrix matrix ) Transform the aabb using a matrix

Documentation

nil clear ( )

Empty the aabb


nil extend ( aabb|point3 extension )

Extend the aabb

The aabb will be extended in order to contain the old aabb and the extension.
Arguments:

  • extension The aabb or the point that the aabb should contain after the extension.


nil extendsize ( point3 p )

Extend the size of the aabb

The aabb will be extended in the directions i, j, k, -i ,-j ,-k by respectively p.X, p.Y, p.Z, -p.X, -p.Y, -p.Z.
Arguments:

  • p extension on i, j and k


nil extendsize ( float x )

Extend the size of the aabb

The aabb will be extended in the directions i, j, k, -i ,-j ,-k by respectively x, x, x, -x, -x, -x.
Arguments:

  • x extension on i, j and k


nil extendsize ( float x , float y , float z )

Extend the size of the aabb

The aabb will be extended in the directions i, j, k, -i ,-j ,-k by respectively x, y, z, -x, -y, -z.
Arguments:

  • x extension on i
  • y extension on j
  • z extension on k


point3 result getcenter ( )

Returns the center of the aabb

Return:

  • result


aabb result getextended ( aabb|point3 extension )

Returns an extended aabb

The aabb will be extended in order to contain the old aabb and the extension. The extension can be a point3 or a aabb.
Arguments:

  • extension The aabb or the point that the aabb should contain after the extension.

Return:

  • result


nil getextendedsize ( float x , float y , float z )

Returns an aabb with an extended size

The aabb will be extended in the directions i, j, k, -i ,-j ,-k by respectively x, y, z, -x, -y, -z.
Arguments:

  • x extension on i
  • y extension on j
  • z extension on k


nil getextendedsize ( float x )

Returns an aabb with an extended size

The aabb will be extended in the directions i, j, k, -i ,-j ,-k by respectively x, x, x, -x, -x, -x.
Arguments:

  • x extension on i, j and k


aabb result getextendedsize ( point3 p )

Returns an aabb with an extended size

The aabb will be extended in the directions i, j, k, -i ,-j ,-k by respectively p.X, p.Y, p.Z, -p.X, -p.Y, -p.Z.
Arguments:

  • p extension on i, j and k

Return:

  • result


point3 result getmax ( )

Return the max values on axis i, j, k

Return:

  • result


point3 result getmin ( )

Return the min values on axis i, j, k

Return:

  • result


float result getradius ( )

Returns the radius of the bounding sphere of the aabb

The center of the sphere is returned by getcenter ().
Return:

  • result


point3 result getsize ( )

Return the size of the aabb on i, j, k

Return:

  • result


aabb result gettransformed ( matrix matrix )

Transform the aabb using a matrix

Arguments:

  • matrix

Return:

  • result


bool result isempty ( )

Return true if the aabb is empty

Return:

  • result


nil transform ( matrix matrix )

Transform the aabb using a matrix

Arguments:

  • matrix