|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a sphere. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Member Functions | |
| SphereSDF ()=default | |
| Default constructor. Constructs a unit sphere centered at the origin. | |
| SphereSDF (const Vec3T< T > &a_center, const T &a_radius) noexcept | |
| Full constructor. | |
| SphereSDF (const SphereSDF &)=default | |
| Copy constructor. | |
| SphereSDF (SphereSDF &&)=default | |
| Move constructor. | |
| SphereSDF & | operator= (const SphereSDF &)=default |
| Copy assignment. | |
| SphereSDF & | operator= (SphereSDF &&)=default |
| Move assignment. | |
| const Vec3T< T > & | getCenter () const noexcept |
| Get sphere center (const). | |
| Vec3T< T > & | getCenter () noexcept |
| Get sphere center (mutable). | |
| const T & | getRadius () const noexcept |
| Get sphere radius (const). | |
| T & | getRadius () noexcept |
| Get sphere radius (mutable). | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| Signed distance function for the sphere. | |
| BoundingVolumes::AABBT< T > | computeBoundingVolume () const noexcept |
| The shape's axis-aligned bounding box. | |
Static Public Attributes | |
| static constexpr DistanceQuality | distanceQuality = DistanceQuality::Exact |
| How far signedDistance() can be trusted as a distance: the Euclidean distance to the surface. | |
Protected Attributes | |
| Vec3T< T > | m_center = Vec3T<T>::zeros() |
| Sphere center. | |
| T | m_radius = T(1) |
| Sphere radius. | |
Signed distance field for a sphere.
The sphere is placed at m_center with radius m_radius. The SDF is negative inside the sphere and positive outside. By default the sphere is centered at the origin with radius 1.
| T | Floating-point precision. |
|
inlinenoexcept |
Full constructor.
| [in] | a_center | Sphere center. |
| [in] | a_radius | Sphere radius. |
|
inlinenoexcept |
The shape's axis-aligned bounding box.
The center plus and minus the radius along each axis.
|
inlinenoexcept |
Get sphere center (const).
|
inlinenoexcept |
Get sphere center (mutable).
|
inlinenoexcept |
Get sphere radius (const).
|
inlinenoexcept |
Get sphere radius (mutable).
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlinenoexcept |
Signed distance function for the sphere.
| [in] | a_point | Position. |