CMapChunk::GetLiquidHeight
function · terrain · primitive
- Address
0x6b7500· 650 bytes, up to0x6b7789- Signature
int32_t __fastcall (CMapChunk *chunk, const float *point, float u, float v, float *out)- Meaning
- Writes the bilinear liquid height at grid coordinates u from y and v from x, 0 for ocean; returns 0 without liquid
- Confidence
- verified, proof one
- Finding
- terrain/queries#liquid-height
- Test
terrain::liquid_height_sample
Finding: Liquid height in terrain: queries
0x6b7500(u, v, out), on a chunk with the point in edx, takes u = (17066.666 − y)·0.24, v from
x. With i = round(u − 0.5), j = round(v − 0.5), fu = u − i and fv = v − j, stored,
it takes the first slot whose tile (j & 7, i & 7) is typed, else returns 0. Ocean (type & 3 ==
- is height 0; otherwise, h01 being the next column's MCLQ height and h10 the next row's, a = (h01 − h00)·fu + h00, b = (h11 − h10)·fu + h10 and h = (b − a)·fv + a, at 53 bits, stored once. The masks wrap any u and v into the chunk.
The derivation is in the doc.
Callers 1
- GetSurfaceHeight terrain
Callees 6
- SplatVector3 loadingscreen
- 0x5132f0 uicamera
- ScaleVector3 objectlayer
- AddVector3 objectlayer
- NormalizeVector3 terrain
- DistanceSquared terrain
Calls and jumps by a bare address, from tables/calls.tsv.