Unigine::WorldBoundBox Class
Header: | #include <UnigineBounds.h> |
This class serves to construct the bounding box in double precision coordinates.
Bounding boxes has better precision quality but it takes more time for calculation in comparison with bounding spheres.
By using this class you can easily find the common bounding box for several objects by expanding the bounding box.
WorldBoundBox Class
Members
WorldBoundBox()
Default constructor. Creates an empty bounding box.WorldBoundBox(const dvec3 & min, const dvec3 & max)
Constructor. Initializes new bounding box by minimum and maximum coordinates of the bounding box.Arguments
- const dvec3 & min - The bounding box minimum coordinates.
- const dvec3 & max - The bounding box maximum coordinates.
WorldBoundBox(const WorldBoundBox & bb)
Constructor. Initializes new bounding box by using given bounding box.Arguments
- const WorldBoundBox & bb - Bounding box.
WorldBoundBox(const WorldBoundSphere & bs)
Constructor. Initializes new bounding box by the using given bounding sphere.Arguments
- const WorldBoundSphere & bs - Bounding sphere.
void set(const dvec3 & min, const dvec3 & max)
Sets the bounding box by its minimum and maximum coordinates.Arguments
- const dvec3 & min - The bounding box minimum coordinates.
- const dvec3 & max - The bounding box maximum coordinates.
void set(const WorldBoundSphere & bs)
Sets the bounding box by the bounding sphere.Arguments
- const WorldBoundSphere & bs - The bounding sphere.
void set(const WorldBoundBox & bb)
Sets the bounding box.Arguments
- const WorldBoundBox & bb - The bounding box.
const dvec3 & getMax()
Gets the maximum coordinates of the bounding boxReturn value
The bounding box maximum coordinates.const dvec3 & getMin()
Gets the minimum coordinates of the bounding box.Return value
The bounding box minimum coordinates.int isValid()
Checks if the bounding box coordinates are valid (minimum coordinate along the X axis is less or equal to the maximum coordinate along the X axis).Return value
1 if the bounding box minimum and maximum coordinates are valid, otherwise, 0.void clear()
Clears the bounding box.void expand(const WorldBoundSphere & bs)
Expands the current bounding box for including given bounding sphere.Arguments
- const WorldBoundSphere & bs - The bounding sphere.
void expand(const WorldBoundBox & bb)
Expands the current bounding box for including given bounding box.Arguments
- const WorldBoundBox & bb - The bounding box.
void expand(const dvec3 & point)
Expands the current bounding box for including given point.Arguments
- const dvec3 & point
int inside(const WorldBoundBox & bb)
Checks if the bounding box is inside the bounding box.Arguments
- const WorldBoundBox & bb - The bounding box.
Return value
1 if the bounding box is inside the bounding box; otherwise, 0.int inside(const dvec3 & min, const dvec3 & max)
Checks if the box is inside the bounding box.Arguments
- const dvec3 & min - The box minimum coordinates.
- const dvec3 & max - The box maximum coordinates.
Return value
1 if the box is inside the bounding box; otherwise, 0.int inside(const WorldBoundSphere & bs)
Checks if the bounding sphere is inside the bounding box.Arguments
- const WorldBoundSphere & bs - The bounding sphere.
Return value
1 if the bounding sphere is inside the bounding box; otherwise, 0.int inside(const dvec3 & point, double radius)
Checks if the sphere is inside the bounding box.Arguments
- const dvec3 & point - The coordinates of the center of the sphere.
- double radius - The sphere radius.
Return value
1 if the sphere is inside the bounding box; otherwise, 0.int insideAll(const WorldBoundBox & bb)
Checks if the whole given bounding box is inside the current bounding box.Arguments
- const WorldBoundBox & bb - The bounding box.
Return value
1 if the whole box is inside the bounding box; otherwise, 0.int insideAll(const WorldBoundSphere & bs)
Checks if the whole given bounding sphere is inside the current bounding box.Arguments
- const WorldBoundSphere & bs - The bounding sphere.
Return value
1 if the whole sphere is inside the bounding box; otherwise, 0.~WorldBoundBox()
Destructor.Last update: 2018-04-26
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)