# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CBSphere Class Reference

A bounding Sphere. More...

#include <bsphere.h>

List of all members.

Public Methods

 CBSphere ()
 Empty Constructor. More...

 CBSphere (const CVector &center, float radius)
 Constructor. More...

bool include (const CVector &p) const
 Does the sphere include this point? More...

bool include (const CBSphere &s) const
 Does the sphere include TOTALY this sphere? More...

bool intersect (const CBSphere &s) const
 Does the sphere intersect the other? More...

transform
void applyTransform (const CMatrix &mat, CBSphere &res)
 compute res= mat * this. More...

Clip
bool clipFront (const CPlane &p) const
 Is the bbox partially in front of the plane?? p MUST be normalized. More...

bool clipBack (const CPlane &p) const
 Is the bbox partially in back of the plane?? p MUST be normalized. More...


Public Attributes

CVector Center
float Radius


Detailed Description

A bounding Sphere.

Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 49 of file bsphere.h.


Constructor & Destructor Documentation

NLMISC::CBSphere::CBSphere   [inline]
 

Empty Constructor.

Definition at line 56 of file bsphere.h.

NLMISC::CBSphere::CBSphere const CVector   center,
float    radius
[inline]
 

Constructor.

Definition at line 58 of file bsphere.h.

References Center, and Radius.


Member Function Documentation

void NLMISC::CBSphere::applyTransform const CMatrix   mat,
CBSphere &    res
 

compute res= mat * this.

NB: radius is maximized, taking max of the 3 axis of the matrix. NB: this may be false if the matrix is not orthogonal...

Definition at line 88 of file bsphere.cpp.

References Center, Radius, and res.

bool NLMISC::CBSphere::clipBack const CPlane   p const
 

Is the bbox partially in back of the plane?? p MUST be normalized.

Definition at line 50 of file bsphere.cpp.

References Center, and Radius.

Referenced by NL3D::CVegetableClipBlock::clip, and NL3D::CTessBlock::clip.

bool NLMISC::CBSphere::clipFront const CPlane   p const
 

Is the bbox partially in front of the plane?? p MUST be normalized.

Definition at line 37 of file bsphere.cpp.

References Center, and Radius.

bool NLMISC::CBSphere::include const CBSphere &    s const
 

Does the sphere include TOTALY this sphere?

Definition at line 69 of file bsphere.cpp.

References Center, Radius, s, and NLMISC::sqr.

bool NLMISC::CBSphere::include const CVector   p const
 

Does the sphere include this point?

Definition at line 63 of file bsphere.cpp.

References Center, Radius, and NLMISC::sqr.

Referenced by NL3D::CZoneLighter::CPointLightRT::testRaytrace, and NL3D::CInstanceLighter::CPointLightRT::testRaytrace.

bool NLMISC::CBSphere::intersect const CBSphere &    s const
 

Does the sphere intersect the other?

Definition at line 79 of file bsphere.cpp.

References Center, Radius, s, and NLMISC::sqr.


Member Data Documentation

CVector NLMISC::CBSphere::Center
 

Definition at line 52 of file bsphere.h.

Referenced by applyTransform, CBSphere, clipBack, NL3D::CTessBlock::clipFar, clipFront, NL3D::CPatchDLMPointLight::compile, NL3D::CVegetableClipBlock::extendSphere, NL3D::CTessBlock::extendSphereCompile, include, intersect, NL3D::CZoneLighter::CPointLightRT::testRaytrace, NL3D::CInstanceLighter::CPointLightRT::testRaytrace, and NL3D::CVegetableClipBlock::updateSphere.

float NLMISC::CBSphere::Radius
 

Definition at line 53 of file bsphere.h.

Referenced by applyTransform, CBSphere, clipBack, NL3D::CTessBlock::clipFar, clipFront, NL3D::CPatchDLMPointLight::compile, NL3D::CVegetableClipBlock::extendSphere, NL3D::CTessBlock::extendSphereCompile, include, intersect, and NL3D::CVegetableClipBlock::updateSphere.


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