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 WorldBoundBoxclass. It includes the same functions as theBoundBox 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.
vec3 getMax() const
Gets the maximum coordinates of the bounding boxReturn value
The bounding box maximum coordinates.vec3 getMin() const
Gets the minimum coordinates of the bounding box.Return value
The 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)
Arguments
- Variable v
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)