FindNearestChunkLiquid
function · terrain · primitive
- Address
0x68b0d0· 606 bytes, up to0x68b32d- Signature
uint8_t __fastcall (void *area, uint32_t unused, float radius, void *out, uint32_t a, uint32_t arg6, uint32_t arg7)- Meaning
- Keeps, per type, the liquid cell nearest a point among the chunks of an area within a radius window
- Confidence
- verified, proof one
- Finding
- terrain/liquidpass#nearest-liquid-cells
- Test
terrain::nearest_liquid_difftest
Finding: Nearest liquid cells in terrain: liquid passes
0x68af10 finds, for a point, the nearest liquid cell of each type among the areas near it, and
0x68b0d0 does it inside one area. The point maps to an area index (((17066.666 − p) × 0.24 − 0.5)
rounded, >> 7, 64 × 64 areas); the search takes the 3 × 3 areas around it, skipping empty ones
and those whose box misses the radius sphere. In an area it takes ceil(radius × 0.24) chunks
either side (clamped to 16 × 16) and keeps, per type, the cell of the chunks' four slots (flag
nibble not 0xf) nearest the point, at its corner and the slot's middle height, as an offset.
The derivation is in the doc.
Callers 1
- FindNearestLiquidInAreas terrain
Callees 1
- ceil crt
Calls and jumps by a bare address, from tables/calls.tsv.