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.
Assignment operators
constexpr OBBoperator= (const OBB &other)
constexpr OBBoperator= (OBB &&other)
Accessors
constexpr const point_tcenter () const
constexpr point_tcenter ()
constexpr const orientation_torientation () const
constexpr orientation_torientation ()
constexpr const half_extents_thalf_extents () const
constexpr half_extents_thalf_extents ()
constexpr const value_typehalf_extent (int i) const
constexpr value_typehalf_extent (int i)

Type aliases

using value_type = Scalar
using point_t = PointType
using orientation_t = QuaternionType
using half_extents_t = HalfExtentsType
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. an owning Vector3 aliasing field storage) may be substituted here to enable field-backed OBB components.