benilla-re systems structs docs

IntersectRayPlane

function · cmath · primitive

Address
0x7c22b0 · 299 bytes, up to 0x7c23da
Signature
uint8_t __fastcall (const NTempest::C3Ray *ray, const NTempest::C4Plane *plane, float *outT, NTempest::C3Vector *outPoint, float eps)
Meaning
Intersects a ray with a plane, writing the parameter and the point when their pointers are set
Confidence
verified, proof two
Finding
cmath/geometry#ray-and-plane
Test
cmath::ray_plane_difftest, cmath::raymesh_composed_difftest

Finding: Ray and plane in cmath: intersections

0x7c22b0(outT, outPoint, eps) intersects the ray in ecx with the plane in edx (normal at +0, constant d at +0xc). D = (dir.y·n.y + dir.z·n.z) + n.x·dir.x. For |D| < 1e-4 (a double at 0x811658) the ray is parallel: it hits at t = 0, point = origin, only when |origin·n + d| < eps, else misses. Otherwise N = origin·n + d, t = −N/D when |N| ≥ eps or NaN, else t = 0, and the point is origin + t·dir, whose x and y terms are rounded to a float before the add and whose z term is not. Both outputs are optional; with both null a non-parallel ray reports a hit.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

Calls and jumps by a bare address, from tables/calls.tsv.