IsPointInIndexedPolygon16
function · cmath · unreached
- Address
0x7c24f0· 289 bytes, up to0x7c2610- Signature
uint8_t __fastcall (const NTempest::C3Vector *point, const NTempest::C3Vector *vertices, const uint16_t *indices, uint32_t n, uint32_t axis)- Meaning
- Returns 1 when a point lies inside a polygon given by 16-bit vertex indices
- 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 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.