PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureAxisAlignedBoundingBox Class Reference

AABB: Axis-Aligned Bounding Box class. More...

Detailed Description

#include <PureAxisAlignedBoundingBox.h>

Public Member Functions

 PureAxisAlignedBoundingBox ()
 
 PureAxisAlignedBoundingBox (const PureVector &pos_, const PureVector &size_)
 
virtual ~PureAxisAlignedBoundingBox ()
 
const PureVectorgetPosVec () const
 Gets the world-space position which is the center of the bounding box.
 
const PureVectorgetSizeVec () const
 Gets the base sizes.
 
TPureBool isInside (const PureVector &p) const
 Is the given point inside the bounding box?
 
TPureBool isInside (const PureAxisAlignedBoundingBox &aabb) const
 Is the given box inside the bounding box?
 
void ExtendBy (const PureVector &p)
 Extends the size of the bounding box so the given point will be inside the box.
 
void ExtendBy (const PureAxisAlignedBoundingBox &aabb)
 Extends the size of the bounding box so the given box will be inside the box.
 

Private Attributes

PureVector pos
 
PureVector size
 

Constructor & Destructor Documentation

◆ PureAxisAlignedBoundingBox() [1/2]

PureAxisAlignedBoundingBox::PureAxisAlignedBoundingBox ( )

Definition at line 24 of file PureAxisAlignedBoundingBox.cpp.

◆ PureAxisAlignedBoundingBox() [2/2]

PureAxisAlignedBoundingBox::PureAxisAlignedBoundingBox ( const PureVector & pos_,
const PureVector & size_ )

Definition at line 30 of file PureAxisAlignedBoundingBox.cpp.

◆ ~PureAxisAlignedBoundingBox()

PureAxisAlignedBoundingBox::~PureAxisAlignedBoundingBox ( )
virtual

Definition at line 38 of file PureAxisAlignedBoundingBox.cpp.

Member Function Documentation

◆ ExtendBy() [1/2]

void PureAxisAlignedBoundingBox::ExtendBy ( const PureAxisAlignedBoundingBox & aabb)

Extends the size of the bounding box so the given box will be inside the box.

The position of the bounding box is also expected to change after the extend. If this is a 0-sized (uninitialized) box, its position and size will be set to the position and size of the given box (copy).

Parameters
aabbThe box to be included.

Definition at line 149 of file PureAxisAlignedBoundingBox.cpp.

◆ ExtendBy() [2/2]

void PureAxisAlignedBoundingBox::ExtendBy ( const PureVector & p)

Extends the size of the bounding box so the given point will be inside the box.

The position of the bounding box is also expected to change after the extend. If this is a 0-sized (uninitialized) box, nothing will happen.

Parameters
pThe point to be included. Coordinates are expected in world-space.

Definition at line 107 of file PureAxisAlignedBoundingBox.cpp.

◆ getPosVec()

const PureVector & PureAxisAlignedBoundingBox::getPosVec ( ) const

Gets the world-space position which is the center of the bounding box.

Returns
The center of the bounding box in world-space.

Definition at line 48 of file PureAxisAlignedBoundingBox.cpp.

◆ getSizeVec()

const PureVector & PureAxisAlignedBoundingBox::getSizeVec ( ) const

Gets the base sizes.

Returns
Size of the bounding box.

Definition at line 58 of file PureAxisAlignedBoundingBox.cpp.

◆ isInside() [1/2]

TPureBool PureAxisAlignedBoundingBox::isInside ( const PureAxisAlignedBoundingBox & aabb) const

Is the given box inside the bounding box?

Parameters
aabbThe box to be tested.
Returns
True if the given box is fully inside the bounding box, false otherwise. Partial contain also results false.

Definition at line 84 of file PureAxisAlignedBoundingBox.cpp.

◆ isInside() [2/2]

TPureBool PureAxisAlignedBoundingBox::isInside ( const PureVector & p) const

Is the given point inside the bounding box?

Parameters
pThe point to be tested. Coordinates are expected in world-space.
Returns
True if the given point is inside the bounding box, false otherwise.

Definition at line 69 of file PureAxisAlignedBoundingBox.cpp.

Member Data Documentation

◆ pos

PureVector PureAxisAlignedBoundingBox::pos
private

Definition at line 58 of file PureAxisAlignedBoundingBox.h.

◆ size

PureVector PureAxisAlignedBoundingBox::size
private

Definition at line 59 of file PureAxisAlignedBoundingBox.h.


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