|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Description of a sphere 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::Sphere< N, Scalar > | in (OtherUnitT unit) const noexcept |
| Convert this physical sphere to a unitless sphere given a desired unit. | |
| bool | operator== (const Sphere &other) const =default |
| Compare this sphere to another for equality. | |
| GREM_ALWAYS_INLINE constexpr bool | contains (const Position< N > &point) const noexcept |
| Check if a given point is contained within the extents of this sphere. | |
| GREM_ALWAYS_INLINE constexpr bool | intersects (const Ray< N > &ray) const noexcept |
| Check if this sphere intersects a given ray. | |
| GREM_ALWAYS_INLINE constexpr RaycastResult< N > | raycast (const Ray< N > &ray) const noexcept |
| Find the closest intersection of this sphere with a given ray. | |
| GREM_ALWAYS_INLINE constexpr Box< N > | getBoundingBox () const noexcept |
| Get the axis-aligned bounding box of the sphere. | |
Static Public Member Functions | |
| template<typename T> | |
| static GREM_ALWAYS_INLINE constexpr Sphere | reinterpret (const grem::Sphere< N, T > &sphere) noexcept |
| Reinterpret a unitless sphere as a physical sphere in default units. | |
Public Attributes | |
| Position< N > | center |
| Position of the center of the sphere. | |
| Distance | radius |
| Radius of the sphere. | |
Static Public Attributes | |
| static constexpr Unit | UNIT {} |
| Unit. | |
| static constexpr DimensionType | DIMENSION {} |
| Unit dimension. | |
| static constexpr MagnitudeType | MAGNITUDE {} |
| Unit magnitude. | |
Friends | |
| GREM_ALWAYS_INLINE friend constexpr bool | intersects (const Sphere &a, const Sphere &b) noexcept |
| Check if two spheres intersect. | |
Description of a sphere in world space.
| using grem::physics::Sphere< N >::Unit = typename Position<N>::Unit |
Unit type.
| using grem::physics::Sphere< N >::DimensionType = typename Unit::DimensionType |
Unit dimension type.
| using grem::physics::Sphere< N >::MagnitudeType = typename Unit::MagnitudeType |
Unit magnitude type.
|
inlinestaticnodiscardconstexprnoexcept |
Reinterpret a unitless sphere as a physical sphere in default units.
| sphere | sphere to reinterpret. |
|
inlinenodiscardconstexprnoexcept |
Convert this physical sphere to a unitless sphere given a desired unit.
| unit | unit to get the sphere in. |
|
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.
|
friend |
Check if two spheres intersect.
| a | first sphere. |
| b | second sphere. |
|
staticconstexpr |
Unit.
|
staticconstexpr |
Unit dimension.
|
staticconstexpr |
Unit magnitude.
| Position<N> grem::physics::Sphere< N >::center |
Position of the center of the sphere.
| Distance grem::physics::Sphere< N >::radius |
Radius of the sphere.