benilla-re systems structs docs

CMovement::ResolveDisplacement

function · collision · primitive

Address
0x634040 · 700 bytes, up to 0x6342fb
Signature
uint32_t __thiscall (CMovement *this, uint32_t time, uint32_t ms, const float *displacement)
Meaning
Resolves a displacement over ms against the world in substeps and returns the milliseconds resolved
Confidence
verified, proof one
Finding
collision/resolve#substep-loop
Test
collision::resolve_entry_difftest

Finding: Substep loop in collision: resolve

0x634040(time, ms, d) returns the milliseconds it resolved (0 for ms = 0, and 0 when the flags hold no bit of 0x200f at entry). With L = |d| at 53 bits, the speed is v = float(L / (ms·0.001)) and the direction u = float(d_i·(1/L)) per component, or (0, 0, 0) when L < 2^-20. The elapsed time e starts at 0, and while e < ms and the flags +0x40 hold a bit of 0x200f, one substep runs these steps in order:

stepaction
1r = ms − e, dist = float(r·0.001·v)
20x633840(dist, r, u); on 0: 0x615ae0(r), +0x58 −= r, e = ms, and the loop ends
3save the GUID +0x38, the speed +0x84, the flags, and F = (0x2000 set and +0xa0 ≠ 0)
4one resolver (Resolver dispatch); e += its return
50x61a820(time + e, ms − e, saved flags, F, GUID changed)
6with no active spline, a changed +0x84: 0x7c5c20(0), and the loop ends
7+0x58 = 0 and flags & 0xf: +0x58 = ms − e

The derivation is in the doc.

Callers 1

Callees 9

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