BoundBox Class
This class serves to construct the bounding box in single precision coordinates.
Instances of this class are deleted automatically when it is necessary.
In case of double precision coordinates, the bounding box should be constructed by using the WorldBoundBox class. It includes the same functions as the BoundBox class, but its functions deal with the double precision coordinates.
To support both single and double precision builds, you can use the WorldBoundBox class only. The engine will automatically substitute it with the BoundBox if it is required.
BoundBox Class
Members
BoundBox ( ) #
Constructor. Creates an empty bounding box.BoundBox ( Variable v ) #
Constructor. Creates a bounding box initialized by one of the following:- BoundBox - the bounding box.
- BoundSphere - the bounding sphere.
Arguments
- Variable v - Variable of one of the following types:
- BoundBox bb - The bounding box.
- BoundSphere bs - The bounding sphere.
BoundBox ( Variable v1, Variable v2 ) #
Constructor. Creates a bounding box initialized by one of the following:- vec3 and vec3 - minimum and maximum coordinates of the bounding box respectively.
- BoundBox and mat4 - the bounding box and its transformation matrix.
Arguments
- Variable v1 - Argument of one of the following types:
- vec3 min - Bounding box minimum coordinates.
- BoundBox bb - The bounding box.
- Variable v2 - Argument of one of the following types:
- vec3 max - Bounding box maximum coordinates.
- mat4 transform - Transformation matrix.
const vec3 & getMax ( ) # const
Returns the maximum coordinates of the bounding box.Return value
Bounding box maximum coordinates.const vec3 & getMin ( ) # const
Returns the minimum coordinates of the bounding box.Return value
Bounding box minimum coordinates.int isValid ( ) # const
Checks the bounding box status.Return value
1 if the bounding box minimum and maximum coordinates are valid; otherwise, 0.void clear ( ) #
Clears the bounding box.void expand ( Variable v ) #
Expands the current bounding box for including given bounding object (box, sphere, frustum).Arguments
- Variable v - Variable of one of the following types:
- BoundBox bb - The bounding box.
- BoundSphere bs - The bounding sphere.
Last update:
2019-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)