Bounding boxes are geometrical shapes that verify the following properties:
#include <OSDLBoundingBox.h>
Public Member Functions | |
BoundingBox () | |
Constructor of a bounding box object. | |
virtual | ~BoundingBox () throw () |
Virtual destructor. | |
virtual IntersectionResult | doesIntersectWith (BoundingBox &other)=0 |
Tells what is the nature of the intersection between this bounding box and the specified one. | |
Static Public Member Functions | |
static std::string | InterpretIntersectionResult (IntersectionResult result) |
Returns a textual description of specified intersection result. | |
Private Member Functions | |
BoundingBox (const BoundingBox &source) | |
Copy constructor made private to ensure that it will never be called. | |
BoundingBox & | operator= (const BoundingBox &source) |
Assignment operator made private to ensure that it will never be called. |
Bounding boxes are geometrical shapes that verify the following properties:
) are faster and/or easier than if they were to be performed on the actual associated object.
Bounding boxes are therefore simple shapes helping managing complex objects.
Various bounding boxes can be used, depending on the dimension of the space they are to be used (ex: 2D, 3D) and the precision they are to provide (ex: cubes demand more processing power than spheres, but for some computations they give more accurate results).
A bounding box is linked to at least an object and must have a reference onto it, since boxes are defined relatively to them, as son Locatable depending on his father. Reciproqually, for a given object its bounding box needs to be found. As objects have to know their bounding box(es), it must be a two-way link.
All bounding boxes should be Locatable instancess, but the type of the Locatable depends on the space they are defined in. Therefore abstract bounding boxes should not inherit from any Locatable at this point.
Bounding boxes are notably useful to check collisions between them.
Definition at line 131 of file OSDLBoundingBox.h.
BoundingBox::BoundingBox | ( | ) | [explicit] |
Constructor of a bounding box object.
Definition at line 54 of file OSDLBoundingBox.cc.
BoundingBox::~BoundingBox | ( | ) | throw () [virtual] |
Virtual destructor.
Definition at line 61 of file OSDLBoundingBox.cc.
OSDL::Engine::BoundingBox::BoundingBox | ( | const BoundingBox & | source | ) | [explicit, private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
virtual IntersectionResult OSDL::Engine::BoundingBox::doesIntersectWith | ( | BoundingBox & | other | ) | [pure virtual] |
Tells what is the nature of the intersection between this bounding box and the specified one.
other | the other bounding box. |
BoundingBoxException | if the type of the two bounding boxes is not compatible (ex: 2D boxes cannot be checked against 3D boxes), or not implemented. |
Implemented in OSDL::Engine::CircleBoundingBox.
string BoundingBox::InterpretIntersectionResult | ( | IntersectionResult | result | ) | [static] |
Returns a textual description of specified intersection result.
BoundingBoxException | if the intersection result is not known, and therefore cannot be interpreted. |
Definition at line 68 of file OSDLBoundingBox.cc.
References OSDL::Engine::contains, OSDL::Engine::intersects, OSDL::Engine::isContained, OSDL::Engine::isEqual, and OSDL::Engine::isSeparate.
BoundingBox& OSDL::Engine::BoundingBox::operator= | ( | const BoundingBox & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.