benilla-re systems structs docs

AddQuadFacets

function · terrain · primitive

Address
0x6aba30 · 522 bytes, up to 0x6abc39
Signature
void __fastcall (void *list, const float *corner, const float *a, const float *b, const float *normal)
Meaning
Appends a quad as two facets with its plane for the chunk's x-max wall
Confidence
verified, proof one
Finding
terrain/collide#impassable-walls
Test
terrain::quad_collision_emit_difftest, terrain::impassable_chunk_fence_difftest

Finding: Impassable walls in terrain: collide

A chunk whose header flag bit 1 is set (0x40 in the runtime word +0xc, written once at 0x6af677) fences itself. For each side the query box crosses, 0x6ab530 adds a vertical quad of two facets along the chunk's own box. Min and max are chunk +0x44 to +0x4c and +0x50 to +0x58 (x, y, z); the quad rises 32000.0 from the chunk's lowest height C.minZ. The walls ignore the query's class mask, the flag is read once per chunk, and the chunk's own triangles are gathered as for any chunk.

sidetest (strict)start pedge enormal
y-minQ.min1 < C.min1(C.min0, C.min1, C.minZ)(+W, 0, 0)(0, −1, 0)
y-maxQ.max1 > C.max1(C.max0, C.max1, C.minZ)(−W, 0, 0)(0, 1, 0)
x-minQ.min0 < C.min0(C.min0, C.max1, C.minZ)(0, −D, 0)(−1, 0, 0)
x-maxQ.max0 > C.max0(C.max0, C.min1, C.minZ)(0, +D, 0)(1, 0, 0)

The derivation is in the doc.

Callers 1

Callees 3

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