This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SoA and SSE separating axis test between two convex hulls. Face phases go through a SIMD | |
| // getSupport. For the edge phase, B's verts and face normals are transformed into A's space once | |
| // up front from the hull's stored SoA arrays so the inner loop does no transforms. Data is packed | |
| // one array per component and the loop tests one B edge against four A edges at a time. Edge | |
| // counts are bounded so every buffer is a fixed size stack array. | |
| #include "sat.h" | |
| #include <immintrin.h> | |
| // a*b + c, fused when FMA is available. | |
| static inline __m128 mad(__m128 a, __m128 b, __m128 c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A float which remains large when you modify its least significant bits | |
| const Vec4f VEC4_LARGE_FLOAT = Vec4f::fromF32(8589934592); | |
| const Vec4f VEC4_INDEX_MASK = Vec4f::fromI32(~1, ~1, 0, 0); | |
| const Vec4f VEC4_INDEX_VALS = Vec4f::fromI32(0, 1, 0x50000000, 0x50000000); | |
| const Vec4f VEC4_ZERO = Vec4f::fromF32(0.0f); | |
| constexpr int BIG_FLOAT_INTEGER = 0x50000000; | |
| template <size_t n, size_t i, size_t indexBits = 3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void satCollideReference(const SatShape *a, Transform xfA, const SatShape *b, Transform xfB, SatResult *res) | |
| { | |
| ASSERT(b->numFaces != 2); | |
| Transform bToA = xfA.inverse().mul(xfB); | |
| Transform aToB = bToA.inverse(); | |
| res->vert = -1; | |
| res->face = -1; | |
| res->support = INFINITY; | |
| // Test MD against planes of a |