|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Generic sphere shape with a center and radius 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 Sphere< N, U > () const noexcept |
| Convert this sphere to an equivalent sphere of another scalar type. | |
| constexpr | operator Ellipsoid< N, T > () const noexcept |
| Convert this sphere to an equivalent ellipsoid. | |
| constexpr | operator Ellipse< T > () const noexcept |
| Convert this sphere to an equivalent 2D ellipse. | |
| bool | operator== (const Sphere &other) const =default |
| Compare this sphere to another for equality. | |
| constexpr bool | contains (const Point< N, T > &point) const noexcept |
| Check if a given point is contained within the extents of this sphere. | |
| constexpr bool | intersects (const Ray< N, T > &ray) const noexcept |
| Check if this sphere intersects a given ray. | |
| constexpr RaycastResult< N, T > | raycast (const Ray< N, T > &ray) const noexcept |
| Find the closest intersection of this sphere with a given ray. | |
| constexpr Box< N, T > | getBoundingBox () const noexcept |
| Get the axis-aligned bounding box of the sphere. | |
| constexpr Ellipsoid< N, T > | toEllipsoid () const noexcept |
| Convert this shape to an equivalent ellipsoid. | |
| constexpr Sphere< N, T > | toSphere () const noexcept |
| Convert this shape to an equivalent sphere. | |
Public Attributes | |
| Point< N, T > | center |
| Position of the center of the sphere. | |
| T | radius |
| Radius of the sphere. | |
Static Public Attributes | |
| static constexpr size_t | RANK = N |
| Number of dimensions of the vector space. | |
Generic sphere shape with a center and radius in N-dimensional space.
| N | number of vector dimensions. |
| T | scalar coordinate component type. |
| using grem::Sphere< N, T >::Component = T |
Scalar coordinate component type.
|
inlineexplicitconstexprnoexcept |
Convert this sphere to an equivalent sphere of another scalar type.
|
inlineconstexprnoexcept |
Convert this sphere to an equivalent ellipsoid.
|
inlineconstexprnoexcept |
Convert this sphere to an equivalent 2D ellipse.
|
nodiscarddefault |
Compare this sphere to another for equality.
| other | the sphere to compare this sphere to. |
|
inlinenodiscardconstexprnoexcept |
Check if a given point is contained within the extents of this sphere.
| point | point to check. |
|
inlinenodiscardconstexprnoexcept |
Check if this sphere intersects a given ray.
| ray | ray to check. |
|
inlinenodiscardconstexprnoexcept |
Find the closest intersection of this sphere with a given ray.
| ray | ray to check. |
|
inlinenodiscardconstexprnoexcept |
Get the axis-aligned bounding box of the sphere.
|
inlinenodiscardconstexprnoexcept |
Convert this shape to an equivalent ellipsoid.
|
inlinenodiscardconstexprnoexcept |
Convert this shape to an equivalent sphere.
|
staticconstexpr |
Number of dimensions of the vector space.
| Point<N, T> grem::Sphere< N, T >::center |
Position of the center of the sphere.
| T grem::Sphere< N, T >::radius |
Radius of the sphere.