|
ACF $AcfVersion:0$
|
Definition of an axis-aligned bounding box (AABB) in 3D space. More...
#include <CBox3d.h>
Public Member Functions | |
| CBox3d () | |
| Default constructor. | |
| CBox3d (const CVector3d &min, const CVector3d &max) | |
| Construct box from minimum and maximum corners. | |
| bool | IsEmpty () const |
| Returns true if the box is in invalid/empty state. | |
| const CVector3d & | GetMin () const |
| Get minimum corner of the box. | |
| void | SetMin (const CVector3d &min) |
| Set minimum corner of the box. | |
| const CVector3d & | GetMax () const |
| Get maximum corner of the box. | |
| void | SetMax (const CVector3d &max) |
| Set maximum corner of the box. | |
| CVector3d | GetCenter () const |
| Get center of the box. | |
| CVector3d | GetSize () const |
| Get size (dimensions) of the box. | |
| CVector3d | GetExtent () const |
| Get extent (half-size) of the box. | |
| double | GetVolume () const |
| Calculate volume of the box. | |
| double | GetSurfaceArea () const |
| Calculate surface area of the box. | |
| bool | Contains (const CVector3d &point, double tolerance=0.0) const |
| Check if point is inside the box. | |
| bool | Intersects (const CBox3d &other) const |
| Check if this box intersects another box. | |
| void | Include (const CVector3d &point) |
| Expand box to include point. | |
| void | Include (const CBox3d &other) |
| Expand box to include another box. | |
| CVector3d | GetClosestPoint (const CVector3d &point) const |
| Get closest point on or inside box to given point. | |
| void | Reset () |
| Reset box to empty state. | |
| bool | Serialize (iser::IArchive &archive) |
| Serialize this box to specified archive. | |
| bool | operator== (const CBox3d &box) const |
| bool | operator!= (const CBox3d &box) const |
Definition of an axis-aligned bounding box (AABB) in 3D space.
Box is stored as minimum and maximum corner points.
|
inline |
|
inline |
Check if point is inside the box.
| point | Point to check. |
| tolerance | Tolerance for boundary check. |
Definition at line 219 of file CBox3d.h.
References i3d::CVector3d::GetX(), i3d::CVector3d::GetY(), i3d::CVector3d::GetZ(), and IsEmpty().
|
inline |
Get closest point on or inside box to given point.
|
inline |
|
inline |
|
inline |
|
inline |
Get size (dimensions) of the box.
Definition at line 182 of file CBox3d.h.
References IsEmpty().
Referenced by GetExtent(), GetSurfaceArea(), and GetVolume().
|
inline |
Calculate surface area of the box.
Definition at line 207 of file CBox3d.h.
References GetSize(), i3d::CVector3d::GetX(), i3d::CVector3d::GetY(), i3d::CVector3d::GetZ(), and IsEmpty().
|
inline |
Calculate volume of the box.
Definition at line 197 of file CBox3d.h.
References GetSize(), i3d::CVector3d::GetX(), i3d::CVector3d::GetY(), i3d::CVector3d::GetZ(), and IsEmpty().
|
inline |
|
inline |
Expand box to include point.
Definition at line 249 of file CBox3d.h.
References i3d::CVector3d::GetX(), i3d::CVector3d::GetY(), i3d::CVector3d::GetZ(), IsEmpty(), i3d::CVector3d::SetX(), i3d::CVector3d::SetY(), and i3d::CVector3d::SetZ().
Referenced by Include().
|
inline |
Check if this box intersects another box.
Definition at line 234 of file CBox3d.h.
References i3d::CVector3d::GetX(), i3d::CVector3d::GetY(), i3d::CVector3d::GetZ(), and IsEmpty().
|
inline |
Returns true if the box is in invalid/empty state.
Definition at line 144 of file CBox3d.h.
References i3d::CVector3d::GetX(), i3d::CVector3d::GetY(), and i3d::CVector3d::GetZ().
Referenced by Contains(), GetSize(), GetSurfaceArea(), GetVolume(), Include(), Include(), and Intersects().
|
inline |
|
inline |
|
inline |
| bool i3d::CBox3d::Serialize | ( | iser::IArchive & | archive | ) |
Serialize this box to specified archive.
|
inline |
|
inline |