# 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::CAABBox Class Reference

An Axis Aligned Bouding Box. More...

#include <aabbox.h>

Inheritance diagram for NLMISC::CAABBox:

NLMISC::CAABBoxExt List of all members.

Misc

void makePyramid (CPlane planes[6]) const
 Build the equivalent polytope of planes. More...

void computeIntersection (const CAABBox &b1, const CAABBox &b2)
 Compute the intersection of 2 bboxs. More...

CAABBox computeAABBoxUnion (const CAABBox &b1, const CAABBox &b2)
 Compute the union of 2 aabboxes, that is the aabbox that contains the 2. More...

CAABBox transformAABBox (const CMatrix &mat, const CAABBox &box)
 Apply a matrix on an aabbox. More...


Public Methods

 CAABBox ()
 Empty bbox Constructor. (for AABBoxExt::getRadius() correctness). More...

void serial (NLMISC::IStream &f)
Builds.
void setCenter (const CVector &center)
void setHalfSize (const CVector &hs)
void setSize (const CVector &s)
 Set the size of the bbox (ie 2* the halfSize). More...

void setMinMax (const CVector &bmin, const CVector &bmax)
 Build the bbox, with a min/max style bbox. More...

void extend (const CVector &v)
 extend the bbox so it contains v. More...

Gets.
CVector getMin () const
CVector getMax () const
void getMin (CVector &ret) const
void getMax (CVector &ret) const
const CVectorgetCenter () const
const CVectorgetHalfSize () const
CVector getSize () const
 Return the size of the bbox. More...

void getSize (CVector &ret) const
float getRadius () const
 Return the radius of the bbox. More...

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

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

bool include (const CVector &a) const
 Does the bbox include this point. More...

bool include (const CAABBox &box) const
 Does the bbox include entirely this bbox. More...

bool intersect (const CAABBox &box) const
 Does the bbox intersect the bbox box. More...

bool intersect (const CVector &a, const CVector &b, const CVector &c) const
 Does the bbox intersect the triangle ABC. More...

bool intersect (const CBSphere &s) const
 Does the bbox instersect the sphere s. More...


Protected Attributes

CVector Center
 The center of the bbox. More...

CVector HalfSize
 The size/2 of the bbox. More...


Detailed Description

An Axis Aligned Bouding Box.

Note: Center/HalfSize set to private, to have same manipulation for CAABBox and CAABBoxExt.

Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 54 of file aabbox.h.


Constructor & Destructor Documentation

NLMISC::CAABBox::CAABBox   [inline]
 

Empty bbox Constructor. (for AABBoxExt::getRadius() correctness).

Definition at line 65 of file aabbox.h.

References Center, and HalfSize.

Referenced by NLMISC::CAABBoxExt::CAABBoxExt, computeAABBoxUnion, NLMISC::CAABBoxExt::getAABBox, NLMISC::CAABBoxExt::operator=, and transformAABBox.


Member Function Documentation

bool NLMISC::CAABBox::clipBack const CPlane   p const
 

Is the bbox partially in back of the plane??

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 59 of file aabbox.cpp.

References Center, and HalfSize.

Referenced by NL3D::CParticleSystemModel::checkAgainstPyramid, and NL3D::CWaterShape::clip.

bool NLMISC::CAABBox::clipFront const CPlane   p const
 

Is the bbox partially in front of the plane??

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 39 of file aabbox.cpp.

References Center, and HalfSize.

CAABBox NLMISC::CAABBox::computeAABBoxUnion const CAABBox &    b1,
const CAABBox &    b2
[static]
 

Compute the union of 2 aabboxes, that is the aabbox that contains the 2.

Should end up in NLMISC

Definition at line 190 of file aabbox.cpp.

References CAABBox, and min.

Referenced by NL3D::CPSLocated::computeBBox, and NL3D::CParticleSystem::computeBBox.

void NLMISC::CAABBox::computeIntersection const CAABBox &    b1,
const CAABBox &    b2
 

Compute the intersection of 2 bboxs.

NB: this methods suppose the intersection exist, and doesn't check it (use intersect() to check). If !intersect, *this is still modified and the result bbox is big chit.

Definition at line 206 of file aabbox.cpp.

References setMinMax.

void NLMISC::CAABBox::extend const CVector   v
 

extend the bbox so it contains v.

Warning!! By default, a bbox is the vector 0,0,0. So set the first vertex with setCenter() or else the bbox will be the extension of v and (0,0,0)...

Definition at line 174 of file aabbox.cpp.

References getMax, getMin, setMinMax, and v.

Referenced by NL3D::CZoneLighter::computeTileFlagsForPositionTowardWater, NLPACS::CCollisionMeshBuild::computeTrivialTranslation, NL3D::CVegetableClipBlock::extendBBoxOnly, NL3D::CQuadGridClipCluster::extendCluster, NL3D::CTessBlock::extendSphereAdd, NLPACS::CGlobalRetriever::makeInstance, and NL3D::CCluster::makeVolume.

