benilla-re systems structs docs

CMapObjGroup::IntersectLeaf

function · models · primitive

Address
0x6b88e0 · 654 bytes, up to 0x6b8b6d
Meaning
Intersects a segment with the welded faces of a BSP leaf
Confidence
inferred
Finding
models/wmo#bsp-segment-descent
Test
models::aabsp_segment_clip_difftest, models::wmobsp_leaf_tscale_difftest

Finding: BSP segment descent in models: map objects

A group's BSP node is 16 bytes: a 16-bit flags word (0x4 leaf, low two bits the split axis), the negative and positive children (+0x2, +0x4, 0xffff for none), the face count +0x6, the first face reference +0x8, and the split distance +0xc. A segment descends with the node's box: it stops when both ends lie more than 0.01 beyond the box on the split axis; with f0 and f1 the ends' distances from the split, it visits both children whole when either is within 0.01, one child when both are beyond 0.01 on one side, and otherwise splits at t = f0/(f0 − f1), the start's side first. A leaf tests its cached mesh, else each face.

The derivation is in the doc.

Callers 1

Callees 2

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