18 #ifndef INCLUDED_BOUNDINGSPHERE 19 #define INCLUDED_BOUNDINGSPHERE 41 float maxX = std::max(fabsf(bbox[0].
X), fabsf(bbox[1].X));
42 float maxY = std::max(fabsf(bbox[0].
Y), fabsf(bbox[1].Y));
43 float maxZ = std::max(fabsf(bbox[0].
Z), fabsf(bbox[1].Z));
44 float radius = sqrtf(maxX*maxX + maxY*maxY + maxZ*maxZ);
66 float pcLen = dir.
Dot(v);
70 v = (dir * pcLen) - v;
77 #endif // INCLUDED_BOUNDINGSPHERE Definition: Decompose.h:22
float Dot(const CVector3D &vector) const
Definition: Vector3D.h:99
Definition: Vector3D.h:28
CBoundingSphere()
Definition: BoundingSphere.h:31
bool RayIntersect(const CVector3D &origin, const CVector3D &dir) const
Check if the ray, defined by an origin point and a direction unit vector interesects with the sphere...
Definition: BoundingSphere.h:63
float GetRadius() const
Definition: BoundingSphere.h:54
CBoundingSphere(const CVector3D ¢er, float radius)
Definition: BoundingSphere.h:33
static CBoundingSphere FromSweptBox(const CBoundingBoxAligned &bbox)
Construct a bounding sphere that encompasses a bounding box swept through all possible rotations arou...
Definition: BoundingSphere.h:39
#define X(id)
Definition: CStrIntern.cpp:89
Definition: Decompose.h:22
Definition: BoundingSphere.h:24
Definition: BoundingBoxAligned.h:35
CVector3D m_Center
Definition: BoundingSphere.h:27
float LengthSquared() const
Definition: Vector3D.cpp:48
const CVector3D & GetCenter()
Definition: BoundingSphere.h:49
float m_Radius
Definition: BoundingSphere.h:28