Signed distance field for a round cone: two spheres, of different radii, and the cone tangent to both, like a capsule with a radius at each end.
More...
|
|
| RoundConeSDF ()=default |
| | Default constructor. Constructs a round cone from (0,-0.5,0) with radius 0.5 to (0,0.5,0) with radius 0.25.
|
| |
| | RoundConeSDF (const Vec3T< T > &a_center1, const Vec3T< T > &a_center2, const T a_radius1, const T a_radius2) |
| | Full constructor.
|
| |
|
| RoundConeSDF (const RoundConeSDF &)=default |
| | Copy constructor.
|
| |
|
| RoundConeSDF (RoundConeSDF &&)=default |
| | Move constructor.
|
| |
| RoundConeSDF & | operator= (const RoundConeSDF &)=default |
| | Copy assignment.
|
| |
| RoundConeSDF & | operator= (RoundConeSDF &&)=default |
| | Move assignment.
|
| |
| const Vec3T< T > & | getCenter1 () const noexcept |
| | Get the center of one sphere.
|
| |
| const Vec3T< T > & | getCenter2 () const noexcept |
| | Get the center of the other sphere.
|
| |
| const T & | getRadius1 () const noexcept |
| | Get the radius of the sphere at m_center1.
|
| |
| const T & | getRadius2 () const noexcept |
| | Get the radius of the sphere at m_center2.
|
| |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| | Signed distance function for the round cone.
|
| |
| uint32_t | getNumParts () const noexcept |
| | How many parts the shape has (see hasParts): 3.
|
| |
| uint32_t | closestPart (const Vec3T< T > &a_point) const noexcept |
| | The part whose term decides the value at a point (see hasParts): 0 the slanted side, 1 the sphere at the first center, 2 the one at the second.
|
| |
| BoundingVolumes::AABBT< T > | computeBoundingVolume () const noexcept |
| | The shape's axis-aligned bounding box: the box around the two spheres.
|
| |
|
|
Vec3T< T > | m_center1 = Vec3T<T>(T(0), T(-0.5), T(0)) |
| | Center of one sphere.
|
| |
|
Vec3T< T > | m_center2 = Vec3T<T>(T(0), T(0.5), T(0)) |
| | Center of the other sphere.
|
| |
|
Vec3T< T > | m_axis = Vec3T<T>(T(0), T(1), T(0)) |
| | Unit axis from m_center1 to m_center2.
|
| |
|
T | m_length = T(1) |
| | Distance between the centers.
|
| |
|
T | m_radius1 = T(0.5) |
| | Radius of the sphere at m_center1.
|
| |
|
T | m_radius2 = T(0.25) |
| | Radius of the sphere at m_center2.
|
| |
|
T | m_sin = T(0.25) |
| | Sine of the cone's half-angle, (m_radius1 - m_radius2) / m_length.
|
| |
|
T | m_cos = T(0.96824583655185422) |
| | Cosine of the cone's half-angle.
|
| |
template<class T>
class EBGeometry::RoundConeSDF< T >
Signed distance field for a round cone: two spheres, of different radii, and the cone tangent to both, like a capsule with a radius at each end.
The distance is exact (Quilez's round cone). The spheres are centered at the two end centers; the smaller one must not lie inside the larger, so the difference of the radii must be less than the distance between the centers. By default the round cone runs from (0,-0.5,0) with radius 0.5 to (0,0.5,0) with radius 0.25.
- Template Parameters
-
| T | Floating-point precision. |