IntersectRayPolygonTriangle
function · cmath · unreached
- Address
0x7c2740· 139 bytes, up to0x7c27ca- Signature
uint8_t __fastcall (const NTempest::C3Ray *ray, const NTempest::CFacet *facet, float *outT, NTempest::C3Vector *outPoint, float eps)- Meaning
- Intersects a ray with a triangle through 0x7c22b0 and 0x7c23e0
- Confidence
- verified, proof two
- Finding
- cmath/geometry#point-in-polygon
Finding: Point in polygon in cmath: intersections
0x7c23e0(n, axis) tests the point in ecx against n vertices (flat floats, stride 12, in edx)
by the crossing count after dropping coordinate axis: the two kept coordinates are A = tab[axis].a
and B = tab[axis].b from the table 0xcf5c7c, set by the initializer 0x7c18d0 to (2, 1) for axis 0,
(0, 2) for axis 1 and (1, 0) for axis 2. For each edge from the previous vertex (the last for the first)
to the current, with side(V) = V.A ≥ Q.A (false for NaN): a change of side compares
(Vprev.B − Vcur.B)·(Vcur.A − Q.A) with (Vcur.B − Q.B)·(Vprev.A − Vcur.A), and the accumulator toggles when
term2 ≤ term1 equals the current side. n of 0 gives 0.
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 3
- DominantAxis cmath
- IntersectRayPlane cmath
- PointInPolygonProjected cmath
Calls and jumps by a bare address, from tables/calls.tsv.