"L. Spiro Engine"
Public Member Functions | Public Attributes

lsp::CAabb Class Reference

A min-max axis-aligned bounding box. More...

#include <LSPAabb.h>

List of all members.

Public Member Functions

LSVOID LSE_CALL MakeInfinitelySmall ()
LSVOID LSE_CALL ComputeAabbFromPointArray (const CVector3 *_pvPoints, LSUINT32 _uiTotal)
LSVOID LSE_CALL ComputeAabbFromAabbAndMatrix (const CAabb &_aabbOther, const CMatrix4x4 &_mTrans)
LSVOID LSE_CALL Encompass (const CAabb &_aabbOther)
LSVOID LSE_CALL Encompass (const CVector3 &_vOther)
LSVOID LSE_CALL Expand (LSREAL _fAmount)
LSVOID LSE_CALL GetBox (CVector3 _vPoints[8]) const
CVector3 LSE_CALL GetCenter () const
LSREAL LSE_CALL GetSizeX () const
LSREAL LSE_CALL GetSizeY () const
LSREAL LSE_CALL GetSizeZ () const
LSREAL LSE_CALL GetVolume () const
CVector3 LSE_CALL ClosestPointToPoint (const CVector3 &_vPoint) const
LSREAL LSE_CALL GetSqDistFromPoint (const CVector3 &_vPoint) const
CVector3 LSE_CALL GetCorner (LSUINT32 _ui32Mask) const

Public Attributes

CVector3 m_vMin
CVector3 m_vMax

Detailed Description

A min-max axis-aligned bounding box.

Class CAabb Description: A min-max axis-aligned bounding box.


Member Function Documentation

CVector3 LSE_CALL lsp::CAabb::ClosestPointToPoint ( const CVector3 &  _vPoint) const

Gets the closest point on this AABB to a given point.

Parameters:
_vPointThe point from which the closest point on this bounding box is to be calculated.
Returns:
Returns the closest point on this box from the given point.
LSVOID LSE_CALL lsp::CAabb::ComputeAabbFromAabbAndMatrix ( const CAabb _aabbOther,
const CMatrix4x4 &  _mTrans 
)

Compute an AABB from an existing AABB with a matrix-stored translation. The matrix must be row-major.

Parameters:
_aabbOtherThe source bounding box to transform by the given matrix and store in this object.
_mTransThe matrix used to transform _aabbOther into this bounding box.
LSVOID LSE_CALL lsp::CAabb::ComputeAabbFromPointArray ( const CVector3 *  _pvPoints,
LSUINT32  _uiTotal 
)

Compute an AABB from a set of points given in the form of an array of CVector3's.

Parameters:
_vPointsThe array of points to enclose.
_uiTotalThe number of points in the array to which _vPoints points.
LSVOID LSE_CALL lsp::CAabb::Encompass ( const CAabb _aabbOther)

Change the size of the AABB to encompass another AABB.

Parameters:
_aabbOtherThe bounding box to fully encompass by this bounding box.
LSVOID LSE_CALL lsp::CAabb::Encompass ( const CVector3 &  _vOther)

Change the size of the AABB to encompass a point.

Parameters:
_vOtherThe point to fully encompass by this bounding box.
LSVOID LSE_CALL lsp::CAabb::Expand ( LSREAL  _fAmount)

Expands the box in all 3 directions by the given amount.

Parameters:
_fAmountThe amount by which to expand the box.
LSVOID LSE_CALL lsp::CAabb::GetBox ( CVector3  _vPoints[8]) const

Fill an array of 8 vectors with the vertices of the bounding box represented by this object.

Parameters:
_vPointsAn array of at least 8 vectors to be filled with the points at the corners of this bounding box.
CVector3 LSE_CALL lsp::CAabb::GetCenter ( ) const

Gets the center of the bounding box.

Returns:
Returns a point marking the center of this bounding box.
CVector3 LSE_CALL lsp::CAabb::GetCorner ( LSUINT32  _ui32Mask) const

Returns a point of an AABB by a special bit mask.

Parameters:
_ui32MaskThe bit mask.
Returns:
Returns the point determined by the special bit mask.
LSE_INLINE LSREAL LSE_CALL lsp::CAabb::GetSizeX ( ) const

Gets its X size.

Returns:
Returns the length of this bounding box along the X axis.
LSE_INLINE LSREAL LSE_CALL lsp::CAabb::GetSizeY ( ) const

Gets its Y size.

Returns:
Returns the length of this bounding box along the Y axis.
LSE_INLINE LSREAL LSE_CALL lsp::CAabb::GetSizeZ ( ) const

Gets its Z size.

Returns:
Returns the length of this bounding box along the Z axis.
LSREAL LSE_CALL lsp::CAabb::GetSqDistFromPoint ( const CVector3 &  _vPoint) const

Gets the distance from the given point to this AABB.

Parameters:
_vPointThe point from which the distance to this bounding box is to be calculated.
Returns:
Returns the squared distance from the closest point on this box to the given point to the given point.
LSE_INLINE LSREAL LSE_CALL lsp::CAabb::GetVolume ( ) const

Gets its volume.

Returns:
Returns the volume of this bounding box.
LSVOID LSE_CALL lsp::CAabb::MakeInfinitelySmall ( )

Make the box infinitely small.


Member Data Documentation

The maximum X-, Y-, and Z- axis values.

The minimum X-, Y-, and Z- axis values.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator