18 #include "precompiled.h"
50 float tMin = -FLT_MAX;
55 for (
int i = 0; i < 3; ++i)
78 if (t1 > tMin) tMin = t1;
79 if (t2 < tMax) tMax = t2;
82 if (tMin > tMax)
return false;
83 if (tMax < 0)
return false;
bool RayIntersect(const CVector3D &origin, const CVector3D &dir, float &tMin, float &tMax) const
Check if a given ray intersects this box.
float Dot(const CVector3D &vector) const
void GetCentre(CVector3D ¢re) const
CVector3D m_Center
Centroid location of the box.
CVector3D m_Basis[3]
Basis vectors (u,v,w) of the sides.
static const CBoundingBoxOriented EMPTY
CVector3D m_HalfSizes
Half the sizes of the box in each dimension (u,v,w).
CBoundingBoxOriented()
Empty constructor; creates an empty box.