const CVector& NLMISC::CAABBox::getCenter   const [inline]
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 94 of file aabbox.h.

References Center.

Referenced by NLPACS::CSurfaceQuadTree::addVertex, NL3D::CSkeletonShape::clip, NLPACS::CCollisionMeshBuild::computeTrivialTranslation, NL3D::CQuadGridClipCluster::extendCluster, NL3D::CTessBlock::extendSphereCompile, NLPACS::CRetrieverInstance::make, NLPACS::CSurfaceQuadTree::translate, and NL3D::CVegetableClipBlock::updateSphere.

const CVector& NLMISC::CAABBox::getHalfSize   const [inline]
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 95 of file aabbox.h.

References HalfSize.

Referenced by NL3D::CPSUtil::addRadiusToAABBox, NLPACS::CSurfaceQuadTree::addVertex, NL3D::CQuadGridClipCluster::extendCluster, NLPACS::CRetrieverInstance::make, and NLPACS::CGlobalRetriever::makeInstance.

void NLMISC::CAABBox::getMax CVector   ret const [inline]
 

Definition at line 93 of file aabbox.h.

References Center, and HalfSize.

CVector NLMISC::CAABBox::getMax   const [inline]
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 91 of file aabbox.h.

References Center, and HalfSize.

Referenced by NL3D::CZoneLighter::computeTileFlagsForPositionTowardWater, NL3D::CPSUtil::displayBBox, extend, intersect, NL3D::CZoneLighter::makeQuadGridFromWaterShapes, NLPACS::CLocalRetriever::retrievePosition, NLPACS::CEdgeQuad::selectEdges, NLPACS::CChainQuad::selectEdges, and NLPACS::CGlobalRetriever::selectInstances.

void NLMISC::CAABBox::getMin CVector   ret const [inline]
 

Definition at line 92 of file aabbox.h.

References Center, and HalfSize.

CVector NLMISC::CAABBox::getMin   const [inline]
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 90 of file aabbox.h.

References Center, and HalfSize.

Referenced by NL3D::CPSUtil::displayBBox, extend, intersect, NL3D::CZoneLighter::makeQuadGridFromWaterShapes, NLPACS::CLocalRetriever::retrievePosition, NLPACS::CEdgeQuad::selectEdges, NLPACS::CChainQuad::selectEdges, and NLPACS::CGlobalRetriever::selectInstances.

float NLMISC::CAABBox::getRadius   const [inline]
 

Return the radius of the bbox.

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 100 of file aabbox.h.

References HalfSize.

Referenced by NL3D::CSkeletonShape::clip, NL3D::CQuadGridClipCluster::extendCluster, NL3D::CTessBlock::extendSphereCompile, and NL3D::CVegetableClipBlock::updateSphere.

void NLMISC::CAABBox::getSize CVector   ret const [inline]
 

Definition at line 98 of file aabbox.h.

References HalfSize.

CVector NLMISC::CAABBox::getSize   const [inline]
 

Return the size of the bbox.

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 97 of file aabbox.h.

References HalfSize.

bool NLMISC::CAABBox::include const CAABBox &    box const
 

Does the bbox include entirely this bbox.

Definition at line 94 of file aabbox.cpp.

References Center, and HalfSize.

bool NLMISC::CAABBox::include const CVector   a const
 

Does the bbox include this point.

Definition at line 81 of file aabbox.cpp.

References Center, and HalfSize.

Referenced by NLPACS::CSurfaceQuadTree::addVertex, NL3D::CVegetableClipBlock::extendBBoxOnly, NL3D::CTessBlock::extendSphereAdd, NLPACS::CSurfaceQuadTree::getInterpZ, NLPACS::CSurfaceQuadTree::getLeaf, intersect, and NLPACS::CGlobalRetriever::retrievePosition.

bool NLMISC::CAABBox::intersect const CBSphere   s const
 

Does the bbox instersect the sphere s.

Definition at line 137 of file aabbox.cpp.

References Center, HalfSize, and s.

bool NLMISC::CAABBox::intersect const CVector   a,
const CVector   b,
const CVector   c
const
 

Does the bbox intersect the triangle ABC.

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 121 of file aabbox.cpp.

References include, and makePyramid.

bool NLMISC::CAABBox::intersect const CAABBox &    box const
 

Does the bbox intersect the bbox box.

Definition at line 107 of file aabbox.cpp.

References getMax, and getMin.

Referenced by NL3D::CZoneLighter::makeQuadGridFromWaterShapes.

void NLMISC::CAABBox::makePyramid CPlane    planes[6] const
 

Build the equivalent polytope of planes.

Definition at line 153 of file aabbox.cpp.

References Center, and HalfSize.

Referenced by intersect.

void NLMISC::CAABBox::serial NLMISC::IStream   f
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 165 of file aabbox.cpp.

