![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cHexahedron.h>
Classes | |
struct | BBOX_INDICES_t |
Public Types | |
typedef float | DVALUE_t |
Dimension value type. More... | |
typedef UINT | PLANES_MASK_t |
Bit Mask of the 6 planes. More... | |
Public Member Functions | |
cHexahedron () noexcept | |
cHexahedron (const cBounds3f &bbox) | |
PLANES_MASK_t | get_FullPlanesMask () const noexcept |
void | UpdateBBoxIndices () |
need to be called after planes were changed if you want BBox testing More... | |
bool | GetIntersection (const cBounds3f &box, OUT PLANES_MASK_t *planesMask=nullptr) const |
bool | GetIntersection (const cSpheref &sphere, OUT PLANES_MASK_t *planesMask=nullptr) const |
template<class TYPE > | |
GINTERSECT_TYPE | IntersectTest (const TYPE &obj) const |
void | TransformCoords (const cMatrix4x4f &m) |
to transform polyhedrons, multiply by transpose of inverse of actual transform More... | |
void | TransformNormals (const cMatrix4x4f &m) |
void | SetNormalized () |
set coords. More... | |
void | SetBounds (const cBounds3f &bbox) |
void | SetW (const cHexahedron &frustum, const cVector3f &vPos) |
void | SetFrustum (const cMatrix4x4f &m, DVALUE_t fUnit=1) |
UNITTEST_FRIEND (cHexahedron) | |
Static Public Attributes | |
static const int | k_NUMPLANES = 6 |
Hexahedron, Frustum, (maybe cubic?) More... | |
Protected Attributes | |
BBOX_INDICES_t | m_BBoxIndices [k_NUMPLANES] |
for fast bbox tests More... | |
cPlanef | m_aPlanes [k_NUMPLANES] |
represent the bbox as a set of planes. More... | |
a six sided 3d object. e.g. Hexahedron, Frustum, cubic. convex polyhedral space, represented as union of half-spaces, each half-space represented as plane
typedef float GrayLib::cHexahedron::DVALUE_t |
Dimension value type.
typedef UINT GrayLib::cHexahedron::PLANES_MASK_t |
Bit Mask of the 6 planes.
|
inlinenoexcept |
GrayLib::cHexahedron::cHexahedron | ( | const cBounds3f & | bbox | ) |
|
inlinenoexcept |
bool GrayLib::cHexahedron::GetIntersection | ( | const cBounds3f & | box, |
OUT PLANES_MASK_t * | planesMask = nullptr |
||
) | const |
does the bbox intersect the frustum/hexahedron? very fast and 100% precise requires pre-setup indices though (UpdateBBoxIndices)
bool GrayLib::cHexahedron::GetIntersection | ( | const cSpheref & | sphere, |
OUT PLANES_MASK_t * | planesMask = nullptr |
||
) | const |
does the sphere intersect the frustum/hexahedron?
|
inline |
TYPE = cBounds3f, cSpheref
void GrayLib::cHexahedron::SetBounds | ( | const cBounds3f & | bbox | ) |
void GrayLib::cHexahedron::SetFrustum | ( | const cMatrix4x4f & | m, |
DVALUE_t | fUnit = 1 |
||
) |
this is frustum in projected coords, back transformed to make pyramidal (or cubic) convex polyhedron
|
inline |
set coords.
usually this is not needed unless you want normalized plane normals all plane checks work perfectly without normalization
void GrayLib::cHexahedron::SetW | ( | const cHexahedron & | frustum, |
const cVector3f & | vPos | ||
) |
Offset coords.
|
inline |
to transform polyhedrons, multiply by transpose of inverse of actual transform
4x4 mult. SetMul e.g. Make a unit bbox into a camera frustum.
|
inline |
3x3 mult
GrayLib::cHexahedron::UNITTEST_FRIEND | ( | cHexahedron | ) |
void GrayLib::cHexahedron::UpdateBBoxIndices | ( | ) |
need to be called after planes were changed if you want BBox testing
|
static |
Hexahedron, Frustum, (maybe cubic?)
|
protected |
represent the bbox as a set of planes.
|
protected |
for fast bbox tests