Pyrogenesis
13997
|
#include <BoundingBoxAligned.h>
Public Member Functions | |
CBoundingBoxAligned () | |
CBoundingBoxAligned (const CVector3D &min, const CVector3D &max) | |
void | Transform (const CMatrix3D &m, CBoundingBoxAligned &result) const |
Transforms these bounds according to the specified transformation matrix m , and writes the axis-aligned bounds of that result to result . More... | |
void | Transform (const CMatrix3D &m, CBoundingBoxOriented &result) const |
Transform these bounds using the matrix transform , and write out the result as an oriented (i.e. More... | |
CVector3D & | operator[] (int index) |
const CVector3D & | operator[] (int index) const |
void | SetEmpty () |
bool | IsEmpty () const |
void | Extend (const CVector3D &min, const CVector3D &max) |
CBoundingBoxAligned & | operator+= (const CBoundingBoxAligned &b) |
CBoundingBoxAligned & | operator+= (const CVector3D &pt) |
bool | RayIntersect (const CVector3D &origin, const CVector3D &dir, float &tmin, float &tmax) const |
Check if a given ray intersects this AABB. More... | |
float | GetVolume () const |
void | GetCentre (CVector3D ¢re) const |
void | Expand (float amount) |
Expand the bounding box by the given amount in every direction. More... | |
void | IntersectFrustumConservative (const CFrustum &frustum) |
IntersectFrustumConservative: Approximate the intersection of this bounds object with the given frustum. More... | |
void | Render (CShaderProgramPtr &shader) const |
Render: Render the surfaces of the bound object as triangles. More... | |
void | RenderOutline (CShaderProgramPtr &shader) const |
Render: Render the outline of the bound object as lines. More... | |
Static Public Attributes | |
static const CBoundingBoxAligned | EMPTY = CBoundingBoxAligned() |
Private Attributes | |
CVector3D | m_Data [2] |
Definition at line 35 of file BoundingBoxAligned.h.
|
inline |
Definition at line 39 of file BoundingBoxAligned.h.
Definition at line 40 of file BoundingBoxAligned.h.
void CBoundingBoxAligned::Expand | ( | float | amount | ) |
Expand the bounding box by the given amount in every direction.
Definition at line 216 of file BoundingBoxAligned.cpp.
Definition at line 64 of file BoundingBoxAligned.h.
|
inline |
Definition at line 109 of file BoundingBoxAligned.h.
|
inline |
Definition at line 102 of file BoundingBoxAligned.h.
void CBoundingBoxAligned::IntersectFrustumConservative | ( | const CFrustum & | frustum | ) |
IntersectFrustumConservative: Approximate the intersection of this bounds object with the given frustum.
The bounds object is overwritten with the results.
The approximation is conservative in the sense that the result will always contain the actual intersection, but it may be larger than the intersection itself. The result will always be fully contained within the original bounds.
frustum | the frustum to intersect with |
Definition at line 198 of file BoundingBoxAligned.cpp.
bool CBoundingBoxAligned::IsEmpty | ( | ) | const |
Definition at line 131 of file BoundingBoxAligned.cpp.
|
inline |
Definition at line 75 of file BoundingBoxAligned.h.
|
inline |
Definition at line 82 of file BoundingBoxAligned.h.
|
inline |
Definition at line 58 of file BoundingBoxAligned.h.
|
inline |
Definition at line 59 of file BoundingBoxAligned.h.
bool CBoundingBoxAligned::RayIntersect | ( | const CVector3D & | origin, |
const CVector3D & | dir, | ||
float & | tmin, | ||
float & | tmax | ||
) | const |
Check if a given ray intersects this AABB.
See also Real-Time Rendering, Third Edition by T. Akenine-Moller, p. 741–742.
[in] | origin | Origin of the ray. |
[in] | dir | Direction vector of the ray, defining the positive direction of the ray. Must be of unit length. |
[out] | tmin,tmax | distance in the positive direction from the origin of the ray to the entry and exit points in the bounding box. If the origin is inside the box, then this is counted as an intersection and one of tMin and tMax may be negative. |
origin
and with unit direction vector dir
intersects this AABB, false otherwise. Definition at line 42 of file BoundingBoxAligned.cpp.
void CBoundingBoxAligned::Render | ( | CShaderProgramPtr & | shader | ) | const |
Render: Render the surfaces of the bound object as triangles.
Definition at line 224 of file BoundingBoxAligned.cpp.
void CBoundingBoxAligned::RenderOutline | ( | CShaderProgramPtr & | shader | ) | const |
Render: Render the outline of the bound object as lines.
Definition at line 256 of file BoundingBoxAligned.cpp.
void CBoundingBoxAligned::SetEmpty | ( | ) |
Definition at line 123 of file BoundingBoxAligned.cpp.
void CBoundingBoxAligned::Transform | ( | const CMatrix3D & | m, |
CBoundingBoxAligned & | result | ||
) | const |
Transforms these bounds according to the specified transformation matrix m
, and writes the axis-aligned bounds of that result to result
.
Definition at line 141 of file BoundingBoxAligned.cpp.
void CBoundingBoxAligned::Transform | ( | const CMatrix3D & | m, |
CBoundingBoxOriented & | result | ||
) | const |
Transform these bounds using the matrix transform
, and write out the result as an oriented (i.e.
non-axis-aligned) box. The difference with Transform(const CMatrix3D&, CBoundingBoxAligned&) is that that method is equivalent to first computing this result, and then taking the axis-aligned bounding boxes from the result again.
Definition at line 166 of file BoundingBoxAligned.cpp.
|
static |
Definition at line 150 of file BoundingBoxAligned.h.
|
private |
Definition at line 147 of file BoundingBoxAligned.h.