My Project
Public Member Functions | Public Attributes | List of all members
ParaEngine::CShapeBox Class Reference

a min max box. More...

#include <ShapeAABB.h>

Public Member Functions

 CShapeBox (const CShapeBox &other)
 
 CShapeBox (const Vector3 &vMin, const Vector3 &vMax)
 
 CShapeBox (const CShapeBox *boxes, int nSize)
 
 CShapeBox (const Vector3 *points, int nSize)
 
 CShapeBox (const CShapeAABB &other)
 
const Vector3GetMin () const
 Get min point of the box.
 
const Vector3GetMax () const
 Get max point of the box.
 
void SetMinMax (const Vector3 &min, const Vector3 &max)
 Setups a box from min & max vectors. More...
 
void SetCenterExtents (const Vector3 &c, const Vector3 &e)
 Setups a box from center & extents vectors. More...
 
void SetEmpty ()
 Setups an empty box.
 
bool IsValid ()
 return false if it is empty. More...
 
void SetPointBox (const Vector3 &pt)
 Setups a point box.
 
float GetWidth () const
 
float GetHeight () const
 
float GetDepth () const
 
void GetCenter (Vector3 *vec) const
 
Vector3 GetCenter () const
 
Vector3 GetExtent () const
 
void Translate (const Vector3 &offset)
 translate by a offset
 
void Extend (const Vector3 &vec)
 merge a point to box
 
void Extend (const Vector3 *points, int nSize)
 Extends the point list. More...
 
void Extend (const CShapeBox *boxes, int nSize)
 Extends the box list. More...
 
void Extend (const CShapeOBB &p)
 Extends the AABB. More...
 
bool Intersect (float *hitDist, const Vector3 *origPt, const Vector3 *dir) const
 
bool Intersect (const CShapeSphere &sphere) const
 whether it intersect with a sphere
 
float DistanceToPoint (const Vector3 &p, Vector3 *where) const
 Point-AABB distance based on code from Dave Eberly's Magic Software: Magic Software, Inc. More...
 
Vector3 Point (int i) const
 

Public Attributes

Vector3 m_Max
 
Vector3 m_Min
 

Detailed Description

a min max box.

Member Function Documentation

§ DistanceToPoint()

float ParaEngine::CShapeBox::DistanceToPoint ( const Vector3 p,
Vector3 where 
) const

Point-AABB distance based on code from Dave Eberly's Magic Software: Magic Software, Inc.

http://www.magic-software.com return a rough distance square

§ Extend() [1/3]

void CShapeBox::Extend ( const Vector3 points,
int  nSize 
)

Extends the point list.

§ Extend() [2/3]

void CShapeBox::Extend ( const CShapeBox boxes,
int  nSize 
)

Extends the box list.

§ Extend() [3/3]

void ParaEngine::CShapeBox::Extend ( const CShapeOBB p)

Extends the AABB.

§ IsValid()

bool CShapeBox::IsValid ( )

return false if it is empty.

i.e. having negative extents

§ SetCenterExtents()

void CShapeBox::SetCenterExtents ( const Vector3 c,
const Vector3 e 
)

Setups a box from center & extents vectors.

Parameters
c[in] the center point
e[in] the extents vector

§ SetMinMax()

void ParaEngine::CShapeBox::SetMinMax ( const Vector3 min,
const Vector3 max 
)
inline

Setups a box from min & max vectors.

Parameters
min[in] the min point
max[in] the max point

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