benilla-re systems structs docs

CrossVector3

function · terrain · primitive

Address
0x672130 · 60 bytes, up to 0x67216b
Signature
float * __fastcall (float *out, const float *a, const float *b)
Meaning
Writes the cross product of two vectors
Confidence
verified, proof one
Finding
terrain/queries#chunk-height
Test
terrain::vec3_cross_world, terrain::liquid_hit_flush_difftest

Finding: Chunk height in terrain: queries

0x6b72a0(cell column, cell row, out), on a chunk with the point in edx, returns 0 in a hole and otherwise writes the height of the triangle of the cell under the point and returns 1. Each cell is four triangles around its inner vertex C, chosen by two signed tests against the cell's diagonals; the height solves the triangle's plane n·q + d = 0 for z at the point's (x, y) and adds the chunk's z. With SSE, which the client detects at start-up, n is normalised with rsqrtss; without it, with an exact square root.

teststriangle
neitherC, V+17, V
firstC, V, V+1
secondC, V+18, V+17
bothC, V+1, V+18

The derivation is in the doc.

Callers 4

Callees 0

None by a direct call or jump.

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