UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::OBB< 3, T > Struct Template Reference

Public Types

using value_type = T
 

Public Member Functions

constexpr OBB () noexcept=default
 Default constructor.
 
constexpr OBB (OBB const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr OBB (OBB< 3, U > const &other) noexcept
 Converting constructor from an OBB with a different scalar type.
 
constexpr OBB (Vec< 3, T > const &center, Vec< 3, T > const &half_length) noexcept
 Constructs an OBB from center and half-lengths with identity rotation.
 
constexpr OBB (Vec< 3, T > const &center, Vec< 3, T > const &half_length, Mat< 3, 3, T > const &rotation) noexcept
 Constructs an OBB from center, half-lengths, and rotation matrix.
 
constexpr OBB (Vec< 3, T > const &center, Vec< 3, T > const &half_length, Quat< T > const &rotation) noexcept
 Constructs an OBB from center, half-lengths, and quaternion rotation.
 
constexpr OBB (Vec< 3, T > const &start, Vec< 3, T > const &end, Vec< 2, T > const &half_length, Vec< 3, T > const &up=Vec< 3, T >(T(0), T(0), T(1)))
 Constructs an OBB from a line segment, half-thicknesses, and an up vector.
 
constexpr AABB< 3, T > aabb () const noexcept
 Returns the AABB of the OBB.
 
constexpr Vec< 3, T > const & center () const noexcept
 Returns the center of the OBB.
 
constexpr Vec< 3, T > & center () noexcept
 Returns the center of the OBB.
 
constexpr T diagonal () const noexcept
 Returns the diagonal length of the OBB.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the OBB is degenerate.
 
bool operator== (OBB const &) const =default
 Equality operator.
 
constexpr Vec< 3, T > rotatedHalfLength () const
 Returns the rotated half-length vector.
 
void setRotation (Quat< T > const &rotation)
 Sets the rotation of the OBB from a quaternion.
 
constexpr T volume () const noexcept
 Returns the volume of the OBB.
 

Static Public Member Functions

static constexpr std::size_t dimension () noexcept
 Returns the dimensionality of the OBB.
 

Public Attributes

Vec< 3, T > center_
 The center of the OBB.
 
Vec< 3, T > half_length
 The half-lengths of the OBB along its local axes.
 
Mat< 3, 3, T > rotation
 The rotation matrix of the OBB.
 

Detailed Description

template<std::floating_point T>
struct ufo::OBB< 3, T >

Definition at line 267 of file obb.hpp.

Member Typedef Documentation

◆ value_type

template<std::floating_point T>
using ufo::OBB< 3, T >::value_type = T

Definition at line 268 of file obb.hpp.

Constructor & Destructor Documentation

◆ OBB() [1/5]

template<std::floating_point T>
constexpr ufo::OBB< 3, T >::OBB ( Vec< 3, T > const &  start,
Vec< 3, T > const &  end,
Vec< 2, T > const &  half_length,
Vec< 3, T > const &  up = Vec<3, T>(T(0), T(0), T(1)) 
)
inlineconstexpr

Constructs an OBB from a line segment, half-thicknesses, and an up vector.

Definition at line 293 of file obb.hpp.

◆ OBB() [2/5]

template<std::floating_point T>
constexpr ufo::OBB< 3, T >::OBB ( Vec< 3, T > const &  center,
Vec< 3, T > const &  half_length 
)
inlineconstexprnoexcept

Constructs an OBB from center and half-lengths with identity rotation.

Definition at line 321 of file obb.hpp.

◆ OBB() [3/5]

template<std::floating_point T>
constexpr ufo::OBB< 3, T >::OBB ( Vec< 3, T > const &  center,
Vec< 3, T > const &  half_length,
Mat< 3, 3, T > const &  rotation 
)
inlineconstexprnoexcept

Constructs an OBB from center, half-lengths, and rotation matrix.

Definition at line 329 of file obb.hpp.

◆ OBB() [4/5]

template<std::floating_point T>
constexpr ufo::OBB< 3, T >::OBB ( Vec< 3, T > const &  center,
Vec< 3, T > const &  half_length,
Quat< T > const &  rotation 
)
inlineconstexprnoexcept

Constructs an OBB from center, half-lengths, and quaternion rotation.

Definition at line 338 of file obb.hpp.

◆ OBB() [5/5]

template<std::floating_point T>
template<std::convertible_to< T > U>
constexpr ufo::OBB< 3, T >::OBB ( OBB< 3, U > const &  other)
inlineexplicitconstexprnoexcept

Converting constructor from an OBB with a different scalar type.

Definition at line 353 of file obb.hpp.

Member Function Documentation

◆ aabb()

template<std::floating_point T>
constexpr AABB< 3, T > ufo::OBB< 3, T >::aabb ( ) const
inlineconstexprnoexcept

Returns the AABB of the OBB.

Returns
The AABB.

Definition at line 395 of file obb.hpp.

◆ center() [1/2]

template<std::floating_point T>
constexpr Vec< 3, T > const & ufo::OBB< 3, T >::center ( ) const
inlineconstexprnoexcept

Returns the center of the OBB.

Returns
The center.

Definition at line 370 of file obb.hpp.

◆ center() [2/2]

template<std::floating_point T>
constexpr Vec< 3, T > & ufo::OBB< 3, T >::center ( )
inlineconstexprnoexcept

Returns the center of the OBB.

Returns
The center.

Definition at line 364 of file obb.hpp.

◆ diagonal()

template<std::floating_point T>
constexpr T ufo::OBB< 3, T >::diagonal ( ) const
inlineconstexprnoexcept

Returns the diagonal length of the OBB.

Definition at line 381 of file obb.hpp.

◆ dimension()

template<std::floating_point T>
static constexpr std::size_t ufo::OBB< 3, T >::dimension ( )
inlinestaticconstexprnoexcept

Returns the dimensionality of the OBB.

Returns
The dimensionality.

Definition at line 376 of file obb.hpp.

◆ isDegenerate()

template<std::floating_point T>
constexpr bool ufo::OBB< 3, T >::isDegenerate ( ) const
inlineconstexprnoexcept

Returns whether the OBB is degenerate.

Definition at line 409 of file obb.hpp.

◆ rotatedHalfLength()

template<std::floating_point T>
constexpr Vec< 3, T > ufo::OBB< 3, T >::rotatedHalfLength ( ) const
inlineconstexpr

Returns the rotated half-length vector.

Definition at line 417 of file obb.hpp.

◆ setRotation()

template<std::floating_point T>
void ufo::OBB< 3, T >::setRotation ( Quat< T > const &  rotation)
inline

Sets the rotation of the OBB from a quaternion.

Definition at line 425 of file obb.hpp.

◆ volume()

template<std::floating_point T>
constexpr T ufo::OBB< 3, T >::volume ( ) const
inlineconstexprnoexcept

Returns the volume of the OBB.

Definition at line 386 of file obb.hpp.

Member Data Documentation

◆ center_

template<std::floating_point T>
Vec<3, T> ufo::OBB< 3, T >::center_

The center of the OBB.

Definition at line 273 of file obb.hpp.

◆ half_length

template<std::floating_point T>
Vec<3, T> ufo::OBB< 3, T >::half_length

The half-lengths of the OBB along its local axes.

Definition at line 278 of file obb.hpp.

◆ rotation

template<std::floating_point T>
Mat<3, 3, T> ufo::OBB< 3, T >::rotation

The rotation matrix of the OBB.

Definition at line 283 of file obb.hpp.


The documentation for this struct was generated from the following file: