benilla-re systems structs docs

CCamera::ProbeSlope

function · uicamera · primitive

Address
0x50d900 · 697 bytes, up to 0x50dbb8
Signature
void __thiscall (CCamera *this, CGObject_C *unit, uint32_t now)
Meaning
Measures the ground slope ahead of the unit and stores the tilt angle
Confidence
verified, proof one
Finding
uicamera/effects#probing-the-slope
Test
ui::cam_50d900

Finding: Probing the slope in uicamera: shake, bobbing, terrain tilt and the drunk view

Every 100 milliseconds 0x50d900(unit, now) measures the ground ahead of a unit. With the tilt off (0x5105a0 false) it stores 0 at +0xa0. Otherwise it casts a ray 10/3 yards forward along the facing from 5/3 yards above the feet, backs the hit point off 5/18 yard, and casts a ray 64/9 yards straight down from there. The slope is the ground rise over the horizontal distance. The slope's size picks the largest of ten table angles (0 to 45 degrees in steps of 5) whose key it reaches; uphill gives a negative angle. The result is clamped to plus or minus 20 degrees and stored at +0xa0.

The derivation is in the doc.

Callers 2

Callees 2

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