CMovement::SetFacing
function · collision · primitive
- Address
0x7c6f30· 57 bytes, up to0x7c6f68- Signature
void __thiscall (CMovement *this, float facing)- Meaning
- Stores a facing that differs by 2^-20 or more, re-anchoring when not falling, and clears 0x10 and 0x20
- Confidence
- verified, proof one
- Finding
- collision/commands#facing-and-pitch-setters
- Test
collision::tf_setfacing_should_store_difftest
Finding: Facing and pitch setters in collision: commands
0x7c6f30(f) stores f at +0x1c when |f − +0x1c| is 2⁻²⁰ or more, or NaN, and then
re-anchors unless falling; it always clears 0x10 and 0x20. 0x7c6eb0(f) subtracts the
transport's facing (0x630b70, or 0.0 without a transport at +0x38), rounds to float, wraps
once (minus 2π above 2π, plus 2π below 0), and calls 0x7c6f30. 0x7c6f70(p) returns 0 after
clearing 0x40 and 0x80 when |p − +0x20| is below 2⁻²⁰. Otherwise it stores p (0x7c6f91).
Swimming, it re-anchors. Not swimming, with water walking (0x10000000), none of 0x200f, and
p ≤ −0.6457718 (−37°, 0x80dfe8), it calls 0x7c61c0 and returns 1 when that does. It clears
0x40 and 0x80 on every path. It applies no clamp.
The derivation is in the doc.
Callers 2
- CMovement::UpdatePlayerMovement collision
- CMovement::SetWorldFacing collision
Callees 1
- CMovement::UpdateAnchors collision
Calls and jumps by a bare address, from tables/calls.tsv.