PixelLightAPI
.
|
Axis align bounding box class. More...
#include <AABoundingBox.h>
Public Types | |
enum | Axis { X = 0, Y = 1, Z = 2 } |
Axis. More... | |
Public Member Functions | |
AABoundingBox () | |
Default constructor setting all minimum and maximum components to 0. | |
AABoundingBox (const AABoundingBox &cSource) | |
Copy constructor. | |
AABoundingBox (const Vector3 &vMinMax) | |
Constructor. | |
AABoundingBox (const Vector3 &vMin, const Vector3 &vMax) | |
Constructor. | |
AABoundingBox (float fMinX, float fMinY, float fMinZ, float fMaxX, float fMaxY, float fMaxZ) | |
Constructor. | |
~AABoundingBox () | |
Destructor. | |
PLMATH_API AABoundingBox & | operator= (const AABoundingBox &cSource) |
Copy operator. | |
Vector3 | GetCenter () const |
Returns the center of the box. | |
float | GetWidth () const |
Returns the width. | |
float | GetHeight () const |
Returns the height. | |
float | GetDepth () const |
Returns the depth. | |
Axis | GetLongestAxis () const |
Returns the longest axis. | |
float | GetLongestAxisLength () const |
Returns the length of the longest axis. | |
float | GetEnclosingRadius () const |
Returns the radius of a sphere placed at the origin (0, 0, 0) enclosing this axis align bounding box. | |
float | GetInsideRadius () const |
Returns the radius of a sphere placed at the origin (0, 0, 0) inside this axis align bounding box. | |
float | CalculateSurface () const |
Calculates the surface of the box. | |
float | CalculateVolume () const |
Calculates the volume of the box. | |
void | ClipByAABox (const AABoundingBox &cEnclosed) |
Clips this box with another one. | |
void | AppendToCubicHull (const Vector3 &vV) |
Appends a vertex to the cubic hull. | |
void | CombineAABoxes (const AABoundingBox &cBox) |
Combines two axis align boxes. | |
PLMATH_API void | GetVertices (Vector3 vVertex[8]) const |
Returns the 8 corner vertices. | |
PLMATH_API Vector3 | GetVertex (PLCore::uint32 nIndex) const |
Returns one of the 8 corner vertices. | |
PLMATH_API PLCore::uint32 | GetNearestVertexIndex (const Vector3 &vClipPlaneNormal) const |
Calculates the index of the nearest vertex in the AAB according to the normal vector of a clip plane. | |
PLMATH_API PLCore::uint32 | GetFurthestVertexIndex (const Vector3 &vClipPlaneNormal) const |
Calculates the index of the furthest vertex in the AAB according to the normal vector of a clip plane. | |
PLMATH_API void | ValidateMinMax () |
Ensures that the minimum is really the minimum and the maximum is really the maximum. | |
AABoundingBox | operator+ (const Vector3 &vV) const |
Per component addition. | |
AABoundingBox | operator+ (float fS) const |
Per component addition. | |
AABoundingBox & | operator+= (const Vector3 &vV) |
Per component addition. | |
AABoundingBox & | operator+= (float fS) |
Per component addition. | |
AABoundingBox | operator- (const Vector3 &vV) const |
Per component subtraction. | |
AABoundingBox | operator- (float fS) const |
Per component subtraction. | |
AABoundingBox & | operator-= (const Vector3 &vV) |
Per component subtraction. | |
AABoundingBox & | operator-= (float fS) |
Per component subtraction. | |
AABoundingBox | operator* (const Vector3 &vV) const |
Per component multiplication. | |
AABoundingBox | operator* (float fS) const |
Per component multiplication. | |
AABoundingBox & | operator*= (const Vector3 &vV) |
Per component multiplication. | |
AABoundingBox & | operator*= (float fS) |
Per component multiplication. | |
AABoundingBox | operator/ (const Vector3 &vV) const |
Per component division. | |
AABoundingBox | operator/ (float fS) const |
Per component division. | |
AABoundingBox & | operator/= (const Vector3 &vV) |
Per component division. | |
AABoundingBox & | operator/= (float fS) |
Per component division. | |
Public Attributes | |
Vector3 | vMin |
Vector3 | vMax |
Axis align bounding box class.
3+------+2 y /| /| | / | / | | / 0+---/--+1 *---x 7+------+6 / / | / | / z |/ |/ 4+------+5
PLMath::AABoundingBox::AABoundingBox | ( | ) | [inline] |
Default constructor setting all minimum and maximum components to 0.
PLMath::AABoundingBox::AABoundingBox | ( | const AABoundingBox & | cSource | ) | [inline] |
Copy constructor.
[in] | cSource | Source to copy from |
PLMath::AABoundingBox::AABoundingBox | ( | const Vector3 & | vMinMax | ) | [inline] |
Constructor.
[in] | vMinMax | Minimum and maximum position |
PLMath::AABoundingBox::AABoundingBox | ( | const Vector3 & | vMin, |
const Vector3 & | vMax | ||
) | [inline] |
Constructor.
[in] | vMin | Minimum position |
[in] | vMax | Maximum position |
PLMath::AABoundingBox::AABoundingBox | ( | float | fMinX, |
float | fMinY, | ||
float | fMinZ, | ||
float | fMaxX, | ||
float | fMaxY, | ||
float | fMaxZ | ||
) | [inline] |
Constructor.
[in] | fMinX | X component of the minimum position |
[in] | fMinY | Y component of the minimum position |
[in] | fMinZ | Z component of the minimum position |
[in] | fMaxX | X component of the maximum position |
[in] | fMaxY | Y component of the maximum position |
[in] | fMaxZ | Z component of the maximum position |
PLMath::AABoundingBox::~AABoundingBox | ( | ) | [inline] |
Destructor.
PLMATH_API AABoundingBox& PLMath::AABoundingBox::operator= | ( | const AABoundingBox & | cSource | ) |
Copy operator.
[in] | cSource | Source to copy from |
Vector3 PLMath::AABoundingBox::GetCenter | ( | ) | const [inline] |
Returns the center of the box.
float PLMath::AABoundingBox::GetWidth | ( | ) | const [inline] |
Returns the width.
float PLMath::AABoundingBox::GetHeight | ( | ) | const [inline] |
Returns the height.
float PLMath::AABoundingBox::GetDepth | ( | ) | const [inline] |
Returns the depth.
AABoundingBox::Axis PLMath::AABoundingBox::GetLongestAxis | ( | ) | const [inline] |
Returns the longest axis.
float PLMath::AABoundingBox::GetLongestAxisLength | ( | ) | const [inline] |
Returns the length of the longest axis.
float PLMath::AABoundingBox::GetEnclosingRadius | ( | ) | const [inline] |
Returns the radius of a sphere placed at the origin (0, 0, 0) enclosing this axis align bounding box.
float PLMath::AABoundingBox::GetInsideRadius | ( | ) | const [inline] |
Returns the radius of a sphere placed at the origin (0, 0, 0) inside this axis align bounding box.
float PLMath::AABoundingBox::CalculateSurface | ( | ) | const [inline] |
Calculates the surface of the box.
float PLMath::AABoundingBox::CalculateVolume | ( | ) | const [inline] |
Calculates the volume of the box.
void PLMath::AABoundingBox::ClipByAABox | ( | const AABoundingBox & | cEnclosed | ) | [inline] |
Clips this box with another one.
[in] | cEnclosed | Axis align box to clip this box with |
void PLMath::AABoundingBox::AppendToCubicHull | ( | const Vector3 & | vV | ) | [inline] |
Appends a vertex to the cubic hull.
[in] | vV | Vertex to append |
void PLMath::AABoundingBox::CombineAABoxes | ( | const AABoundingBox & | cBox | ) | [inline] |
Combines two axis align boxes.
[in] | cBox | Axis align box to combine with this box |
PLMATH_API void PLMath::AABoundingBox::GetVertices | ( | Vector3 | vVertex[8] | ) | const |
Returns the 8 corner vertices.
[out] | vVertex | This array will receive the 8 corner vertices |
PLMATH_API Vector3 PLMath::AABoundingBox::GetVertex | ( | PLCore::uint32 | nIndex | ) | const |
Returns one of the 8 corner vertices.
[in] | nIndex | Index of the corner vertex to return |
PLMATH_API PLCore::uint32 PLMath::AABoundingBox::GetNearestVertexIndex | ( | const Vector3 & | vClipPlaneNormal | ) | const |
Calculates the index of the nearest vertex in the AAB according to the normal vector of a clip plane.
[in] | vClipPlaneNormal | Clip plane normal |
PLMATH_API PLCore::uint32 PLMath::AABoundingBox::GetFurthestVertexIndex | ( | const Vector3 & | vClipPlaneNormal | ) | const |
Calculates the index of the furthest vertex in the AAB according to the normal vector of a clip plane.
[in] | vClipPlaneNormal | Clip plane normal |
PLMATH_API void PLMath::AABoundingBox::ValidateMinMax | ( | ) |
Ensures that the minimum is really the minimum and the maximum is really the maximum.
AABoundingBox PLMath::AABoundingBox::operator+ | ( | const Vector3 & | vV | ) | const [inline] |
Per component addition.
[in] | vV | Vector to add |
AABoundingBox PLMath::AABoundingBox::operator+ | ( | float | fS | ) | const [inline] |
Per component addition.
[in] | fS | Scalar to add |
AABoundingBox & PLMath::AABoundingBox::operator+= | ( | const Vector3 & | vV | ) | [inline] |
Per component addition.
[in] | vV | Vector to add |
AABoundingBox & PLMath::AABoundingBox::operator+= | ( | float | fS | ) | [inline] |
Per component addition.
[in] | fS | Scalar to add |
AABoundingBox PLMath::AABoundingBox::operator- | ( | const Vector3 & | vV | ) | const [inline] |
Per component subtraction.
[in] | vV | Vector to subtract |
AABoundingBox PLMath::AABoundingBox::operator- | ( | float | fS | ) | const [inline] |
Per component subtraction.
[in] | fS | Scalar to subtract |
AABoundingBox & PLMath::AABoundingBox::operator-= | ( | const Vector3 & | vV | ) | [inline] |
Per component subtraction.
[in] | vV | Vector to subtract |
AABoundingBox & PLMath::AABoundingBox::operator-= | ( | float | fS | ) | [inline] |
Per component subtraction.
[in] | fS | Scalar to subtract |
AABoundingBox PLMath::AABoundingBox::operator* | ( | const Vector3 & | vV | ) | const [inline] |
Per component multiplication.
[in] | vV | Vector to multiplicate with |
AABoundingBox PLMath::AABoundingBox::operator* | ( | float | fS | ) | const [inline] |
Per component multiplication.
[in] | fS | Scalar to multiplicate with |
AABoundingBox & PLMath::AABoundingBox::operator*= | ( | const Vector3 & | vV | ) | [inline] |
Per component multiplication.
[in] | vV | Vector to multiplicate with |
AABoundingBox & PLMath::AABoundingBox::operator*= | ( | float | fS | ) | [inline] |
Per component multiplication.
[in] | fS | Scalar to multiplicate with |
AABoundingBox PLMath::AABoundingBox::operator/ | ( | const Vector3 & | vV | ) | const [inline] |
Per component division.
[in] | vV | Vector to divide through |
AABoundingBox PLMath::AABoundingBox::operator/ | ( | float | fS | ) | const [inline] |
Per component division.
[in] | fS | Scalar to divide through |
AABoundingBox & PLMath::AABoundingBox::operator/= | ( | const Vector3 & | vV | ) | [inline] |
Per component division.
[in] | vV | Vector to divide through |
AABoundingBox & PLMath::AABoundingBox::operator/= | ( | float | fS | ) | [inline] |
Per component division.
[in] | fS | Scalar to divide through |
Minimum position
Maximum position
|