A dynamic bounding box class. More...
#include <BoundingBox.hpp>
Public Member Functions | |
BoundingBox () | |
Default constructor. | |
BoundingBox (VertexT v1, VertexT v2) | |
Constructs a bounding box with from the given vertices. | |
BoundingBox (float x_min, float y_min, float z_min, float x_max, float y_max, float z_max) | |
Constructs a bounding box from the given coordinates. | |
virtual | ~BoundingBox () |
void | expand (VertexT v) |
Expands the bounding box if the given point v} is outside the current volume. | |
void | expand (float x, float y, float z) |
Expands the bounding box if the given point is outside the current volume. | |
void | expand (BoundingBox< VertexT > &bb) |
Calculates the surrounding bounding box of the current volume and the other given bounding box. | |
float | getRadius () |
Returns the radius of the current volume, i.e. the distance between the centroid and the most distance corner from this point. | |
bool | isValid () |
Returns true if the bounding box has been expanded before or was initialized with a preset size. | |
VertexT | getCentroid () |
Returns the center point of the bounding box. | |
float | getLongestSide () |
Returns the longest side of the bounding box. | |
float | getXSize () |
Returns the x-size of the bounding box. | |
float | getYSize () |
Returns the y-size of the bounding box. | |
float | getZSize () |
Returns the z-size of the bounding box. | |
VertexT | getMax () const |
Returns the upper right coordinates. | |
VertexT | getMin () const |
Returns the lower left coordinates. | |
Private Attributes | |
VertexT | m_min |
The lower right point of the bounding box. | |
VertexT | m_max |
The upper right point of the bounding box. | |
VertexT | m_centroid |
The center point of the bounding box. | |
float | m_xSize |
The 'width' of the bounding box. | |
float | m_ySize |
The 'height' of the bounding box. | |
float | m_zSize |
The 'depth' of the bounding box. |
A dynamic bounding box class.
Definition at line 24 of file BoundingBox.hpp.
lssr::BoundingBox< VertexT >::BoundingBox | ( | ) |
Default constructor.
lssr::BoundingBox< VertexT >::BoundingBox | ( | VertexT | v1, | |
VertexT | v2 | |||
) |
Constructs a bounding box with from the given vertices.
v1 | Lower left corner of the BoundingBox | |
v2 | Upper right corner of the BoundingBox |
lssr::BoundingBox< VertexT >::BoundingBox | ( | float | x_min, | |
float | y_min, | |||
float | z_min, | |||
float | x_max, | |||
float | y_max, | |||
float | z_max | |||
) |
Constructs a bounding box from the given coordinates.
x_min | x value of the lower left corner | |
y_min | y value of the lower left corner | |
z_min | z value of the lower left corner | |
x_max | x value of the upper right corner | |
y_max | y value of the upper right corner | |
z_max | z value of the upper right corner |
virtual lssr::BoundingBox< VertexT >::~BoundingBox | ( | ) | [inline, virtual] |
Definition at line 49 of file BoundingBox.hpp.
void lssr::BoundingBox< VertexT >::expand | ( | VertexT | v | ) | [inline] |
Expands the bounding box if the given point v} is outside the current volume.
v | A 3d point |
void lssr::BoundingBox< VertexT >::expand | ( | float | x, | |
float | y, | |||
float | z | |||
) | [inline] |
Expands the bounding box if the given point is outside the current volume.
x | The x coordinate of the check point | |
y | The y coordinate of the check point | |
z | The z coordinate of the check point |
void lssr::BoundingBox< VertexT >::expand | ( | BoundingBox< VertexT > & | bb | ) | [inline] |
Calculates the surrounding bounding box of the current volume and the other given bounding box.
bb | Another bounding box |
VertexT lssr::BoundingBox< VertexT >::getCentroid | ( | ) | [inline] |
Returns the center point of the bounding box.
Definition at line 93 of file BoundingBox.hpp.
float lssr::BoundingBox< VertexT >::getLongestSide | ( | ) |
Returns the longest side of the bounding box.
VertexT lssr::BoundingBox< VertexT >::getMax | ( | ) | const |
Returns the upper right coordinates.
VertexT lssr::BoundingBox< VertexT >::getMin | ( | ) | const |
Returns the lower left coordinates.
float lssr::BoundingBox< VertexT >::getRadius | ( | ) |
Returns the radius of the current volume, i.e. the distance between the centroid and the most distance corner from this point.
float lssr::BoundingBox< VertexT >::getXSize | ( | ) |
Returns the x-size of the bounding box.
float lssr::BoundingBox< VertexT >::getYSize | ( | ) |
Returns the y-size of the bounding box.
float lssr::BoundingBox< VertexT >::getZSize | ( | ) |
Returns the z-size of the bounding box.
bool lssr::BoundingBox< VertexT >::isValid | ( | ) |
Returns true if the bounding box has been expanded before or was initialized with a preset size.
VertexT lssr::BoundingBox< VertexT >::m_centroid [private] |
The center point of the bounding box.
Definition at line 135 of file BoundingBox.hpp.
VertexT lssr::BoundingBox< VertexT >::m_max [private] |
The upper right point of the bounding box.
Definition at line 132 of file BoundingBox.hpp.
VertexT lssr::BoundingBox< VertexT >::m_min [private] |
The lower right point of the bounding box.
Definition at line 129 of file BoundingBox.hpp.
float lssr::BoundingBox< VertexT >::m_xSize [private] |
The 'width' of the bounding box.
Definition at line 138 of file BoundingBox.hpp.
float lssr::BoundingBox< VertexT >::m_ySize [private] |
The 'height' of the bounding box.
Definition at line 141 of file BoundingBox.hpp.
float lssr::BoundingBox< VertexT >::m_zSize [private] |
The 'depth' of the bounding box.
Definition at line 144 of file BoundingBox.hpp.