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

Capsule in Dim-dimensional space. More...

#include <lib/geometry/include/ufo/geometry/capsule.hpp>

Public Types

using value_type = T
 

Public Member Functions

constexpr Capsule () noexcept=default
 Default constructor.
 
constexpr Capsule (Capsule const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr Capsule (Capsule< Dim, U > const &other) noexcept
 Converting constructor from a capsule with a different scalar type.
 
constexpr Capsule (Vec< Dim, T > const &start, Vec< Dim, T > const &end, T radius) noexcept
 Constructs a capsule from two points and a radius.
 
constexpr AABB< Dim, T > aabb () const noexcept
 Returns the AABB of the capsule.
 
constexpr Vec< Dim, T > center () const noexcept
 Returns the center of the capsule.
 
constexpr T diameter () const noexcept
 Returns the diameter of the capsule.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the capsule is degenerate.
 
constexpr T length () const noexcept
 Returns the length of the segment between start and end.
 
bool operator== (Capsule const &) const =default
 Equality operator.
 
constexpr T volume () const noexcept
 Returns the volume (or area/length) of the capsule.
 

Static Public Member Functions

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

Public Attributes

Vec< Dim, T > end
 The end point of the capsule segment.
 
radius {}
 The radius of the capsule.
 
Vec< Dim, T > start
 The start point of the capsule segment.
 

Detailed Description

template<std::size_t Dim = 3, std::floating_point T = float>
struct ufo::Capsule< Dim, T >

Capsule in Dim-dimensional space.

Template Parameters
DimThe dimensionality of the space (default: 3).
TThe numeric type (default: float), must be a floating-point type.

Represents a capsule defined by a line segment between two points and a radius.

Definition at line 67 of file capsule.hpp.

Member Typedef Documentation

◆ value_type

template<std::size_t Dim = 3, std::floating_point T = float>
using ufo::Capsule< Dim, T >::value_type = T

Definition at line 68 of file capsule.hpp.

Constructor & Destructor Documentation

◆ Capsule() [1/2]

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr ufo::Capsule< Dim, T >::Capsule ( Vec< Dim, T > const &  start,
Vec< Dim, T > const &  end,
radius 
)
inlineconstexprnoexcept

Constructs a capsule from two points and a radius.

Parameters
[in]startThe start point of the segment.
[in]endThe end point of the segment.
[in]radiusThe radius of the capsule.

Definition at line 96 of file capsule.hpp.

◆ Capsule() [2/2]

template<std::size_t Dim = 3, std::floating_point T = float>
template<std::convertible_to< T > U>
constexpr ufo::Capsule< Dim, T >::Capsule ( Capsule< Dim, U > const &  other)
inlineexplicitconstexprnoexcept

Converting constructor from a capsule with a different scalar type.

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

Definition at line 112 of file capsule.hpp.

Member Function Documentation

◆ aabb()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr AABB< Dim, T > ufo::Capsule< Dim, T >::aabb ( ) const
inlineconstexprnoexcept

Returns the AABB of the capsule.

Returns
The AABB.

Definition at line 144 of file capsule.hpp.

◆ center()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr Vec< Dim, T > ufo::Capsule< Dim, T >::center ( ) const
inlineconstexprnoexcept

Returns the center of the capsule.

Returns
The center.

Definition at line 129 of file capsule.hpp.

◆ diameter()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr T ufo::Capsule< Dim, T >::diameter ( ) const
inlineconstexprnoexcept

Returns the diameter of the capsule.

Returns
The diameter.

Definition at line 159 of file capsule.hpp.

◆ dimension()

template<std::size_t Dim = 3, std::floating_point T = float>
static constexpr std::size_t ufo::Capsule< Dim, T >::dimension ( )
inlinestaticconstexprnoexcept

Returns the dimensionality of the capsule.

Returns
The dimensionality.

Definition at line 123 of file capsule.hpp.

◆ isDegenerate()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr bool ufo::Capsule< Dim, T >::isDegenerate ( ) const
inlineconstexprnoexcept

Returns whether the capsule is degenerate.

Returns
true if degenerate, false otherwise.

Definition at line 153 of file capsule.hpp.

◆ length()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr T ufo::Capsule< Dim, T >::length ( ) const
inlineconstexprnoexcept

Returns the length of the segment between start and end.

Returns
The length of the segment.

Definition at line 138 of file capsule.hpp.

◆ volume()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr T ufo::Capsule< Dim, T >::volume ( ) const
inlineconstexprnoexcept

Returns the volume (or area/length) of the capsule.

Returns
The volume.

Definition at line 165 of file capsule.hpp.

Member Data Documentation

◆ end

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Capsule< Dim, T >::end

The end point of the capsule segment.

Definition at line 78 of file capsule.hpp.

◆ radius

template<std::size_t Dim = 3, std::floating_point T = float>
T ufo::Capsule< Dim, T >::radius {}

The radius of the capsule.

Definition at line 83 of file capsule.hpp.

◆ start

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Capsule< Dim, T >::start

The start point of the capsule segment.

Definition at line 73 of file capsule.hpp.


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