Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cSphere2 Class Reference

#include <cSphere.h>

Inheritance diagram for GrayLib::cSphere2:
cSpheref

Public Member Functions

 cSphere2 ()
 
 cSphere2 (const cVector3f &vCenter, DVALUE_t fObjectRadius)
 
void put_Radius (DVALUE_t fRadius)
 
DVALUE_t get_RadiusSq () const
 
void SetSphere (const cVector3f &vCenter, DVALUE_t fRadius)
 
GINTERSECT_TYPE GetRayIntersectionFrustum (const cVector3f &vRayOrigin, const cVector3f &vRayDir, cVector3f *pvIntersect, DVALUE_t fDistMaxSq) const
 
bool IsRayIntersectionInFront (const cVector3f &vRayOrigin, const cVector3f &vRayDir, cVector3f *pvIntersect) const
 
bool IsRayIntersectionDistSq (const cVector3f &vRayOrigin, const cVector3f &vRayDir, DVALUE_t fDistMaxSq, OUT cVector3f *pvIntersect) const
 

Protected Attributes

DVALUE_t m_fRadiusSq
 keep radius squared. for faster access. More...
 

Detailed Description

class to represent a Sphere in 3d space. (float) keep the radius squared for faster access.

Constructor & Destructor Documentation

◆ cSphere2() [1/2]

GrayLib::cSphere2::cSphere2 ( )
inline

◆ cSphere2() [2/2]

GrayLib::cSphere2::cSphere2 ( const cVector3f vCenter,
DVALUE_t  fObjectRadius 
)
inline

Member Function Documentation

◆ get_RadiusSq()

DVALUE_t GrayLib::cSphere2::get_RadiusSq ( ) const
inline

◆ GetRayIntersectionFrustum()

GINTERSECT_TYPE GrayLib::cSphere2::GetRayIntersectionFrustum ( const cVector3f vRayOrigin,
const cVector3f vRayDir,
cVector3f pvIntersect,
DVALUE_t  fDistMaxSq 
) const

ray to sphere intersection test

Note
ASSUME vDir is normalized!
Returns
0 = GINTERSECT_None = no intersect. 1 = GINTERSECT_Partial = intersect. 2 = GINTERSECT_In1 = intersect from inside.

◆ IsRayIntersectionDistSq()

bool GrayLib::cSphere2::IsRayIntersectionDistSq ( const cVector3f vRayOrigin,
const cVector3f vRayDir,
DVALUE_t  fDistMaxSq,
OUT cVector3f pvIntersect 
) const

Similar to D3DXSphereBoundProbe but with intersection returned.

◆ IsRayIntersectionInFront()

bool GrayLib::cSphere2::IsRayIntersectionInFront ( const cVector3f vRayOrigin,
const cVector3f vRayDir,
cVector3f pvIntersect 
) const

No idea what this means. what is the 'front' of a sphere ? closest intersection to vRayOrigin ?

◆ put_Radius()

void GrayLib::cSphere2::put_Radius ( DVALUE_t  fRadius)
inline

◆ SetSphere()

void GrayLib::cSphere2::SetSphere ( const cVector3f vCenter,
DVALUE_t  fRadius 
)
inline

Member Data Documentation

◆ m_fRadiusSq

DVALUE_t GrayLib::cSphere2::m_fRadiusSq
protected

keep radius squared. for faster access.


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