benilla-re systems structs docs

CMovement::ComputeDisplacement

function · collision · primitive

Address
0x7c5360 · 264 bytes, up to 0x7c5467
Signature
uint32_t __thiscall (CMovement *this, uint32_t ms, const float *rate, float *out)
Meaning
Integrates facing and pitch over ms and writes the displacement the movement flags select
Confidence
verified, proof one
Finding
collision/kinematics#displacement-dispatcher
Test
collision::tf_substep_dt_difftest, collision::pitch_land_step_trace

Finding: Displacement dispatcher in collision: kinematics

0x7c5360(ms, override, out) returns 0 for ms = 0. Else t = fl(ms · 0.001) (0x3a83126f, ms unsigned), and builds a mode. With 0x30 set or override not null it calls 0x7c4f30(t, override) and sets bit 2 unless 0x2000 (falling) is set; with 0xc0, swimming or not, it calls 0x7c4f80(t) and sets bit 8; 0x3 sets bit 1 and 0xc bit 4. The mode picks the displacement:

modes (1 move, 2 turn, 4 strafe, 8 pitch)handlerreturns
0none1
1, 4, 5, 120x7c4ed0, straight line1
2, 8, 10none0
3, 6, 7, 140x7c52c0, turn arc1
9, 130x7c5180, pitch arc1
11, 150x7c4fd0, turn and pitch1

With no handler out is untouched; every caller zeroes it first.

The derivation is in the doc.

Callers 3

Callees 6

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