AABB Class Reference

List of all members.

Public Methods

__forceinline AABB ()
 Constructor.

__forceinline ~AABB ()
 Destructor.

void SetMinMax (const Point &min, const Point &max)
void SetCenterExtents (const Point &c, const Point &e)
void SetEmpty ()
void SetPoint (const Point &pt)
float GetSize () const
void Extend (const Point &p)
__forceinline void GetMin (Point &min) const
 Get min point of the box.

__forceinline void GetMax (Point &max) const
 Get max point of the box.

__forceinline float GetMin (udword axis) const
 Get component of the box's min point along a given axis.

__forceinline float GetMax (udword axis) const
 Get component of the box's max point along a given axis.

__forceinline void GetCenter (Point &center) const
 Get box center.

__forceinline void GetExtents (Point &extents) const
 Get box extents.

__forceinline float GetCenter (udword axis) const
 Get component of the box's center along a given axis.

__forceinline float GetExtents (udword axis) const
 Get component of the box's extents along a given axis.

__forceinline void GetDiagonal (Point &diagonal) const
 Get box diagonal.

__forceinline float GetVolume () const
 Volume.

__forceinline bool Intersect (const AABB &a) const
__forceinline bool Intersect (const AABB &a, udword axis) const
__forceinline void Rotate (const Matrix4x4 &mtx, AABB &aabb) const
__forceinline bool IsValid () const
__forceinline AABB & operator *= (float s)
 Operator for AABB *= float. Scales the extents, keeps same center.

__forceinline AABB & operator/= (float s)
 Operator for AABB /= float. Scales the extents, keeps same center.

__forceinline AABB & operator+= (const Point &trans)
 Operator for AABB += Point. Translates the box.


Public Attributes

 AABB_COMMON_METHODS
 Type-independent methods.


Detailed Description

AABB class.
Author:
Pierre Terdiman
Version:
1.0


Member Function Documentation

void AABB::Extend const Point   p [inline]
 

Extends the AABB.

Parameters:
p  [in] the nex point

float AABB::GetSize   const [inline]
 

Gets the size of the AABB. The size is defined as the longest extent.

Returns:
the size of the AABB

__forceinline bool AABB::Intersect const AABB &    a,
udword    axis
const [inline]
 

Computes the 1D-intersection between two AABBs, on a given axis.

Parameters:
a  [in] the other AABB
axis  [in] the axis (0, 1, 2)
Returns:
true on intersection

__forceinline bool AABB::Intersect const AABB &    a const [inline]
 

Computes the intersection between two AABBs.

Parameters:
a  [in] the other AABB
Returns:
true on intersection

__forceinline bool AABB::IsValid   const [inline]
 

Checks the AABB is valid.

Returns:
true if the box is valid

__forceinline void AABB::Rotate const Matrix4x4   mtx,
AABB &    aabb
const [inline]
 

Recomputes the AABB after an arbitrary transform by a 4x4 matrix. Original code by Charles Bloom on the GD-Algorithm list. (I slightly modified it)

Parameters:
mtx  [in] the transform matrix
aabb  [out] the transformed AABB [can be *this]

void AABB::SetCenterExtents const Point   c,
const Point   e
[inline]
 

Setups an AABB from center & extents vectors.

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

void AABB::SetEmpty   [inline]
 

Setups an empty AABB.

void AABB::SetMinMax const Point   min,
const Point   max
[inline]
 

Setups an AABB from min & max vectors.

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

void AABB::SetPoint const Point   pt [inline]
 

Setups a point AABB.


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


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen