Rebel Fork Framework
Urho3D::BoundingBox Class Reference

#include <Urho3D/Math/BoundingBox.h>

Public Member Functions

 BoundingBox () noexcept
 Construct with zero size.
 
 BoundingBox (const BoundingBox &box) noexcept
 Copy-construct from another bounding box.
 
 BoundingBox (const Rect &rect) noexcept
 Construct from a rect, with the Z dimension left zero.
 
 BoundingBox (const Vector3 &min, const Vector3 &max) noexcept
 Construct from minimum and maximum vectors.
 
 BoundingBox (float min, float max) noexcept
 Construct from minimum and maximum floats (all dimensions same).
 
 BoundingBox (const Vector3 *vertices, unsigned count)
 Construct from an array of vertices.
 
 BoundingBox (const Frustum &frustum)
 Construct from a frustum.
 
 BoundingBox (const Polyhedron &poly)
 Construct from a polyhedron.
 
 BoundingBox (const Sphere &sphere)
 Construct from a sphere.
 
BoundingBoxoperator= (const BoundingBox &rhs) noexcept
 Assign from another bounding box.
 
BoundingBoxoperator= (const Rect &rhs) noexcept
 Assign from a Rect, with the Z dimension left zero.
 
bool operator== (const BoundingBox &rhs) const
 Test for equality with another bounding box.
 
bool operator!= (const BoundingBox &rhs) const
 Test for inequality with another bounding box.
 
void Define (const BoundingBox &box)
 Define from another bounding box.
 
void Define (const Rect &rect)
 Define from a Rect.
 
void Define (const Vector3 &min, const Vector3 &max)
 Define from minimum and maximum vectors.
 
void Define (float min, float max)
 Define from minimum and maximum floats (all dimensions same).
 
void Define (const Vector3 &point)
 Define from a point.
 
void Merge (const Vector3 &point)
 Merge a point.
 
void Merge (const BoundingBox &box)
 Merge another bounding box.
 
void Define (const Vector3 *vertices, unsigned count)
 Define from an array of vertices.
 
void Define (const Frustum &frustum)
 Define from a frustum.
 
void Define (const Polyhedron &poly)
 Define from a polyhedron.
 
void Define (const Sphere &sphere)
 Define from a sphere.
 
void Merge (const Vector3 *vertices, unsigned count)
 Merge an array of vertices.
 
void Merge (const Frustum &frustum)
 Merge a frustum.
 
void Merge (const Polyhedron &poly)
 Merge a polyhedron.
 
void Merge (const Sphere &sphere)
 Merge a sphere.
 
void Clip (const BoundingBox &box)
 Clip with another bounding box. The box can become degenerate (undefined) as a result.
 
void Transform (const Matrix3 &transform)
 Transform with a 3x3 matrix.
 
void Transform (const Matrix3x4 &transform)
 Transform with a 3x4 matrix.
 
void Clear ()
 Clear to undefined state.
 
template<class T >
BoundingBox Merged (const T &other) const
 Return this bounding box merged with another shape.
 
BoundingBox Clipped (const BoundingBox &box) const
 Return this bounding box clipped by another box.
 
BoundingBox Padded (const Vector3 &minPadding, const Vector3 &maxPadding) const
 Return this bounding box expanded by given value.
 
BoundingBox Padded (const Vector3 &padding) const
 Return this bounding box expanded by given value, same for min and max.
 
bool Defined () const
 Return true if this bounding box is defined via a previous call to Define() or Merge().
 
Vector3 Center () const
 
Vector3 Size () const
 
Vector3 HalfSize () const
 
float Volume () const
 Return volume.
 
BoundingBox Transformed (const Matrix3 &transform) const
 Return transformed by a 3x3 matrix.
 
BoundingBox Transformed (const Matrix3x4 &transform) const
 Return transformed by a 3x4 matrix.
 
Rect Projected (const Matrix4 &projection) const
 Return projected by a 4x4 projection matrix.
 
float DistanceToPoint (const Vector3 &point) const
 Return distance to point.
 
float SignedDistanceToPoint (const Vector3 &point) const
 Return signed distance to point. Negative if point is inside bounding box.
 
float DistanceToBoundingBox (const BoundingBox &box) const
 Return distance to another bounding box.
 
float SignedDistanceToBoundingBox (const BoundingBox &box) const
 Return signed distance to another bounding box. Negative if inside.
 
Intersection IsInside (const Vector3 &point) const
 Test if a point is inside.
 
Intersection IsInside (const BoundingBox &box) const
 Test if another bounding box is inside, outside or intersects.
 
Intersection IsInsideFast (const BoundingBox &box) const
 Test if another bounding box is (partially) inside or outside.
 
Intersection IsInside (const Sphere &sphere) const
 Test if a sphere is inside, outside or intersects.
 
Intersection IsInsideFast (const Sphere &sphere) const
 Test if a sphere is (partially) inside or outside.
 
ea::string ToString () const
 Return as string.
 

Public Attributes

Vector3 min_
 Minimum vector.
 
float dummyMin_ {}
 
Vector3 max_
 Maximum vector.
 
float dummyMax_ {}
 

Detailed Description

Three-dimensional axis-aligned bounding box.

Member Function Documentation

◆ Center()

Vector3 Urho3D::BoundingBox::Center ( ) const
inline

Return center.

◆ HalfSize()

Vector3 Urho3D::BoundingBox::HalfSize ( ) const
inline

Return half-size.

◆ Size()

Vector3 Urho3D::BoundingBox::Size ( ) const
inline

Return size.


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