A group of up to W spheres carrying their cloud indices: a PointAoSoA<T, W> of the centers, and one more lane array of the radii.
More...
#include <EBGeometry_SphereAoSoA.hpp>
|
| void | pack (const SphereCloud::Sphere< T > *a_spheres, const uint32_t *a_sphereIds, uint32_t a_count) noexcept |
| | Pack a_count (sphere, id) pairs into this group.
|
| |
| void | packUnchecked (const SphereCloud::Sphere< T > *a_spheres, const uint32_t *a_sphereIds, uint32_t a_count) noexcept |
| | pack() without its always-on checks, for a build that runs on a device.
|
| |
| Array< T, W > | getSignedDistances (const Vec3T< T > &a_point) const noexcept |
| | Signed distances from a_point to the surface of every one of the W lane spheres, |p - c| - r.
|
| |
| Array< T, W > | getSeparations (const Vec3T< T > &a_center, T a_radius) const noexcept |
| | Separations between a sphere and every one of the W lane spheres, |c - c_j| - (r + r_j).
|
| |
| void | rayIntervals (const Vec3T< T > &a_origin, const Vec3T< T > &a_direction, Array< T, W > &a_entry, Array< T, W > &a_exit) const noexcept |
| | Where a ray runs through each of the W lane spheres: the distances along it at which it enters and leaves the sphere.
|
| |
| uint32_t | getSphereId (size_t a_lane) const noexcept |
| | Get the id of the sphere in one lane of this group.
|
| |
| uint32_t | numValid () const noexcept |
| | Number of real (non-padded) spheres in this group.
|
| |
| template<class BV > |
| BV | computeBoundingVolume () const noexcept |
| | Compute the bounding volume enclosing all valid spheres in this group, each grown by its radius.
|
| |
|
|
PointAoSoA< T, W > | m_centers |
| | The centers and ids. It also holds the valid-sphere count.
|
| |
|
Array< T, W > | m_radii |
| | Per-lane radii. m_radii[j] = radius of sphere j.
|
| |
template<class T, size_t W = PointSoA::DefaultWidth<T>()>
struct EBGeometry::SphereAoSoA< T, W >
A group of up to W spheres carrying their cloud indices: a PointAoSoA<T, W> of the centers, and one more lane array of the radii.
The leaf primitive of SphereCloudBVH. The centers and ids are a PointAoSoA, so the distance to every center is PointSoAT's SIMD-wide computation, and the radii sit in their own array beside it.
- Template Parameters
-
◆ computeBoundingVolume()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
template<class BV >
Compute the bounding volume enclosing all valid spheres in this group, each grown by its radius.
- Template Parameters
-
| BV | Bounding volume type; must be constructible from a low and a high corner (AABBT<T>, say). |
- Returns
- Bounding volume enclosing every valid sphere.
◆ getSeparations()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Separations between a sphere and every one of the W lane spheres, |c - c_j| - (r + r_j).
Negative where the two overlap. The radii are summed before they are subtracted, so the separation of two spheres is the same whichever of them is in the group. Padded lanes repeat the last real sphere's value.
- Parameters
-
| [in] | a_center | The sphere's center. Must be finite. |
| [in] | a_radius | The sphere's radius. Must be finite. |
- Returns
- Per-lane separations, one per W lanes.
◆ getSignedDistances()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Signed distances from a_point to the surface of every one of the W lane spheres, |p - c| - r.
Negative inside a sphere. Padded lanes repeat the last real sphere's value.
- Parameters
-
| [in] | a_point | Query point. Must be finite. |
- Returns
- Per-lane signed distances, one per W lanes.
◆ getSphereId()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Get the id of the sphere in one lane of this group.
- Parameters
-
| [in] | a_lane | Lane index. Must satisfy 0 <= a_lane < W (padded lanes return the last real sphere's id; see pack()). |
- Returns
- The id of the sphere at a_lane.
◆ numValid()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Number of real (non-padded) spheres in this group.
- Returns
- The count passed to pack(), 1..W (0 before pack()).
◆ pack()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Pack a_count (sphere, id) pairs into this group.
Pads lanes a_count..W-1 by repeating the last real sphere and id, as PointAoSoA::pack() does, so all W lanes hold valid data.
- Parameters
-
| [in] | a_spheres | Source sphere array with at least a_count elements. Must not be null; every center and radius finite, every radius at least 0. |
| [in] | a_sphereIds | Source id array (typically cloud indices), same order and length as a_spheres. Must not be null. |
| [in] | a_count | Number of valid (sphere, id) pairs to pack. Must satisfy 1 <= a_count <= W. |
◆ packUnchecked()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
pack() without its always-on checks, for a build that runs on a device.
The caller guarantees what pack() checks (checked here only with assertions on).
- Parameters
-
| [in] | a_spheres | Source sphere array with at least a_count elements. |
| [in] | a_sphereIds | Source id array, same order and length as a_spheres. |
| [in] | a_count | Number of valid (sphere, id) pairs to pack. |
◆ rayIntervals()
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Where a ray runs through each of the W lane spheres: the distances along it at which it enters and leaves the sphere.
Over the whole line: an entry or exit may be negative, behind the origin. Computed as SphereSDF's ray form computes them, so a sphere of the group is crossed where the same sphere alone is, to rounding. A ray that misses a sphere gets an entry of +infinity and an exit of -infinity, as do padded lanes; one that only touches it gets an entry equal to its exit.
- Parameters
-
| [in] | a_origin | Ray origin. Must be finite. |
| [in] | a_direction | Ray direction, of unit length. |
| [out] | a_entry | Per-lane entry distances. |
| [out] | a_exit | Per-lane exit distances. |
The documentation for this struct was generated from the following file: