6 #ifndef _INC_cHexahedron_H
7 #define _INC_cHexahedron_H
25 static const int k_NUMPLANES = 6;
43 return (1 << k_NUMPLANES) - 1;
46 void UpdateBBoxIndices();
48 bool GetIntersection(
const cBounds3f& box, OUT PLANES_MASK_t* planesMask =
nullptr)
const;
49 bool GetIntersection(
const cSpheref& sphere, OUT PLANES_MASK_t* planesMask =
nullptr)
const;
55 if (!GetIntersection(obj, &planesMask))
71 for (
int i = 0; i < k_NUMPLANES; i++)
72 m_aPlanes[i] = m_aPlanes[i].GetTransformPlane(m);
78 for (
int i = 0; i < k_NUMPLANES; i++)
79 m_aPlanes[i].TransformNormals(m);
87 for (
int i = 0; i < k_NUMPLANES; i++)
88 m_aPlanes[i].SetNormalized();
91 void SetBounds(
const cBounds3f& bbox);
93 void SetFrustum(
const cMatrix4x4f& m, DVALUE_t fUnit = 1);
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define TYPE
Definition: StrT.cpp:38
Definition: cHexahedron.h:18
PLANES_MASK_t get_FullPlanesMask() const noexcept
Definition: cHexahedron.h:41
GINTERSECT_TYPE IntersectTest(const TYPE &obj) const
Definition: cHexahedron.h:51
UNITTEST_FRIEND(cHexahedron)
cHexahedron() noexcept
Definition: cHexahedron.h:36
void TransformCoords(const cMatrix4x4f &m)
to transform polyhedrons, multiply by transpose of inverse of actual transform
Definition: cHexahedron.h:67
void TransformNormals(const cMatrix4x4f &m)
Definition: cHexahedron.h:75
void SetNormalized()
set coords.
Definition: cHexahedron.h:83
UINT PLANES_MASK_t
Bit Mask of the 6 planes.
Definition: cHexahedron.h:24
float DVALUE_t
Dimension value type.
Definition: cHexahedron.h:23
Definition: cMatrix.h:194
GINTERSECT_TYPE
Definition: cVecT.h:20
@ GINTERSECT_In1
object2 fully inside (or equal to) object1 (the main search comparator). CONTAINS
Definition: cVecT.h:28
@ GINTERSECT_Partial
object2 partly inside object1. partial intersection. INTERSECTS
Definition: cVecT.h:27
@ GINTERSECT_None
object2 completely outside object1 (no intersection) DISJOINT
Definition: cVecT.h:26
Definition: cHexahedron.h:29