| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tlp::BoundingBox Struct Reference This class represents the 3D bounding box of an object. It is mostly used to determine whether or not two object are in a state of collision. More...
Inheritance diagram for tlp::BoundingBox:
Collaboration diagram for tlp::BoundingBox:
Public Member Functions
Detailed DescriptionThis class represents the 3D bounding box of an object. It is mostly used to determine whether or not two object are in a state of collision. It is defined by two 3d points, the first one (A) being the lowest point, the second (B) being the highest. As a bounding box is a mathematical entity describing the lowest and highest points, whether these points are in the top-left corner or lower-right corner depends on the axes we use. Below is a crude ASCII-art description of the axes we use in our 3D world and the points where the min and max are thus positioned. Through the rest of this class's documentation, it will be assumed that this is the convention. y | | |_____ x / / z _________ B / /| / / | /________/ | | | | | | | | | / |________|/ A Author : Tulip team Constructor & Destructor Documentation
Creates an invalid boundig box. The minimum is (1, 1, 1) and the maximum is (-1, -1, -1).
Creates a bounding box that must be valid. Validity is checked in debug mode by an assert.
Member Function Documentation
Returns the geometrical center of the bounding box. An assertion is raised in debug mode if the BoundingBox is not valid.
Checks if the given vector is inside the current bounding box. If the bounding box is invalid the result is always false.
Returns the depth of the bounding box An assertion is raised in debug mode if the bounding box is not valid.
Expands the bounding box to one containing the vector passed as parameter. If the parameter is inside the bounding box, it remains unchanged.
The vector passed as parameter is modified to contain the 8 points of the bounding box. The points are, in order : 0: lower leftmost closest point (the bounding box's minimum) 1: lower rightmost closest point 2: highest rightmost closest point 3: highest leftmost closest point 4: lower rightmost farthest point 5: lower rightmost farthest point 6: highest rightmost farthest point 7: highest leftmost farthest point. Crude ASCII art again, sorry for your eyes. 6_________ 7 /| /| / | / | 3/__|_____/2 | | |_____|__| | /4 | /5 | / | / |/_______|/ 0 1
Returns the height of the bounding box An assertion is raised in debug mode if the bounding box is not valid.
Checks if the given bounding box intersect the current one. If one of the bounding box is invalid return false.
Checks if the bounding box intersects a given line segment. If the bounding box is invalid the result is always false.
Checks whether the bounding box's lowest point is less than it's highest point. "Less Than" means axis-by-axis comparison, i.e. x1 < x2 && y1 < y2 && z1 < z2.
Translates the bounding box by the displacement given by the vector passed as parameter.
Returns the width of the bounding box An assertion is raised in debug mode if the BoundingBox is not valid. |
Tulip Software by LaBRI Visualization Team 2001 - 2012 |