Skip to main content

Module transform

Module transform 

Source
Expand description

The map’s camera: the commands, animations, gestures and momentum that move it within its limits.

Each command is a transition whose frame function takes the state and returns the camera at the command’s progress, which apply_transitions composes with the other commands’ cameras. The transform calls no observer: it queues what happens as TransformEvents, which its owner drains once the call returns, so no callback runs while the transform changes. Over terrain, the rules of terrain stand the camera on the ground and keep its eye above it.

Structs§

CameraCommandId
Identifies a camera command that the transform started, in the TransformEvent::CommandEnded that reports its end. Each command the transform starts gets its own.
CommandEnd
How a camera command ended.
FrameClock
The time of the latest frame that a map’s host drew, which the map’s animations sample at and its camera commands start from (see Transform::set_frame_time). A clone shares the clock, so the thread that draws can set it while the map lives on another.
TerrainGround
The terrain the camera stands on, which the map hands the transform while its style’s terrain draws outside tile mode, on every projection.
Transform

Enums§

TransformEvent
What the transform reports, in order, for its owner to drain with Transform::drain_events.

Constants§

STALE_FRAME_TIME
A frame time older than this is stale, and counts as unset (see Transform::set_frame_time): longer than a frame at 10 fps, so any host that draws sets a fresh one first.