# 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  

NLSOUND::CBoundingBox Class Reference

Bounding box (different from the NL3D ones). More...

#include <bounding_box.h>

Inheritance diagram for NLSOUND::CBoundingBox:

NLSOUND::IBoundingShape NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 CBoundingBox ()
 Constructor. More...

virtual bool include (const NLMISC::CVector &pos) const
 Return true if the box includes the specified point. More...

virtual float getDiameter () const
 Return the approximate diameter. More...

virtual float getRadiusAtIntersect (const NLMISC::CVector &pos) const
 Return the radius at the intersection of the shape and the line between the specified position and the center of the shape. More...

virtual const NLMISC::CVectorgetCenter () const
 Return a reference to the center of the shape. More...

virtual void setCenter (const NLMISC::CVector &pos)
 Move the shape. More...

virtual void serial (NLMISC::IStream &s)
 Serialize (if you change this, change the version in CEnvEffect::serialFileHeader() !). More...

virtual float getRatio (const NLMISC::CVector &pos, IBoundingShape *inner) const
 Return the ratio of a point between this shape and another inner shape. More...

 NLMISC_DECLARE_CLASS (CBoundingBox)
virtual NLMISC::CVector getIntersectWithLine (const NLMISC::CVector &c, const NLMISC::CVector &p) const
void getCorners (NLMISC::CVector &c1, NLMISC::CVector &c2)
 Return the corners (EDIT). More...

void setCorners (const NLMISC::CVector &c1, const NLMISC::CVector &c2)
 Set the corners (the corners must be ordered: 1 has smaller x, y, z) (EDIT). More...


Static Public Methods

void init ()
 Static init (call at the very beginning). More...


Private Attributes

float _Rx
float _Ry
float _Rz
NLMISC::CVector _Center

Detailed Description

Bounding box (different from the NL3D ones).

Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 44 of file bounding_box.h.


Constructor & Destructor Documentation

NLSOUND::CBoundingBox::CBoundingBox  
 

Constructor.

Definition at line 39 of file bounding_box.cpp.

Referenced by init.


Member Function Documentation

virtual const NLMISC::CVector& NLSOUND::CBoundingBox::getCenter   const [inline, virtual]
 

Return a reference to the center of the shape.

Implements NLSOUND::IBoundingShape.

Definition at line 64 of file bounding_box.h.

References _Center.

void NLSOUND::CBoundingBox::getCorners NLMISC::CVector   c1,
NLMISC::CVector   c2
 

Return the corners (EDIT).

Definition at line 155 of file bounding_box.cpp.

References _Center, _Rx, _Ry, _Rz, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

float NLSOUND::CBoundingBox::getDiameter   const [virtual]
 

Return the approximate diameter.

Implements NLSOUND::IBoundingShape.

Definition at line 62 of file bounding_box.cpp.

References _Rx, _Ry, and _Rz.

CVector NLSOUND::CBoundingBox::getIntersectWithLine const NLMISC::CVector   c,
const NLMISC::CVector   p
const [virtual]
 

Reimplemented from NLSOUND::IBoundingShape.

Definition at line 81 of file bounding_box.cpp.

References _Center, _Rx, _Ry, _Rz, uint, v, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

Referenced by getRatio.

float NLSOUND::CBoundingBox::getRadiusAtIntersect const NLMISC::CVector   pos const [virtual]
 

Return the radius at the intersection of the shape and the line between the specified position and the center of the shape.

Implements NLSOUND::IBoundingShape.

Definition at line 72 of file bounding_box.cpp.

float NLSOUND::CBoundingBox::getRatio const NLMISC::CVector   pos,
IBoundingShape   inner
const [virtual]
 

Return the ratio of a point between this shape and another inner shape.

The point must be included in this shape (the outer one) and not in the inner shape. If the point is near this shape, the ratio is near 0. If the point is near the inner shape, the ratio is near 1.

Implements NLSOUND::IBoundingShape.

Definition at line 124 of file bounding_box.cpp.

References getIntersectWithLine, and NLMISC::CVector::norm.

virtual bool NLSOUND::CBoundingBox::include const NLMISC::CVector   pos const [virtual]
 

Return true if the box includes the specified point.

Implements NLSOUND::IBoundingShape.

void NLSOUND::CBoundingBox::init void    [inline, static]
 

Static init (call at the very beginning).

Definition at line 51 of file bounding_box.h.

References CBoundingBox, and NLMISC_REGISTER_CLASS.

NLSOUND::CBoundingBox::NLMISC_DECLARE_CLASS CBoundingBox   
 

virtual void NLSOUND::CBoundingBox::serial NLMISC::IStream   s [inline, virtual]
 

Serialize (if you change this, change the version in CEnvEffect::serialFileHeader() !).

Implements NLSOUND::IBoundingShape.

Definition at line 68 of file bounding_box.h.

References _Center, _Rx, _Ry, _Rz, s, and NLMISC::IStream::serial.

virtual void NLSOUND::CBoundingBox::setCenter const NLMISC::CVector   pos [inline, virtual]
 

Move the shape.

Implements NLSOUND::IBoundingShape.

Definition at line 66 of file bounding_box.h.

References _Center.

void NLSOUND::CBoundingBox::setCorners const NLMISC::CVector   c1,
const NLMISC::CVector   c2
 

Set the corners (the corners must be ordered: 1 has smaller x, y, z) (EDIT).

Definition at line 168 of file bounding_box.cpp.

References _Center, _Rx, _Ry, _Rz, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.


Member Data Documentation

NLMISC::CVector NLSOUND::CBoundingBox::_Center [private]
 

Definition at line 94 of file bounding_box.h.

Referenced by getCenter, getCorners, getIntersectWithLine, serial, setCenter, and setCorners.

float NLSOUND::CBoundingBox::_Rx [private]
 

Definition at line 91 of file bounding_box.h.

Referenced by getCorners, getDiameter, getIntersectWithLine, serial, and setCorners.

float NLSOUND::CBoundingBox::_Ry [private]
 

Definition at line 91 of file bounding_box.h.

Referenced by getCorners, getDiameter, getIntersectWithLine, serial, and setCorners.

float NLSOUND::CBoundingBox::_Rz [private]
 

Definition at line 91 of file bounding_box.h.

Referenced by getCorners, getDiameter, getIntersectWithLine, serial, and setCorners.


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