benilla-re systems structs docs

TraceWorldSegmentBody

function · terrain · primitive

Address
0x69bff0 · 215 bytes, up to 0x69c0c6
Signature
uint8_t __fastcall (const float *start, const float *end, float *hit, float *t, uint32_t mask)
Meaning
Traces a segment against the map objects and terrain under a mask and writes the hit point
Confidence
verified, proof one
Finding
terrain/trace#segment-trace
Test
terrain::segment_lerp_difftest

Finding: Segment trace in terrain: trace

TraceWorldSegmentBody (0x69bff0) traces a segment under a mask: map objects when the mask has a bit of 0xf000ff, then the terrain when it has one of 0xf00f0f, each lowering the fraction t it is given when it hits. On a hit it writes the hit point start + (end − start)·t and returns

  1. The point's x is one rounding of (end.x − start.x)·t, then one of its sum with start.x; y is one rounding of the whole; z rounds end.z − start.z first.

The derivation is in the doc.

Callers 1

Callees 2

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