ShipSpanDistanceAtTime
function · objectlayer · primitive
- Address
0x5f8dc0· 463 bytes, up to0x5f8f8e- Signature
float __thiscall (void *this, float t, float span, uint32_t *state, uint32_t accelerates, uint32_t decelerates)- Meaning
- Returns the distance t seconds into a span of constant acceleration and its animation state
- Confidence
- verified, proof two
- Finding
- objectlayer/transports#speed-curve
- Test
objectlayer::transport_speed_easing_difftest,objectlayer::transport_speed_easing_special_values_difftest,objectlayer::ship_path_tick_difftest
Finding: Speed curve in objectlayer: transports
0x5f8dc0(t, T, state, accelerates, decelerates) gives the distance covered t seconds into a span
of T seconds and its animation: 0xa2 speeding up, 0xa3 cruising, 0xa4 slowing down.
| span | distance |
|---|---|
| neither | t·v, 0xa3 |
| speeds up | t ≤ r: ((t·a)·0.5)·t, 0xa2; else (t − ta)·v + (v·0.5)·ta, 0xa3 |
| slows down | t ≤ T − r: t·v, 0xa3; else ((2·(r·a) − d·a)·0.5)·d + (T − r)·v, 0xa4 |
| both | t > T − r: ((2·(r·a) − d·a)·0.5)·d + (T − 2r)·v + ((r·a)·0.5)·r, 0xa4; t ≤ r: as speeding up; else as cruising |
ta = v / a; r = min(T, ta), and min(T·0.5, ta) for both; d = t − (T − r).
The derivation is in the doc.
Callers 1
- MovingTransportHandlerOnTick objectlayer
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.