benilla-re systems structs docs

s_rayTriangleNegEpsilon

global · cmath

Address
0x81d9bc · 4 bytes, up to 0x81d9bf
Type
const float
Meaning
Holds -1e-6, the lower determinant bound of the ray triangle test
Confidence
verified, proof one
Finding
models/scene#ray-triangle-test

Finding: Ray triangle test in models: the scene

The triangle test is two-sided Möller–Trumbore: with e1 = v1 − v0, e2 = v2 − v0 and p = d × e2, it misses when |e1·p| < 1e-6; with s = o − v0 and q = s × e1, u = (s·p)/det and v = (d·q)/det must each be at least −ε, and u and u + v at most 1 + ε; t = (e2·q)/det and (u, v) are written when asked. It does not bound t.

The derivation is in the doc.