UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::OBB< 2, 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< 2, U > const &other) noexcept
 Converting constructor from an OBB with a different scalar type.
 
constexpr OBB (Vec< 2, T > const &center, Vec< 2, T > const &half_length) noexcept
 Constructs an OBB from center and half-lengths with identity rotation.
 
constexpr OBB (Vec< 2, T > const &center, Vec< 2, T > const &half_length, Mat< 2, 2, T > const &rotation) noexcept
 Constructs an OBB from center, half-lengths, and rotation.
 
constexpr OBB (Vec< 2, T > const &start, Vec< 2, T > const &end, T const &half_length)
 Constructs an OBB from a line segment and a half-thickness.
 
constexpr OBB (Vec< 2, T > const &start, Vec< 2, T > const &end, Vec< 1, T > const &half_length)
 Constructs an OBB from a line segment and a half-thickness.
 
constexpr AABB< 2, T > aabb () const noexcept
 Returns the AABB of the OBB.
 
constexpr Vec< 2, T > const & center () const noexcept
 Returns the center of the OBB.
 
constexpr Vec< 2, T > & center () noexcept
 Returns the center of the OBB.
 
constexpr T diagonal () const noexcept
 Returns the distance from the center to a corner.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the OBB is degenerate.
 
bool operator== (OBB const &) const =default
 Equality operator.
 
constexpr Vec< 2, T > rotatedHalfLength () const
 Returns the rotated half-length vector.
 
void setRotation (T angle)
 Sets the rotation of the OBB.
 
constexpr T volume () const noexcept
 Returns the area of the OBB.
 

Static Public Member Functions

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

Public Attributes

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

Detailed Description

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

Definition at line 70 of file obb.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 71 of file obb.hpp.

Constructor & Destructor Documentation

◆ OBB() [1/5]

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

Constructs an OBB from a line segment and a half-thickness.

Parameters
[in]startThe start of the segment.
[in]endThe end of the segment.
[in]half_lengthThe half-thickness (1D vector).

Definition at line 100 of file obb.hpp.

◆ OBB() [2/5]

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

Constructs an OBB from a line segment and a half-thickness.

Parameters
[in]startThe start of the segment.
[in]endThe end of the segment.
[in]half_lengthThe half-thickness (scalar).

Definition at line 125 of file obb.hpp.

◆ OBB() [3/5]

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

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

Parameters
[in]centerThe center.
[in]half_lengthThe half-lengths.

Definition at line 136 of file obb.hpp.

◆ OBB() [4/5]

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

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

Parameters
[in]centerThe center.
[in]half_lengthThe half-lengths.
[in]rotationThe rotation matrix.

Definition at line 148 of file obb.hpp.

◆ OBB() [5/5]

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

Converting constructor from an OBB with a different scalar type.

Template Parameters
UThe scalar type of the other OBB.
Parameters
[in]otherThe other OBB.

Definition at line 166 of file obb.hpp.

Member Function Documentation

◆ aabb()

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

Returns the AABB of the OBB.

Returns
The AABB.

Definition at line 202 of file obb.hpp.

◆ center() [1/2]

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

Returns the center of the OBB.

Returns
The center.

Definition at line 183 of file obb.hpp.

◆ center() [2/2]

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

Returns the center of the OBB.

Returns
The center.

Definition at line 177 of file obb.hpp.

◆ diagonal()

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

Returns the distance from the center to a corner.

Returns
The diagonal length.

Definition at line 196 of file obb.hpp.

◆ dimension()

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

Returns the dimensionality of the OBB.

Returns
The dimensionality.

Definition at line 189 of file obb.hpp.

◆ isDegenerate()

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

Returns whether the OBB is degenerate.

Definition at line 215 of file obb.hpp.

◆ rotatedHalfLength()

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

Returns the rotated half-length vector.

Definition at line 233 of file obb.hpp.

◆ setRotation()

template<std::floating_point T>
void ufo::OBB< 2, T >::setRotation ( angle)
inline

Sets the rotation of the OBB.

Parameters
[in]angleThe rotation angle in radians.

Definition at line 243 of file obb.hpp.

◆ volume()

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

Returns the area of the OBB.

Returns
The area.

Definition at line 225 of file obb.hpp.

Member Data Documentation

◆ center_

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

The center of the OBB.

Definition at line 76 of file obb.hpp.

◆ half_length

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

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

Definition at line 81 of file obb.hpp.

◆ rotation

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

The rotation matrix of the OBB.

Definition at line 86 of file obb.hpp.


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