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

AABB with orientation by a matrix. More...

#include <ShapeOBB.h>

Public Member Functions

 CShapeOBB (const CShapeAABB &aabb, const Matrix4 &mat)
 
void SetEmpty ()
 Setups an empty CShapeOBB.
 
bool ContainsPoint (const Vector3 &p) const
 Tests if a point is contained within the CShapeOBB. More...
 
void Create (const CShapeAABB &aabb, const Matrix4 &mat)
 Builds an CShapeOBB from an CShapeAABB and a world transform. More...
 
void Rotate (const Matrix4 &mtx, CShapeOBB &obb) const
 Recomputes the CShapeOBB after an arbitrary transform by a 4x4 matrix. More...
 
BOOL IsValid () const
 Checks the CShapeOBB is valid. More...
 
bool ComputePlanes (Plane *planes) const
 Computes the obb planes. More...
 
bool ComputePoints (Vector3 *pts) const
 Computes the obb points. More...
 
bool ComputeVertexNormals (Vector3 *pts) const
 Computes vertex normals. More...
 
const DWORD * GetEdges () const
 Returns edges. More...
 
const Vector3GetLocalEdgeNormals () const
 Returns local edge normals. More...
 
void ComputeWorldEdgeNormal (DWORD edge_index, Vector3 &world_normal) const
 Returns world edge normal. More...
 
BOOL IsInside (const CShapeOBB &box) const
 Checks the CShapeOBB is inside another CShapeOBB. More...
 
const Vector3GetCenter () const
 
const Vector3GetExtents () const
 
const Matrix4GetRot () const
 
void GetRotatedExtents (Matrix4 &extents) const
 

Public Attributes

Vector3 mCenter
 B for Box.
 
Vector3 mExtents
 B for Bounding.
 
Matrix4 mRot
 O for Oriented.
 

Detailed Description

AABB with orientation by a matrix.

Member Function Documentation

§ ComputePlanes()

bool CShapeOBB::ComputePlanes ( Plane planes) const

Computes the obb planes.

Parameters
planes[out] 6 box planes
Returns
true if success

§ ComputePoints()

bool CShapeOBB::ComputePoints ( Vector3 pts) const

Computes the obb points.

Parameters
pts[out] 8 box points
Returns
true if success

§ ComputeVertexNormals()

bool CShapeOBB::ComputeVertexNormals ( Vector3 pts) const

Computes vertex normals.

Parameters
pts[out] 8 box points
Returns
true if success

§ ComputeWorldEdgeNormal()

void CShapeOBB::ComputeWorldEdgeNormal ( DWORD  edge_index,
Vector3 world_normal 
) const

Returns world edge normal.

Parameters
edge_index[in] 0 <= edge index < 12
world_normal[out] edge normal in world space

§ ContainsPoint()

bool CShapeOBB::ContainsPoint ( const Vector3 p) const

Tests if a point is contained within the CShapeOBB.

Parameters
p[in] the world point to test
Returns
true if inside the CShapeOBB

§ Create()

void CShapeOBB::Create ( const CShapeAABB aabb,
const Matrix4 mat 
)

Builds an CShapeOBB from an CShapeAABB and a world transform.

Parameters
aabb[in] the aabb
mat[in] the world transform

§ GetEdges()

const DWORD * CShapeOBB::GetEdges ( ) const

Returns edges.

Returns
24 indices (12 edges) indexing the list returned by ComputeD3DXVECTOR3s()

§ GetLocalEdgeNormals()

const Vector3 * CShapeOBB::GetLocalEdgeNormals ( ) const

Returns local edge normals.

Returns
edge normals in local space

§ IsInside()

BOOL CShapeOBB::IsInside ( const CShapeOBB box) const

Checks the CShapeOBB is inside another CShapeOBB.

Parameters
box[in] the other CShapeOBB
Returns
TRUE if we're inside the other box

§ IsValid()

BOOL CShapeOBB::IsValid ( ) const

Checks the CShapeOBB is valid.

Returns
true if the box is valid

§ Rotate()

void CShapeOBB::Rotate ( const Matrix4 mtx,
CShapeOBB obb 
) const

Recomputes the CShapeOBB after an arbitrary transform by a 4x4 matrix.

Parameters
mtx[in] the transform matrix
obb[out] the transformed CShapeOBB

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