|
| void | pack (const Triangle< T > *a_triangles, uint32_t a_count) noexcept |
| | Pack a_count triangles from a_triangles[0..a_count-1] into this group.
|
| |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| | Evaluate signed distance from a_point to the closest triangle in this group.
|
| |
| T | signedDistance (const Vec3T< T > &a_point, uint32_t &a_closestFaceId) const noexcept |
| | Evaluate signed distance from a_point to the closest triangle and report that triangle's face id.
|
| |
| uint32_t | nearestLane (const Vec3T< T > &a_point, T &a_d2) const noexcept |
| | The lane nearest a point and its squared unsigned distance (TriangleSoAT::nearestLane()).
|
| |
| T | signedDistanceAt (uint32_t a_lane, const Vec3T< T > &a_point) const noexcept |
| | One lane's signed distance (TriangleSoAT::signedDistanceAt()).
|
| |
| T | rayCrossing (const Vec3T< T > &a_origin, const Vec3T< T > &a_direction, T a_tMin, T a_tMax, uint32_t &a_faceId, Vec3T< T > &a_normal) const noexcept |
| | Where a ray first crosses a triangle in this group, with that triangle's face id and normal.
|
| |
| void | rayCrossings (const Vec3T< T > &a_origin, const Vec3T< T > &a_direction, T a_tMin, T a_tMax, T *a_crossings) const noexcept |
| | Where a ray crosses each triangle in this group.
|
| |
| Vec3T< T > | getNormal (size_t a_lane) const noexcept |
| | The unit normal of one lane's triangle.
|
| |
| uint32_t | getFaceId (size_t a_lane) const noexcept |
| | Get the face id for one lane of this group.
|
| |
| Vec3T< T > | getVertex (size_t a_lane, size_t a_vertex) const noexcept |
| | Vertex a_vertex of the triangle in lane a_lane (padded lanes repeat the last real triangle).
|
| |
| template<class BV > |
| BV | computeBoundingVolume () const noexcept |
| | Compute the bounding volume enclosing all valid triangles in this group.
|
| |
template<class T, size_t W = TriangleSoA::DefaultWidth<T>()>
struct EBGeometry::TriangleAoSoA< T, W >
Face-id-carrying wrapper around a single TriangleSoAT<T, W>.
Structurally this is an AoSoA (Array of Structures of Arrays): TriangleSoAT<T, W> itself is true SoA (one flat array per coordinate, no per-triangle structure at all), and TriangleAoSoA adds an Array<uint32_t, W> of face ids (and its own count of valid lanes) alongside it. The two are never merged or interleaved: the hot signedDistance(const Vec3T<T>&) query is delegated straight through to the embedded TriangleSoAT and never reads m_faceIds at all, so a pure signed-distance traversal over TriangleAoSoA-packed leaves touches exactly the same bytes it would touch over bare TriangleSoAT-packed leaves. The face ids are read only afterward, once a query already knows which lane (and therefore which triangle) it cares about, via getFaceId() or the id-reporting signedDistance(point, uint32_t&) overload – so a caller can recover which face is closest at no cost to the throughput signedDistance() path.
- Warning
- Inherits the embedded TriangleSoAT's over-alignment (up to 64 bytes, for AVX-512F). The library's own usage (PackedBVH storing groups in a Pool-backed PODVector<TriangleAoSoA>, reserved at alignof(TriangleAoSoA) inside a PoolBaseAlign-aligned block) is safe. If you allocate a TriangleAoSoA yourself outside of that path – a raw
new, a container with a custom/pre-C++17-style allocator, placement-new into externally-owned storage, or a malloc'd buffer – you are responsible for ensuring the memory is aligned to alignof(TriangleAoSoA<T, W>).
- Template Parameters
-
template<class T , size_t W = TriangleSoA::DefaultWidth<T>()>
Pack a_count triangles from a_triangles[0..a_count-1] into this group.
Pads lanes a_count..W-1 by repeating the last real triangle (its coordinates and its face id), matching TriangleSoAT::pack()'s own padding convention, so all W lanes hold valid data. The coordinates go into the embedded TriangleSoAT; each triangle's face id (via Triangle::getFaceId()) goes into the parallel m_faceIds array.
- Parameters
-
| [in] | a_triangles | Source triangle array with at least a_count elements. Must not be null. |
| [in] | a_count | Number of valid triangles to pack. Must satisfy 1 <= a_count <= W. |
template<class T , size_t W = TriangleSoA::DefaultWidth<T>()>
Evaluate signed distance from a_point to the closest triangle and report that triangle's face id.
The id-retrieving analogue of signedDistance(const Vec3T<T>&): it returns the same minimum-absolute-value signed distance, but also writes the winning triangle's face id to a_closestFaceId. Unlike the plain overload it keeps every lane's distance (TriangleSoAT::signedDistances()) to recover which lane won, then reads that lane's id – the extra work the throughput path deliberately avoids.
- Parameters
-
| [in] | a_point | Query point. Must be finite. |
| [out] | a_closestFaceId | Set to the face id of the winning (minimum-|distance|) triangle. |
- Returns
- Signed distance from a_point to the closest valid triangle.
template<class T , size_t W = TriangleSoA::DefaultWidth<T>()>
Number of valid (non-padded) triangles in this group (1..W).
Zero-initialized so that a default-constructed (not-yet-packed) group reliably fails the EBGEOMETRY_EXPECT(m_validCount >= 1) precondition in getFaceId()/signedDistance(point, uint32_t&), rather than reading whatever indeterminate value happened to be there. (The plain signedDistance() gets the same protection for free from the embedded TriangleSoAT's own m_validCount.)