|
|
T | m_vx [3][W] |
| | x-coordinates of vertex positions. m_vx[i][j] = x-coord of vertex i for triangle j.
|
| |
|
T | m_vy [3][W] |
| | y-coordinates of vertex positions. m_vy[i][j] = y-coord of vertex i for triangle j.
|
| |
|
T | m_vz [3][W] |
| | z-coordinates of vertex positions. m_vz[i][j] = z-coord of vertex i for triangle j.
|
| |
|
T | m_nx [W] |
| | x-components of face normals. m_nx[j] = x-component of the face normal for triangle j.
|
| |
|
T | m_ny [W] |
| | y-components of face normals.
|
| |
|
T | m_nz [W] |
| | z-components of face normals.
|
| |
|
T | m_vnx [3][W] |
| | x-components of vertex normals. m_vnx[i][j] = x of vertex normal i for triangle j.
|
| |
|
T | m_vny [3][W] |
| | y-components of vertex normals. m_vny[i][j] = y of vertex normal i for triangle j.
|
| |
|
T | m_vnz [3][W] |
| | z-components of vertex normals. m_vnz[i][j] = z of vertex normal i for triangle j.
|
| |
|
T | m_enx [3][W] |
| | x-components of edge normals. m_enx[i][j] = x of edge normal i for triangle j.
|
| |
|
T | m_eny [3][W] |
| | y-components of edge normals. m_eny[i][j] = y of edge normal i for triangle j.
|
| |
|
T | m_enz [3][W] |
| | z-components of edge normals. m_enz[i][j] = z of edge normal i for triangle j.
|
| |
| uint32_t | m_validCount = 0 |
| | Number of valid (non-padded) triangles in this group (1..W).
|
| |
template<
class T,
size_t W>
struct EBGeometry::TriangleSoAT< T, W >
SoA (Structure of Arrays) layout for W triangles, enabling SIMD evaluation.
signedDistance() dispatches to a packed intrinsics path for (T,W) combinations that fill a SIMD register exactly — SSE4.1 (float, W=4), AVX (float, W=8; double, W=4 or W=8), or AVX-512F (float, W=16; double, W=8) — evaluating all W triangles simultaneously. Any other (T,W) falls back to a scalar loop over m_validCount triangles.
- Warning
- This type is over-aligned (up to 64 bytes, for AVX-512F) via alignas. The library's own usage (PackedBVH storing groups inside a std::vector<TriangleSoAT>) is safe: C++17 mandates that std::allocator respect over-alignment, which has been verified empirically for every (T,W) combination this class supports. If you allocate a TriangleSoAT 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(TriangleSoAT<T, W>); nothing in this class enforces or checks that, and a misaligned SIMD load will crash (or silently read the wrong data on some platforms) rather than failing gracefully.
- Template Parameters
-
| T | Floating-point precision. |
| W | SIMD width: 4 for SSE (128-bit), 8 for AVX (256-bit float) or AVX-512F (512-bit double), 16 for AVX-512F (512-bit float). |
Evaluate signed distance from a_point to the closest triangle in this group.
Returns the signed distance with minimum absolute value among m_validCount triangles. Dispatches to an SSE4.1 packed-float path for (T=float, W=4), to AVX packed-float for (T=float, W=8), to AVX packed-double for (T=double, W=4 or W=8), or to a scalar fallback. Requires the group to have already been packed via pack() (1 <= m_validCount <= W).
- Parameters
-
| [in] | a_point | Query point. Must be finite. |
- Returns
- Signed distance from a_point to the closest valid triangle, with sign determined by the outward normal of the nearest feature (face, edge, or vertex).