CMapChunk::GetHeight
function · terrain · primitive
- Address
0x6b72a0· 607 bytes, up to0x6b74fe- Signature
int32_t __fastcall (CMapChunk *chunk, const float *point, int32_t column, int32_t row, float *out)- Meaning
- Writes the height of the cell triangle under a point, normalising with rsqrtss when SSE is present
- Confidence
- verified, proof one
- Finding
- terrain/queries#chunk-height
- Test
terrain::chunk_get_height,terrain::chunk_get_height_quadrants
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.
| tests | triangle |
|---|---|
| neither | C, V+17, V |
| first | C, V, V+1 |
| second | C, V+18, V+17 |
| both | C, V+1, V+18 |
The derivation is in the doc.
Callers 1
- GetSurfaceHeight terrain
Callees 5
- SetVector3 spline
- SubtractVector3 ui
- DotVector3 objectlayer
- NormalizeVector3 terrain
- CrossVector3 terrain
Calls and jumps by a bare address, from tables/calls.tsv.