benilla-re systems structs docs

AdvectDriftCloud

function · terrain · primitive

Address
0x68e930 · 486 bytes, up to 0x68eb15
Signature
void __thiscall (void *this)
Meaning
Moves the motes by the camera step and the gust and wraps them into the box, or scatters on a long step
Confidence
verified, proof one
Finding
terrain/waterfx#drift-advect
Test
terrain::weather_toroidal_advect_difftest

Finding: Drift advect in terrain: water effects

0x68e930 moves the motes with the frame. With the cloud's enable byte +0xfa14 set, it takes the camera's step since the last frame (+0xfa04: the previous position less the current), and when its squared length exceeds the squared box edge +0xfa1c it scatters the cloud again in the current mode and clears the step. It adds the gust displacement to the step, adds that to every mote (+0xfa00 of them, 16 bytes each) and wraps each axis into [−edge/2, edge/2]: above the half edge it subtracts the edge, below minus the half edge it adds it.

The derivation is in the doc.

Callers 1

Callees 2

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