benilla-re systems structs docs

CCamera::ClassifyWaterBand

function · uicamera · primitive

Address
0x511ad0 · 237 bytes, up to 0x511bbc
Signature
float __thiscall (CCamera *this, CGUnit_C *unit)
Meaning
Sets the surface or submerged band bit and returns the liquid surface height above the unit
Confidence
verified, proof one
Finding
uicamera/solver#the-water-bands
Test
ui::glue_511_511ad0_residual

Finding: The water bands in uicamera: the near and far solver and the water bands

0x511ad0(unit) clears both mode bits, then sets at most one from d, the height of the liquid surface above the unit's position, and H, the target pivot height (+0x1c8). d below H + 2/9 sets the surface bit 0x100000; d - H from 2/9 up to but not including 5/9 sets the submerged bit 0x200000; exactly 5/9, more, or a depth that is not a number sets neither. No unit, or no liquid at the unit, returns 0.0 with neither bit; otherwise it returns d. It reads no earlier band state, so the band follows the depth on every frame with no hysteresis. What each band does to the solver's limits is uicamera/waterbands#pivot-height-by-band.

The derivation is in the doc.

Callers 2

Callees 1

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