CMovement::ResolveDisplacement
function · collision · primitive
- Address
0x634040· 700 bytes, up to0x6342fb- 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:
| step | action |
|---|---|
| 1 | r = ms − e, dist = float(r·0.001·v) |
| 2 | 0x633840(dist, r, u); on 0: 0x615ae0(r), +0x58 −= r, e = ms, and the loop ends |
| 3 | save the GUID +0x38, the speed +0x84, the flags, and F = (0x2000 set and +0xa0 ≠ 0) |
| 4 | one resolver (Resolver dispatch); e += its return |
| 5 | 0x61a820(time + e, ms − e, saved flags, F, GUID changed) |
| 6 | with 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
- CMovement::ResolveStep collision
Callees 9
- CMovement::SkipTime collision
- CMovement::BroadcastStateChange collision
- CMovement::RefreshGroundNormal collision
- CMovement::QuerySweptBox collision
- CMovement::ResolveFreeMove collision
- CMovement::ResolveFall collision
- CMovement::ResolveWalk collision
- CMovement::TransportToWorld collision
- CMovement::UpdateCurrentSpeed collision
Calls and jumps by a bare address, from tables/calls.tsv.