BuildTrianglePrism
function · collision · primitive
- Address
0x632460· 661 bytes, up to0x6326f4- Signature
uint32_t __fastcall (const float *verts, const uint8_t *tri, const float *face, const float *sweep, float *planes)- Meaning
- Writes the edge planes of a triangle swept along a vector, and its far cap; 0 for a degenerate edge
- Confidence
- verified, proof one
- Finding
- collision/contact#face-prisms
- Test
collision::edge_planes_difftest
Finding: Face prisms in collision: contact
0x632460(V, tri, face, s, out) and 0x632f80(V, quad, face, s, out) bound the prism a volume
face sweeps along s. Each edge A = V[k_j] to B = V[k_(j+1)], with A' = A + s, gives one plane:
| case | result |
|---|---|
| squared length of (B − A) × (A' − A) below 2^−20 (0x35800000) | return 0; NaN continues |
| otherwise | plane through A, B, A', normal normalize((B − A) × (A' − A)) by 0x637480 |
| a face vertex off the edge strictly on its positive side | the plane reversed with d |
| after the edges, out[3] or out[4] | the face's normal, d = −n·(V[k_0] + s), V[k_0] + s unrounded |
The vertex off the edge is the triangle's k_(j+2), the quad's k_(j−1). Both return 1. The callers clip by the edge planes alone, so the region is the face outline extruded along s both ways.
The derivation is in the doc.
Callers 2
- CMovement::FindBevelContacts collision
- IsPointOverListedTriangle collision
Callees 4
- SetVector3 spline
- SetPlane gx
- NegateVector3 collision
- PlaneFromTriangle collision
Calls and jumps by a bare address, from tables/calls.tsv.