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

Generic line segment between two points in N-dimensional space. More...

#include <GREM/core/geometry.hpp>

Public Types

using Component = T
 Scalar coordinate component type.

Public Member Functions

template<typename U>
GREM_ALWAYS_INLINE constexpr operator LineSegment< N, U > () const noexcept
 Convert this line segment to an equivalent line segment of another scalar type.
bool operator== (const LineSegment &other) const =default
 Compare this line segment to another for equality.
constexpr Box< N, T > getBoundingBox () const noexcept
 Get the axis-aligned bounding box of the line segment.

Public Attributes

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

Static Public Attributes

static constexpr size_t RANK = N
 Number of dimensions of the vector space.

Detailed Description

template<size_t N, typename T>
struct grem::LineSegment< N, T >

Generic line segment between two points in N-dimensional space.

Template Parameters
Nnumber of vector dimensions.
Tscalar coordinate component type.

Member Typedef Documentation

◆ Component

template<size_t N, typename T>
using grem::LineSegment< N, T >::Component = T

Scalar coordinate component type.

Member Function Documentation

◆ operator LineSegment< N, U >()

template<size_t N, typename T>
template<typename U>
GREM_ALWAYS_INLINE constexpr grem::LineSegment< N, T >::operator LineSegment< N, U > ( ) const
inlineexplicitconstexprnoexcept

Convert this line segment to an equivalent line segment of another scalar type.

Returns
the converted line segment.

◆ operator==()

template<size_t N, typename T>
bool grem::LineSegment< N, T >::operator== ( const LineSegment< N, T > & 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.

◆ getBoundingBox()

template<size_t N, typename T>
Box< N, T > grem::LineSegment< N, T >::getBoundingBox ( ) const
inlinenodiscardconstexprnoexcept

Get the axis-aligned bounding box of the line segment.

Returns
an axis-aligned box that contains the entire line segment.

Member Data Documentation

◆ RANK

template<size_t N, typename T>
size_t grem::LineSegment< N, T >::RANK = N
staticconstexpr

Number of dimensions of the vector space.

◆ pointA

template<size_t N, typename T>
Point<N, T> grem::LineSegment< N, T >::pointA

Position of the first point of the line segment.

◆ pointB

template<size_t N, typename T>
Point<N, T> grem::LineSegment< N, T >::pointB

Position of the second point of the line segment.


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