molecular
Classes | Public Member Functions | Static Public Attributes | List of all members
molecular::util::AxisAlignedBox Class Reference

Axis aligned (bounding) box (AABB) More...

#include <AxisAlignedBox.h>

Classes

struct  LineIntersectionResult
 

Public Member Functions

 AxisAlignedBox ()
 Construct infinite box. More...
 
 AxisAlignedBox (const Vector3 &min, const Vector3 &max)
 
 AxisAlignedBox (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 
bool Contains (const Vector3 &point) const
 
double Volume () const
 Calculates volume of this box. More...
 
bool Encloses (const AxisAlignedBox &box) const
 Returns true if the second box is fully contained inside this box. More...
 
bool Overlaps (const AxisAlignedBox &box) const
 Returns true if the two boxes intersect. More...
 
double Overlap (const AxisAlignedBox &box) const
 Calculates the volume of the intersection of the two boxes. More...
 
Vector3 Center () const
 
void Stretch (const AxisAlignedBox &box)
 Extends this box so it encloses the other. More...
 
void Stretch (const Vector3 &vec)
 
bool IsNull () const
 
const Vector3GetMin () const
 
const Vector3GetMax () const
 
float GetMin (int i) const
 
float GetMax (int i) const
 
float GetSize (int i) const
 
Vector3 GetSize () const
 
Vector3 GetCenter () const
 
LineIntersectionResult LineIntersection (const Vector3 &lineStart, const Vector3 &lineEnd)
 

Static Public Attributes

static const AxisAlignedBox kDefault = AxisAlignedBox()
 

Detailed Description

Axis aligned (bounding) box (AABB)

Constructor & Destructor Documentation

molecular::util::AxisAlignedBox::AxisAlignedBox ( )
inline

Construct infinite box.

molecular::util::AxisAlignedBox::AxisAlignedBox ( const Vector3 min,
const Vector3 max 
)
inline
molecular::util::AxisAlignedBox::AxisAlignedBox ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)
inline

Member Function Documentation

Vector3 molecular::util::AxisAlignedBox::Center ( ) const
inline
bool molecular::util::AxisAlignedBox::Contains ( const Vector3 point) const
inline
bool molecular::util::AxisAlignedBox::Encloses ( const AxisAlignedBox box) const
inline

Returns true if the second box is fully contained inside this box.

Vector3 molecular::util::AxisAlignedBox::GetCenter ( ) const
inline
const Vector3& molecular::util::AxisAlignedBox::GetMax ( ) const
inline
float molecular::util::AxisAlignedBox::GetMax ( int  i) const
inline
const Vector3& molecular::util::AxisAlignedBox::GetMin ( ) const
inline
float molecular::util::AxisAlignedBox::GetMin ( int  i) const
inline
float molecular::util::AxisAlignedBox::GetSize ( int  i) const
inline
Vector3 molecular::util::AxisAlignedBox::GetSize ( ) const
inline
bool molecular::util::AxisAlignedBox::IsNull ( ) const
inline
AxisAlignedBox::LineIntersectionResult molecular::util::AxisAlignedBox::LineIntersection ( const Vector3 lineStart,
const Vector3 lineEnd 
)
double molecular::util::AxisAlignedBox::Overlap ( const AxisAlignedBox box) const
inline

Calculates the volume of the intersection of the two boxes.

bool molecular::util::AxisAlignedBox::Overlaps ( const AxisAlignedBox box) const
inline

Returns true if the two boxes intersect.

void molecular::util::AxisAlignedBox::Stretch ( const AxisAlignedBox box)
inline

Extends this box so it encloses the other.

void molecular::util::AxisAlignedBox::Stretch ( const Vector3 vec)
inline
double molecular::util::AxisAlignedBox::Volume ( ) const
inline

Calculates volume of this box.

Member Data Documentation

const AxisAlignedBox molecular::util::AxisAlignedBox::kDefault = AxisAlignedBox()
static

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