References Center, HalfSize, NLMISC::IStream::serial, and NLMISC::IStream::serialVersion.

void NLMISC::CAABBox::setCenter const CVector   center [inline]
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 70 of file aabbox.h.

References Center.

Referenced by NL3D::CPatchDLMPointLight::compile, NL3D::CParticleSystem::computeBBox, NLPACS::CCollisionMeshBuild::computeTrivialTranslation, NL3D::CSegRemanenceShape::CSegRemanenceShape, NL3D::CSkeletonShape::CSkeletonShape, NLPACS::CSurfaceQuadTree::CSurfaceQuadTree, NL3D::CVegetableClipBlock::extendSphere, NL3D::CTessBlock::extendSphereFirst, NLPACS::CGlobalRetriever::findCollisionChains, NL3D::CWaveMakerShape::getAABBox, NL3D::CTransformShape::getAABBox, NL3D::CTransform::getAABBox, NL3D::CParticleSystemShape::getAABBox, NL3D::CFlareShape::getAABBox, NLPACS::IQuadNode::getBBox, NLPACS::CSurfaceQuadTree::init, NLPACS::CGlobalRetriever::init, NLPACS::CRetrieverInstance::make, NL3D::CCluster::makeVolume, and NLPACS::CSurfaceQuadTree::translate.

void NLMISC::CAABBox::setHalfSize const CVector   hs [inline]
 

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 71 of file aabbox.h.

References HalfSize.

Referenced by NL3D::CPSUtil::addRadiusToAABBox, NL3D::CPatchDLMPointLight::compile, NL3D::CParticleSystem::computeBBox, NL3D::CSegRemanenceShape::CSegRemanenceShape, NL3D::CVegetableClipBlock::extendSphere, NL3D::CTessBlock::extendSphereFirst, NL3D::CWaveMakerShape::getAABBox, NL3D::CTransformShape::getAABBox, NL3D::CTransform::getAABBox, NL3D::CParticleSystemShape::getAABBox, NL3D::CFlareShape::getAABBox, NLPACS::IQuadNode::getBBox, NLPACS::CSurfaceQuadTree::init, NLPACS::CGlobalRetriever::init, and NLPACS::CRetrieverInstance::make.

void NLMISC::CAABBox::setMinMax const CVector   bmin,
const CVector   bmax
[inline]
 

Build the bbox, with a min/max style bbox.

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 75 of file aabbox.h.

References Center, and HalfSize.

Referenced by NL3D::CWaterShape::computeBBox, NL3D::CPSLocated::computeBBox, computeIntersection, NL3D::CZoneLighter::computeTileFlagsForPositionTowardWater, and extend.

void NLMISC::CAABBox::setSize const CVector   s [inline]
 

Set the size of the bbox (ie 2* the halfSize).

Reimplemented in NLMISC::CAABBoxExt.

Definition at line 73 of file aabbox.h.

References HalfSize, and s.

Referenced by NL3D::CSkeletonShape::CSkeletonShape, and NLPACS::CSurfaceQuadTree::CSurfaceQuadTree.

CAABBox NLMISC::CAABBox::transformAABBox const CMatrix   mat,
const CAABBox &    box
[static]
 

Apply a matrix on an aabbox.

Returns:
an aabbox, bigger or equal to parameter, after the matrix multiplication

Definition at line 221 of file aabbox.cpp.

References CAABBox, and min.

Referenced by NL3D::CCluster::applyMatrix, NL3D::CParticleSystem::computeBBox, NL3D::CZoneLighter::makeQuadGridFromWaterShapes, and NL3D::CCluster::setWorldMatrix.


Member Data Documentation

CVector NLMISC::CAABBox::Center [protected]
 

The center of the bbox.

Definition at line 58 of file aabbox.h.

Referenced by CAABBox, NLMISC::CAABBoxExt::clipBack, clipBack, NLMISC::CAABBoxExt::clipFront, clipFront, NLMISC::CAABBoxExt::getCenter, getCenter, getMax, getMin, include, intersect, makePyramid, NLMISC::CAABBoxExt::operator=, serial, NLMISC::CAABBoxExt::setCenter, setCenter, NLMISC::CAABBoxExt::setMinMax, and setMinMax.

CVector NLMISC::CAABBox::HalfSize [protected]
 

The size/2 of the bbox.

Definition at line 60 of file aabbox.h.

Referenced by CAABBox, clipBack, clipFront, NLMISC::CAABBoxExt::getHalfSize, getHalfSize, getMax, getMin, getRadius, NLMISC::CAABBoxExt::getSize, getSize, include, intersect, makePyramid, NLMISC::CAABBoxExt::operator=, serial, NLMISC::CAABBoxExt::setHalfSize, setHalfSize, NLMISC::CAABBoxExt::setMinMax, setMinMax, NLMISC::CAABBoxExt::setSize, setSize, and NLMISC::CAABBoxExt::updateRadius.


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