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

lsp::CAabb2d Class Reference

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

#include <LSPAabb2d.h>

List of all members.

Public Member Functions

LSVOID LSE_CALL MakeInfinitelySmall ()
LSVOID LSE_CALL ComputeAabbFromPointArray (const CVector2 *_pvPoints, LSUINT32 _uiTotal)
LSVOID LSE_CALL ComputeAabbFromAabbAndMatrix (const CAabb2d &_aabb2Other, const CMatrix4x4 &_mTrans)
LSVOID LSE_CALL Encompass (const CAabb2d &_aabb2Other)
LSVOID LSE_CALL Encompass (const CVector2 &_vOther)
LSVOID LSE_CALL GetBox (CVector2 _vPoints[4]) const
CVector2 LSE_CALL GetCenter () const
LSREAL LSE_CALL GetSizeX () const
LSREAL LSE_CALL GetSizeY () const
LSREAL LSE_CALL GetArea () const
CVector2 LSE_CALL ClosestPointToPoint (const CVector2 &_vPoint) const
LSREAL LSE_CALL GetSqDistFromPoint (const CVector2 &_vPoint) const

Public Attributes

CVector2 m_vMin
CVector2 m_vMax

Detailed Description

A min-max axis-aligned 2D bounding box.

Class CAabb2d Description: A min-max axis-aligned 2D bounding box.


Member Function Documentation

CVector2 LSE_CALL lsp::CAabb2d::ClosestPointToPoint ( const CVector2 &  _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::CAabb2d::ComputeAabbFromAabbAndMatrix ( const CAabb2d _aabb2Other,
const CMatrix4x4 &  _mTrans 
)

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

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

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

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

Change the size of the AABB to encompass another AABB.

Parameters:
_aabb2OtherThe bounding box to fully encompass by this bounding box.
LSVOID LSE_CALL lsp::CAabb2d::Encompass ( const CVector2 &  _vOther)

Change the size of the AABB to encompass a point.

Parameters:
_vOtherThe point to fully encompass by this bounding box.
LSREAL LSE_CALL lsp::CAabb2d::GetArea ( ) const

Gets its area.

Returns:
Returns the area of this bounding box.
LSVOID LSE_CALL lsp::CAabb2d::GetBox ( CVector2  _vPoints[4]) const

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

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

Gets the center of the bounding box.

Returns:
Returns a point marking the center of this bounding box.
LSE_INLINE LSREAL LSE_CALL lsp::CAabb2d::GetSizeX ( ) const

Gets its X size.

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

Gets its Y size.

Returns:
Returns the length of this bounding box along the Y axis.
LSREAL LSE_CALL lsp::CAabb2d::GetSqDistFromPoint ( const CVector2 &  _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.
LSVOID LSE_CALL lsp::CAabb2d::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