Signed distance field for an axis-aligned box with rounded edges and corners.
More...
|
|
| RoundedBoxSDF ()=default |
| | Default constructor. Constructs a rounded unit cube, [-0.5, 0.5]^3, centered at the origin, with rounding radius 0.1.
|
| |
| | RoundedBoxSDF (const Vec3T< T > &a_center, const Vec3T< T > &a_size, const T a_curvature) |
| | Full constructor.
|
| |
|
| RoundedBoxSDF (const RoundedBoxSDF &)=default |
| | Copy constructor.
|
| |
|
| RoundedBoxSDF (RoundedBoxSDF &&)=default |
| | Move constructor.
|
| |
| RoundedBoxSDF & | operator= (const RoundedBoxSDF &)=default |
| | Copy assignment.
|
| |
| RoundedBoxSDF & | operator= (RoundedBoxSDF &&)=default |
| | Move assignment.
|
| |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| | Signed distance function for the rounded box.
|
| |
| uint32_t | getNumParts () const noexcept |
| | How many parts the shape has (see hasParts): 6.
|
| |
| uint32_t | closestPart (const Vec3T< T > &a_point) const noexcept |
| | The part whose term decides the value at a point (see hasParts): 2 axis + 0 for the face on the negative side, 2 axis + 1 for the one on the positive side (-x, +x, -y, +y, -z, +z), the axis whose term is largest; a rounded edge or corner goes to that face.
|
| |
| BoundingVolumes::AABBT< T > | computeBoundingVolume () const noexcept |
| | The shape's axis-aligned bounding box.
|
| |
template<class T>
class EBGeometry::RoundedBoxSDF< T >
Signed distance field for an axis-aligned box with rounded edges and corners.
The constructor takes the box's center, its outer size (the full side lengths of the finished, rounded box, which is also its bounding box) and the rounding radius. The rounding is a sphere of that radius swept over an inner box whose half-extents, m_dimensions = 0.5 * size - curvature, are stored. The SDF is negative inside and positive outside.
- Template Parameters
-
| T | Floating-point precision. |
The part whose term decides the value at a point (see hasParts): 2 axis + 0 for the face on the negative side, 2 axis + 1 for the one on the positive side (-x, +x, -y, +y, -z, +z), the axis whose term is largest; a rounded edge or corner goes to that face.
- Parameters
-
- Returns
- The part.