146 return m_min.
GetX() > m_max.
GetX() ||
178 return (m_min + m_max) * 0.5;
187 return m_max - m_min;
213 return 2.0 * (size.
GetX() * size.
GetY() +
225 return point.
GetX() >= m_min.
GetX() - tolerance &&
226 point.
GetX() <= m_max.
GetX() + tolerance &&
227 point.
GetY() >= m_min.
GetY() - tolerance &&
228 point.
GetY() <= m_max.
GetY() + tolerance &&
229 point.
GetZ() >= m_min.
GetZ() - tolerance &&
230 point.
GetZ() <= m_max.
GetZ() + tolerance;
240 return m_min.
GetX() <= other.m_max.
GetX() &&
241 m_max.
GetX() >= other.m_min.
GetX() &&
242 m_min.
GetY() <= other.m_max.
GetY() &&
243 m_max.
GetY() >= other.m_min.
GetY() &&
244 m_min.
GetZ() <= other.m_max.
GetZ() &&
286 return m_min == box.m_min && m_max == box.m_max;
292 return !(*
this == box);
Definition of an axis-aligned bounding box (AABB) in 3D space.
CBox3d()
Default constructor.
void Include(const CVector3d &point)
Expand box to include point.
void Reset()
Reset box to empty state.
const CVector3d & GetMax() const
Get maximum corner of the box.
CVector3d GetCenter() const
Get center of the box.
void SetMax(const CVector3d &max)
Set maximum corner of the box.
bool IsEmpty() const
Returns true if the box is in invalid/empty state.
bool Serialize(iser::IArchive &archive)
Serialize this box to specified archive.
CVector3d GetExtent() const
Get extent (half-size) of the box.
CVector3d GetClosestPoint(const CVector3d &point) const
Get closest point on or inside box to given point.
const CVector3d & GetMin() const
Get minimum corner of the box.
double GetSurfaceArea() const
Calculate surface area of the box.
double GetVolume() const
Calculate volume of the box.
bool Intersects(const CBox3d &other) const
Check if this box intersects another box.
CVector3d GetSize() const
Get size (dimensions) of the box.
bool operator==(const CBox3d &box) const
bool Contains(const CVector3d &point, double tolerance=0.0) const
Check if point is inside the box.
bool operator!=(const CBox3d &box) const
void SetMin(const CVector3d &min)
Set minimum corner of the box.
Represents a position or mathematical vector in 3D space with double precision.
void SetZ(double value)
Sets the Z coordinate of the vector.
double GetX() const
Gets the X coordinate of the vector.
void SetX(double value)
Sets the X coordinate of the vector.
double GetY() const
Gets the Y coordinate of the vector.
double GetZ() const
Gets the Z coordinate of the vector.
void SetY(double value)
Sets the Y coordinate of the vector.
Represents an input/output persistence archive for object serialization.