benilla-re systems structs docs

TestHorizonBox

function · terrain · primitive

Address
0x686180 · 447 bytes, up to 0x68633e
Signature
uint32_t __fastcall (const float *box, uint32_t flags)
Meaning
Returns 2 when a box lies below the horizon in every column it spans, else 0
Confidence
verified, proof one
Finding
terrain/cull#horizon-box-test
Test
terrain::horizon_box_test, terrain::horizon_non_finite_probes

Finding: Horizon box test in terrain: cull

0x686180(box, flags) returns 2 when the box is hidden behind the horizon and 0 otherwise. Its eight corners go through the view matrix; unless flags bit 3 is set, a corner with z below 50 makes the box visible. The box spans the columns from round(64·min x/z − 0.5) + 160 to round(64·max x/z − 0.5) + 161, one more than the occluders' rule, and is hidden when every column in that span, clamped, is at least its highest y/z.

The derivation is in the doc.

Callers 4

Callees 1

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