GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::physics::LineSegment< N > Struct Template Reference

Description of a line segment in world space. More...

#include <GREM/physics/Shape.hpp>

Public Types

using Unit = typename Position<N>::Unit
 Unit type.
using DimensionType = typename Unit::DimensionType
 Unit dimension type.
using MagnitudeType = typename Unit::MagnitudeType
 Unit magnitude type.

Public Member Functions

template<typename OtherUnitT>
requires (OtherUnitT::DIMENSION == LENGTH)
GREM_ALWAYS_INLINE constexpr grem::LineSegment< N, Scalar > in (OtherUnitT unit) const noexcept
 Convert this physical line segment to a unitless line segment given a desired unit.
bool operator== (const LineSegment &other) const =default
 Compare this line segment to another for equality.

Static Public Member Functions

template<typename T>
static GREM_ALWAYS_INLINE constexpr LineSegment reinterpret (const grem::LineSegment< N, T > &line) noexcept
 Reinterpret a unitless line segment as a physical line segment in default units.

Public Attributes

Position< N > pointA
 Position of the first point of the line segment.
Position< N > pointB
 Position of the second point of the line segment.

Static Public Attributes

static constexpr Unit UNIT {}
 Unit.
static constexpr DimensionType DIMENSION {}
 Unit dimension.
static constexpr MagnitudeType MAGNITUDE {}
 Unit magnitude.

Detailed Description

template<size_t N>
struct grem::physics::LineSegment< N >

Description of a line segment in world space.

Template Parameters
Nnumber of dimensions of the world space (must be 2 or 3).

Member Typedef Documentation

◆ Unit

template<size_t N>
using grem::physics::LineSegment< N >::Unit = typename Position<N>::Unit

Unit type.

◆ DimensionType

template<size_t N>
using grem::physics::LineSegment< N >::DimensionType = typename Unit::DimensionType

Unit dimension type.

◆ MagnitudeType

template<size_t N>
using grem::physics::LineSegment< N >::MagnitudeType = typename Unit::MagnitudeType

Unit magnitude type.

Member Function Documentation

◆ reinterpret()

template<size_t N>
template<typename T>
GREM_ALWAYS_INLINE constexpr LineSegment grem::physics::LineSegment< N >::reinterpret ( const grem::LineSegment< N, T > & line)
inlinestaticnodiscardconstexprnoexcept

Reinterpret a unitless line segment as a physical line segment in default units.

Parameters
lineline segment to reinterpret.
Returns
the corresponding physical line segment.

◆ in()

template<size_t N>
template<typename OtherUnitT>
requires (OtherUnitT::DIMENSION == LENGTH)
GREM_ALWAYS_INLINE constexpr grem::LineSegment< N, Scalar > grem::physics::LineSegment< N >::in ( OtherUnitT unit) const
inlinenodiscardconstexprnoexcept

Convert this physical line segment to a unitless line segment given a desired unit.

Parameters
unitunit to get the line segment in.
Returns
the corresponding line segment in the given unit.

◆ operator==()

template<size_t N>
bool grem::physics::LineSegment< N >::operator== ( const LineSegment< N > & other) const
nodiscarddefault

Compare this line segment to another for equality.

Parameters
otherthe line segment to compare this line segment to.
Returns
true if the line segments are equal, false otherwise.

Member Data Documentation

◆ UNIT

template<size_t N>
Unit grem::physics::LineSegment< N >::UNIT {}
staticconstexpr

Unit.

◆ DIMENSION

template<size_t N>
DimensionType grem::physics::LineSegment< N >::DIMENSION {}
staticconstexpr

Unit dimension.

◆ MAGNITUDE

template<size_t N>
MagnitudeType grem::physics::LineSegment< N >::MAGNITUDE {}
staticconstexpr

Unit magnitude.

◆ pointA

template<size_t N>
Position<N> grem::physics::LineSegment< N >::pointA

Position of the first point of the line segment.

◆ pointB

template<size_t N>
Position<N> grem::physics::LineSegment< N >::pointB

Position of the second point of the line segment.


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