Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::OBB< Scalar, PointType, QuaternionType, HalfExtentsType > Class Template Reference

Oriented Bounding Box: a center, a unit-quaternion orientation, and per-axis half-extents. More...

#include <OBB.hpp>

Inheritance diagram for mundy::OBB< Scalar, PointType, QuaternionType, HalfExtentsType >:
[legend]

Public Member Functions

Constructors and destructor
constexpr OBB ()
 Default constructor. Center and half-extents are zero-initialized; orientation is the identity quaternion; half-extents are set to the invalid sentinel -1.
constexpr OBB (const point_t &center, const value_type &half_extent)
 Construct from a center, identity orientation, and uniform half-extent.
constexpr OBB (const point_t &center, const orientation_t &orientation, const half_extents_t &half_extents)
 Construct from a center, orientation, and per-axis half-extents.
constexpr OBB (const point_t &center, const orientation_t &orientation, const value_type &hx, const value_type &hy, const value_type &hz)
 Construct from a center, orientation, and per-axis half-extents given as scalars.
constexpr ~OBB ()=default
 Destructor.
constexpr OBB (const OBB &other)
 Copy constructor.
constexpr OBB (OBB &&other)
 Move constructor.
template<typename OtherOBBType>
constexpr OBB (const OtherOBBType &other)
 Deep copy constructor from a different OBB type (e.g. a view-backed OBB).
template<typename OtherOBBType>
constexpr OBB (OtherOBBType &&other)
 Deep move constructor from a different OBB type (e.g. a view-backed OBB).
Assignment operators
constexpr OBB & operator= (const OBB &other)
constexpr OBB & operator= (OBB &&other)
template<typename OtherOBBType>
constexpr OBB & operator= (const OtherOBBType &other)
 Copy assignment from a different OBB type (e.g. a view-backed OBB).
template<typename OtherOBBType>
constexpr OBB & operator= (OtherOBBType &&other)
 Move assignment from a different OBB type (e.g. a view-backed OBB).
Accessors
constexpr const point_t & center () const
constexpr point_t & center ()
constexpr const orientation_t & orientation () const
constexpr orientation_t & orientation ()
constexpr const half_extents_t & half_extents () const
constexpr half_extents_t & half_extents ()
constexpr const value_type & half_extent (int i) const
constexpr value_type & half_extent (int i)
constexpr deep_copy_t copy () const
 Get a deep, owning copy of the OBB.

Type aliases

using value_type = Scalar
using point_t = PointType
using orientation_t = QuaternionType
using half_extents_t = HalfExtentsType
using deep_copy_t = OBB<Scalar>
static constexpr bool is_finite = true

Setters

template<typename, ValidPointType, ValidQuaternionType, ValidVector3Type>
class OBB
template<ValidPointType OtherPointType>
constexpr void set_center (const OtherPointType &c)
template<ValidQuaternionType OtherQuatType>
constexpr void set_orientation (const OtherQuatType &q)
template<ValidVector3Type OtherVecType>
constexpr void set_half_extents (const OtherVecType &he)
constexpr void set_half_extents (const value_type &hx, const value_type &hy, const value_type &hz)

Detailed Description

template<typename Scalar, ValidPointType PointType = Point<Scalar>, ValidQuaternionType QuaternionType = Quaternion<Scalar>, ValidVector3Type HalfExtentsType = Vector3<Scalar>>
class mundy::OBB< Scalar, PointType, QuaternionType, HalfExtentsType >
Template Parameters
ScalarFloating-point scalar type.
PointTypePoint type for the center; defaults to Point<Scalar>.
QuaternionTypeQuaternion type for the orientation; defaults to Quaternion<Scalar>.
HalfExtentsTypeVector3 type for the half-extents; defaults to Vector3<Scalar>. A view variant (e.g. a Vector3 aliasing external storage) may be substituted here to enable view-backed OBB components.