Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CBoundingSphere Class Reference

#include <BoundingSphere.h>

Collaboration diagram for CBoundingSphere:
Collaboration graph
[legend]

Public Member Functions

 CBoundingSphere ()
 
 CBoundingSphere (const CVector3D &center, float radius)
 
const CVector3DGetCenter () const
 
float GetRadius () const
 
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. More...
 

Static Public Member Functions

static CBoundingSphere FromSweptBox (const CBoundingBoxAligned &bbox)
 Construct a bounding sphere that encompasses a bounding box swept through all possible rotations around the origin. More...
 

Private Attributes

CVector3D m_Center
 
float m_Radius
 

Constructor & Destructor Documentation

◆ CBoundingSphere() [1/2]

CBoundingSphere::CBoundingSphere ( )
inline

◆ CBoundingSphere() [2/2]

CBoundingSphere::CBoundingSphere ( const CVector3D center,
float  radius 
)
inline

Member Function Documentation

◆ FromSweptBox()

CBoundingSphere CBoundingSphere::FromSweptBox ( const CBoundingBoxAligned bbox)
static

Construct a bounding sphere that encompasses a bounding box swept through all possible rotations around the origin.

◆ GetCenter()

const CVector3D& CBoundingSphere::GetCenter ( ) const
inline

◆ GetRadius()

float CBoundingSphere::GetRadius ( ) const
inline

◆ RayIntersect()

bool CBoundingSphere::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.

The direction should be normalized.

Member Data Documentation

◆ m_Center

CVector3D CBoundingSphere::m_Center
private

◆ m_Radius

float CBoundingSphere::m_Radius
private

The documentation for this class was generated from the following files: