benilla-re systems structs docs

s_useSse

global · terrain

Address
0xc9e388 · 4 bytes, up to 0xc9e38b
Type
uint32_t
Meaning
Holds 1 when the processor has SSE, set at map start-up
Confidence
verified, proof one
Finding
terrain/queries#chunk-height

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.