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

Flat 2D circle shape with a center and radius. 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 Circle< U > () const noexcept
 Convert this circle to an equivalent circle of another scalar type.
constexpr operator Ellipsoid< 2, T > () const noexcept
 Convert this circle to an equivalent 2D ellipsoid.
constexpr operator Ellipse< T > () const noexcept
 Convert this circle to an equivalent 2D ellipse.
constexpr operator Sphere< 2, T > () const noexcept
 Convert this circle to an equivalent 2D sphere.
bool operator== (const Circle &other) const =default
 Compare this circle to another for equality.
constexpr bool contains (const Point< 2, T > &point) const noexcept
 Check if a given point is contained within the extents of this circle.
constexpr Box< 2, T > getBoundingBox () const noexcept
 Get the axis-aligned bounding box of the circle.
constexpr Ellipsoid< 2, T > toEllipsoid () const noexcept
 Convert this shape to an equivalent ellipsoid.
constexpr Sphere< 2, T > toSphere () const noexcept
 Convert this shape to an equivalent sphere.

Public Attributes

Point< 2, T > center
 Position of the center of the circle.
T radius
 Radius of the circle.

Static Public Attributes

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

Detailed Description

template<typename T>
struct grem::Circle< T >

Flat 2D circle shape with a center and radius.

Template Parameters
Tscalar coordinate component type.

Member Typedef Documentation

◆ Component

template<typename T>
using grem::Circle< T >::Component = T

Scalar coordinate component type.

Member Function Documentation

◆ operator Circle< U >()

template<typename T>
template<typename U>
GREM_ALWAYS_INLINE constexpr grem::Circle< T >::operator Circle< U > ( ) const
inlineexplicitconstexprnoexcept

Convert this circle to an equivalent circle of another scalar type.

Returns
the converted circle.

◆ operator Ellipsoid< 2, T >()

template<typename T>
grem::Circle< T >::operator Ellipsoid< 2, T > ( ) const
inlineconstexprnoexcept

Convert this circle to an equivalent 2D ellipsoid.

Returns
the circle as an ellipsoid.

◆ operator Ellipse< T >()

template<typename T>
grem::Circle< T >::operator Ellipse< T > ( ) const
inlineconstexprnoexcept

Convert this circle to an equivalent 2D ellipse.

Returns
the circle as an ellipse.

◆ operator Sphere< 2, T >()

template<typename T>
grem::Circle< T >::operator Sphere< 2, T > ( ) const
inlineconstexprnoexcept

Convert this circle to an equivalent 2D sphere.

Returns
the circle as a sphere.

◆ operator==()

template<typename T>
bool grem::Circle< T >::operator== ( const Circle< T > & other) const
nodiscarddefault

Compare this circle to another for equality.

Parameters
otherthe circle to compare this circle to.
Returns
true if the circles are equal, false otherwise.

◆ contains()

template<typename T>
bool grem::Circle< T >::contains ( const Point< 2, T > & point) const
inlinenodiscardconstexprnoexcept

Check if a given point is contained within the extents of this circle.

Parameters
pointpoint to check.
Returns
true if the circle contains the given point, false otherwise.

◆ getBoundingBox()

template<typename T>
Box< 2, T > grem::Circle< T >::getBoundingBox ( ) const
inlinenodiscardconstexprnoexcept

Get the axis-aligned bounding box of the circle.

Returns
an axis-aligned box that contains the entire circle.

◆ toEllipsoid()

template<typename T>
Ellipsoid< 2, T > grem::Circle< T >::toEllipsoid ( ) const
inlinenodiscardconstexprnoexcept

Convert this shape to an equivalent ellipsoid.

Returns
an ellipsoid that is equivalent to this shape.

◆ toSphere()

template<typename T>
Sphere< 2, T > grem::Circle< T >::toSphere ( ) const
inlinenodiscardconstexprnoexcept

Convert this shape to an equivalent sphere.

Returns
a sphere that is equivalent to this shape.

Member Data Documentation

◆ RANK

template<typename T>
size_t grem::Circle< T >::RANK = 2
staticconstexpr

Number of dimensions of the vector space.

◆ center

template<typename T>
Point<2, T> grem::Circle< T >::center

Position of the center of the circle.

◆ radius

template<typename T>
T grem::Circle< T >::radius

Radius of the circle.


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