benilla-re systems structs docs

MaxVector3InPlace

function · terrain · primitive

Address
0x6b11f0 · 104 bytes, up to 0x6b1257
Signature
void __thiscall (float *this, const float *b)
Meaning
Replaces each component of a by b's unless a's is greater
Confidence
verified, proof one
Finding
terrain/chunk#chunk-vertices
Test
terrain::vec3_max_inplace, terrain::vec3_max_inplace_difftest

Finding: Chunk vertices in terrain: chunk

CMapChunk::BuildVertices (0x6b0e50) writes 145 vertices relative to the chunk position: nine rows of nine outer vertices, each but the last followed by eight inner ones. With g the chunk's global row (+0x90) and h its global column (+0x8c), and every step stored as a float,

o(n) = 17066.666 − n·33.333332, sx = −(o(g) − o(g+1))/8, sy = −(o(h) − o(h+1))/8.

Outer vertex (j, i) is (j·sx, i·sy, z); inner vertex (j, i) is (j·sx + sx/2, i·sy + sy/2, z), with z the next MCVT float copied unchanged. The box is the vertices' minimum and maximum plus the position; the centre is (min + max)/2 and the radius |max − centre|.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

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