MovingTransportHandlerOnTick
function · objectlayer · primitive
- Address
0x5f50a0· 1118 bytes, up to0x5f54fd- Signature
void __thiscall (void *this, uint32_t now, uint32_t elapsed)- Meaning
- Moves a ship along its path at a time: stops, speed curve, spline frame, entity, passengers, leg change
- Confidence
- verified, proof two
- Finding
- objectlayer/transports#moving-the-ship
- Test
objectlayer::g3_transport_ms_scale,objectlayer::g3_transport_leg_fraction,objectlayer::g3_transport_heading,objectlayer::g3_transport_heading_angle,objectlayer::ship_path_tick_difftest
Finding: Moving the ship in objectlayer: transports
Each tick takes t = (now + +0x278) mod the period (1 when 0) and the first leg ending after t.
Within a stop's wait the ship sits at the stop, animation 0; past it the span starts there. Else
the speed curve gives the distance into the span, T and t in seconds. The fraction of the leg,
clamped to [0, 1] with NaN as 1, gives the spline frame. The heading is the frame's tangent with
x and y negated and normalised, and the facing its atan2: the ship faces against its tangent. A
leg on another map ends the tick. Else
the position, facing and entity move, and a changed animation plays once the entity is ready.
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 23
- BeginLegLoading loadingscreen
- EndLoadingScreen loadingscreen
- 0x443620 client
- EvaluateSplineFrame spline
- ClntObjMgrObjectPtr objectlayer
- ClntObjMgrGetMapID objectlayer
- GetActiveCamera ui
- NormalizeVector2InPlace objectlayer
- InitIdentityMatrix4x4 objectlayer
- PassengerNodeLink objectlayer
- ShipSpanDistanceAtTime objectlayer
- CGObject_C::UpdateNode objectlayer
- RefreshAllNodes objectlayer
- CWorld::SetLoadProgressCallback terrain
- CWorld::UnloadAreas terrain
- CWorld::IsEntityReady terrain
- CWorld::SetEntityTransform terrain
- CWorld::PlayEntityAnimation terrain
- CWorld::SetEntityCallback terrain
- CM2Model::SetTransportFrame models
- TranslateMatrix cmath
- RotateMatrix cmath
- CMovement::ClearFlagBit27 collision
Calls and jumps by a bare address, from tables/calls.tsv.