Defines an AABB (Axis Aligned Bounding Box). More...
Public Member Functions | |
| ozinline | Box () |
| Constructs an uninitalized box. | |
| ozinline | Box (const Vec3f &_center, const Vec3f &_extent) |
| Constructs an initalized box. | |
| ~Box () | |
| Destructs this box instance. | |
| ozinline void | setFromPoints (const Vec3f &_pt0, const Vec3f &_pt1) |
| Build an AABB from two points. | |
| ozinline Vec3f | getMin () const |
| Gets the minimum corner of this box. | |
| ozinline Vec3f | getMax () const |
| Gets the maximum corner of this box. | |
| ozinline void | getMinMax (Vec3f &_min, Vec3f &_max) const |
| Gets the minimal and maximal point of this box. | |
| ozinline bool | isOverlap (const Box &_box) const |
| Tests if that box overlaps with one another. | |
| ozinline bool | isOverlapOnX (const Box &_box) const |
| Same than is isOverlap() method but only occurs on X axis. | |
| ozinline bool | isOverlapOnY (const Box &_box) const |
| Same than is isOverlap() method but only occurs on Y axis. | |
| ozinline bool | isOverlapOnZ (const Box &_box) const |
| Same than is isOverlap() method but only occurs on Z axis. | |
| ozinline bool | isInside (const Box &_box) const |
| Tests if one box is fully inside one another. | |
| ozinline bool | isInside (const Vec3f &_pt) const |
| Tests if point is inside this box. | |
| ozinline float | getMinExtent () const |
| Gets the smallest extension of that box. | |
| ozinline float | getMaxExtent () const |
| Gets the highest extension of that box. | |
| ozinline float | ext (int i) const |
| Returns the extension of the box on X, Y or Z axis. | |
| ozinline Vec3f | getPoint (int _index) const |
| Returns a point of the cube. | |
| ozinline Plane | getPlane (PLANE _which) const |
| Gets the plane of one face of the cube. | |
| ozinline BoxEdge | getEdge (int _index) const |
| Returns an edge of the cube given its index. | |
Static Public Member Functions | |
| static ozinline Vec3f | getVertexNormal (int _index) |
| Gets the normal of the cube given its point index. | |
| static ozinline Vec3f | getFaceNormal (PLANE _which) |
| Returns a face normal of the cube. | |
Public Attributes | |
| Vec3f | center |
| The center of the box. | |
| Vec3f | extent |
| The extent of the box. | |
Defines an AABB (Axis Aligned Bounding Box).
An AABB is an Axis Aligned Bounding Box, in the opposite of an OBB that is oriented (Oriented Bounding Box). Typicaly you just have one size for each axis.
| ozinline Box::Box | ( | ) | [inline] |
Constructs an uninitalized box.
Constructs an initalized box.
| _center | The center of the box. | |
| _extent | The extent of the box for each axis. |
| Box::~Box | ( | ) | [inline] |
Destructs this box instance.
| ozinline float Box::ext | ( | int | i | ) | const [inline] |
Returns the extension of the box on X, Y or Z axis.
| i | The index of the axis. 0 for X, 1 for Y, 2 for Z. If index are not in the valid range [0, 2], Z extension is returned by default. |
| ozinline BoxEdge Box::getEdge | ( | int | _index | ) | const [inline] |
Returns a face normal of the cube.
A box is made of 6 faces. This method allows you to get the normal of each of these faces.
| _which | The index of the vertex to get the normal from (from 0 to 5). If the index is not in the valid range, 0 is returned. |
| ozinline Vec3f Box::getMax | ( | ) | const [inline] |
Gets the maximum corner of this box.
| ozinline float Box::getMaxExtent | ( | ) | const [inline] |
Gets the highest extension of that box.
It means the axis that has the highest amplitude on X, Y, or Z.
| ozinline Vec3f Box::getMin | ( | ) | const [inline] |
Gets the minimum corner of this box.
| ozinline float Box::getMinExtent | ( | ) | const [inline] |
Gets the smallest extension of that box.
It means the axis that has the smallest amplitude on X, Y, or Z.
Gets the minimal and maximal point of this box.
| _min | Will contain th minimal point of this box. | |
| _max | Will contain th maximal point of this box. |
Gets the plane of one face of the cube.
A box is made of 6 faces. This method allows you to get a Plane instance of each of these faces.
| _which | The index of the face to get the plane from (from 0 to 5). If the index is not in the valid range, a 0 plane is returned. |
| ozinline Vec3f Box::getPoint | ( | int | _index | ) | const [inline] |
Returns a point of the cube.
A cube is made of 8 points. This method allow you to return the required point.
| _index | The index of the point from 0 to 7. If _index is not in the valid range, 0 is returned. |
| static ozinline Vec3f Box::getVertexNormal | ( | int | _index | ) | [inline, static] |
Gets the normal of the cube given its point index.
A box is made of 8 points. This method allows you to get the normal of each of these points.
| _index | The index of the vertex to get the normal from (from 0 to 7). If the index is not in the valid range, 0 vector is returned. |
| ozinline bool Box::isInside | ( | const Box & | _box | ) | const [inline] |
Tests if one box is fully inside one another.
| _box | The box to test with. |
| ozinline bool Box::isInside | ( | const Vec3f & | _pt | ) | const [inline] |
Tests if point is inside this box.
| _pt | The point to test. |
| ozinline bool Box::isOverlap | ( | const Box & | _box | ) | const [inline] |
Tests if that box overlaps with one another.
| _box | The other box to test with. |
| ozinline bool Box::isOverlapOnX | ( | const Box & | _box | ) | const [inline] |
Same than is isOverlap() method but only occurs on X axis.
| _box | The other box to test with. |
| ozinline bool Box::isOverlapOnY | ( | const Box & | _box | ) | const [inline] |
Same than is isOverlap() method but only occurs on Y axis.
| _box | The other box to test with. |
| ozinline bool Box::isOverlapOnZ | ( | const Box & | _box | ) | const [inline] |
Same than is isOverlap() method but only occurs on Z axis.
| _box | The other box to test with. |
Build an AABB from two points.
| _pt0 | The first point. | |
| _pt1 | The second point. |
The center of the box.
The extent of the box.
1.7.1