CCamera::ComputeBob
function · uicamera · primitive
- Address
0x511920· 337 bytes, up to0x511a70- Signature
void __thiscall (CCamera *this, NTempest::C3Vector *out)- Meaning
- Writes the side and vertical bob offsets for the followed unit
- Confidence
- verified, proof one
- Finding
- uicamera/effects#bobbing
- Test
ui::cam_511920
Finding: Bobbing in uicamera: shake, bobbing, terrain tilt and the drunk view
First-person bobbing sways the eye as the character moves. The sway runs only while the bob bit is set and 0x5105e0
admits the unit (uicamera/cvars#bobbing-and-pivot-tests). With speed the movement speed of the followed unit,
r = clamp(speed / 7.2, 0.5, 1.5) * cameraBobbingFrequency and t the seconds since the bob began,
the side sway is a = cameraBobbingLRAmplitude / 36 * sin(2π r t) along the unit's left axis, (a cos(φ + π/2), a sin(φ + π/2)),
and the vertical sway is cameraBobbingUDAmplitude / 36 * sin(2π * 2r * t). The result is written to +0x110 to +0x118.
The derivation is in the doc.
Callers 1
- CCamera::Update uicamera
Callees 4
- OsGetAsyncTimeMs core
- ClntObjMgrObjectPtr objectlayer
- BobbingActive uicamera
- CMovement::GetCurrentSpeed collision
Calls and jumps by a bare address, from tables/calls.tsv.