s_displacementCaseIndex
global · collision
- Address
0x7c547c· 15 bytes, up to0x7c548a- Type
uint8_t[15]- Meaning
- Holds the case index for modes 1 to 15 of the displacement dispatcher
- Confidence
- verified, proof one
- Finding
- collision/kinematics#displacement-dispatcher
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) | handler | returns |
|---|---|---|
| 0 | none | 1 |
| 1, 4, 5, 12 | 0x7c4ed0, straight line | 1 |
| 2, 8, 10 | none | 0 |
| 3, 6, 7, 14 | 0x7c52c0, turn arc | 1 |
| 9, 13 | 0x7c5180, pitch arc | 1 |
| 11, 15 | 0x7c4fd0, turn and pitch | 1 |
With no handler out is untouched; every caller zeroes it first.
The derivation is in the doc.