Kaim::Box3f Class Reference

Kaim::Box3f Class Reference

#include <box3f.h>

Class Description

This class represents a three-dimensional axis-aligned bounding box whose dimensions are stored using floating-point numbers.

This class is typically used to identify regions of three-dimensional space. For example, this class is used to store the bounding box taken up by some objects such as NavMeshes, NavFloors and NavCells

+ Examples:

Constructors

 Box3f ()
 
 Box3f (const Vec3f &min_, const Vec3f &max_)
 

Main API Functions

bool operator== (const Box3f &other) const
 
bool operator!= (const Box3f &other) const
 
bool IsValid ()
 
void Clear ()
 
void Set (const Vec3f &min_, const Vec3f &max_)
 
KyFloat32 SizeX () const
 
KyFloat32 SizeY () const
 
KyFloat32 SizeZ () const
 
Vec3f Center () const
 
KyFloat32 Radius () const
 
void Translate (const Vec3f &v)
 
void ExpandByVec3 (const Vec3f &pos)
 
void ExpandByBox3 (const Box3f &box)
 
void Enlarge (KyFloat32 enlargement)
 
bool IsPoint3DInside (const Vec3f &p) const
 
bool IsPoint2DInside (const Vec2f &p) const
 

Public Data Members

Vec3f m_min
 
Vec3f m_max
 

Constructor & Destructor Documentation

Kaim::Box3f::Box3f ( )
inline

Creates a new Box3f with invalid extents: you must call Set() before using it.

Kaim::Box3f::Box3f ( const Vec3f min_,
const Vec3f max_ 
)
inline

Creates a new Box3f with the provided extents.

Parameters
min_The minima of the bounding box.
max_The maxima of the bounding box.

Member Function Documentation

Vec3f Kaim::Box3f::Center ( ) const
inline

Retrieves the coordinates of the exact center of the box.

void Kaim::Box3f::Clear ( )
inline

Clears all information maintained by this object.

This method sets the extents of the box to invalid values; you must follow this method with a call to Set() before you can use the box.

void Kaim::Box3f::Enlarge ( KyFloat32  enlargement)
inline

Enlarges the extents of the bounding box by the specified amount in all directions.

void Kaim::Box3f::ExpandByBox3 ( const Box3f box)
inline

Enlarges the extents of the bounding box to include the area covered by the specified bounding box.

If the bounding box already encompasses the area of box, the bounding box is not modified.

void Kaim::Box3f::ExpandByVec3 ( const Vec3f pos)
inline

Enlarges the extents of the bounding box to include the specified three-dimensional point.

If the point is already contained within the bounding box, the box is not modified.

bool Kaim::Box3f::IsPoint2DInside ( const Vec2f p) const
inline

Returns true if the (X,Y) coordinates of the specified position are contained within the (X,Y) extents extents of the bounding box.

bool Kaim::Box3f::IsPoint3DInside ( const Vec3f p) const
inline

Returns true if the specified position is contained within the extents of the bounding box.

KyFloat32 Kaim::Box3f::Radius ( ) const
inline

Retrieves the distance between the diagonally opposite corners of the box.

void Kaim::Box3f::Set ( const Vec3f min_,
const Vec3f max_ 
)
inline

Sets the extents of the bounding box to the specified values.

Parameters
min_The minima of the bounding box.
max_The maxima of the bounding box.
KyFloat32 Kaim::Box3f::SizeX ( ) const
inline

Retrieves the extents of the box along the X axis.

KyFloat32 Kaim::Box3f::SizeY ( ) const
inline

Retrieves the extents of the box along the Y axis.

KyFloat32 Kaim::Box3f::SizeZ ( ) const
inline

Retrieves the extents of the box along the Z axis.

void Kaim::Box3f::Translate ( const Vec3f v)
inline

Moves the bounding box by the specified vector.

Member Data Documentation

Vec3f Kaim::Box3f::m_max

The maxima of the bounding box.

Vec3f Kaim::Box3f::m_min

The minima of the bounding box.


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