CMovementData::CalcDirection
function · collision · primitive
- Address
0x7c5a20· 508 bytes, up to0x7c5c1b- Signature
void __thiscall (CMovement *this, uint32_t force)- Meaning
- Sets the direction and heading basis for the direction bits, scaling a diagonal by 0.70710677
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- Finding
- collision/kinematics#direction-and-heading-basis
- Test
collision::velocity_vector_difftest
Finding: Direction and heading basis in collision: kinematics
0x7c5880 sets the basis h = (+0x68, +0x6c) = (fl(cos F), fl(sin F)), F = +0x50. Swimming
(0x00200000) with |P| ≥ 2⁻²⁰ or NaN, P = +0x54, it sets (+0x70, +0x74) = (fl(cos P), fl(sin P)) and d = +0x5c = (fl(h.x·+0x70), fl(h.y·+0x70), +0x74); else d = (h, 0) and
(+0x70, +0x74) = (1, 0). 0x7c5a20(force) calls it and then turns d and h by the
direction bits, first match (− applies for 0x2, √½ = 0.70710677, 0x3f3504f3):
| bits | d | h |
|---|---|---|
0x2000 with force 0 | not written | not written |
0x3 and 0xc | (±d + (s, 0))·√½ | (±h + s)·√½ |
0x3 | ±d | ±h |
0x4 | (s, 0), s = (−sin F, cos F) | s |
0x8 | (s, 0), s = (sin F, −cos F) | s |
The derivation is in the doc.
Callers 3
- CMovement::CMovement collision
- CMovement::ApplyStatusIfDue collision
- CMovement::UpdateAnchors collision
Callees 2
- SetVector3 spline
- CMovement::CalcBaseDirection collision
Calls and jumps by a bare address, from tables/calls.tsv.