|
|
constexpr | Sphere () noexcept=default |
| | Default constructor.
|
| |
|
constexpr | Sphere (Sphere const &) noexcept=default |
| | Copy constructor.
|
| |
| template<std::convertible_to< T > U> |
| constexpr | Sphere (Sphere< Dim, U > const &other) noexcept |
| | Converting constructor from a sphere with a different scalar type.
|
| |
| constexpr | Sphere (Vec< Dim, T > const ¢er, T radius) noexcept |
| | Constructs a sphere from a center point and a radius.
|
| |
| constexpr AABB< Dim, T > | aabb () const noexcept |
| | Returns the AABB of the sphere.
|
| |
| constexpr Vec< Dim, T > const & | center () const noexcept |
| | Returns the center of the sphere.
|
| |
| constexpr Vec< Dim, T > & | center () noexcept |
| | Returns the center of the sphere.
|
| |
| constexpr T | diameter () const noexcept |
| | Returns the diameter of the sphere.
|
| |
| constexpr bool | isDegenerate () const noexcept |
| | Returns whether the sphere is degenerate.
|
| |
|
bool | operator== (Sphere const &) const =default |
| | Equality operator.
|
| |
| constexpr T | volume () const noexcept |
| | Returns the volume of the sphere.
|
| |
template<std::size_t Dim = 3, std::floating_point T = float>
struct ufo::Sphere< Dim, T >
Sphere in Dim-dimensional space.
- Template Parameters
-
| Dim | The dimensionality of the space (default: 3). |
| T | The numeric type (default: float), must be a floating-point type. |
Represents a sphere defined by a center point and a radius.
Definition at line 67 of file sphere.hpp.
template<std::size_t Dim = 3, std::floating_point T = float>
Returns the volume of the sphere.
- Returns
- The volume.
The volume is calculated using the formula V = (pi^n * r^n) / (n * Gamma(n/2 + 1)), where n is the dimensionality of the space and r is the radius.
Definition at line 157 of file sphere.hpp.