IntersectRayBox
function · cmath · unreached
- Address
0x7c1920· 451 bytes, up to0x7c1ae2- Signature
uint8_t __fastcall (const NTempest::C3Ray *ray, const NTempest::CAaBox *box, float *outT, NTempest::C3Vector *outPoint)- Meaning
- Finds where a ray enters a box, writing the parameter and the point
- Confidence
- verified, proof two
- Finding
- cmath/solids#ray-and-box
Finding: Ray and box in cmath: boxes, cones and triangles
0x7c1920(outT, outPoint) finds where the ray in ecx (any direction length) enters the box in edx. An
origin between the faces on all three axes gives t = 0 and the origin. Otherwise each axis with the origin
outside has a candidate T = (near face − origin) / dir, and −1 for a zero direction component. The axis with the
largest T (the first on a tie) must have T ≥ 0. The point takes the near face on that axis and origin + T·dir,
rounded to a float, on the others, and each of those must lie between the box's minimum and maximum. Both
outputs are optional.
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.