Skip to main content

spawn_scene

Function spawn_scene 

Source
pub fn spawn_scene<R: WorldRunner>(
    host: &mut World,
    render: WorldHandle,
    audio_setup: AudioSetup,
    panels: PanelSlots,
    input: &InputWriter,
    automatic_drops: bool,
) -> SceneHandles
Expand description

Build the scene’s worlds with the runner R: on their own threads, or stepped by the host.

The worlds are spawned in the order they depend on each other — physics first, so the wiring can subscribe to its state, then audio, then the gameplay world with its objects.

input is the writer the host feeds. The gameplay world is a sibling of the host rather than a world nested inside it, so nothing distributes the writer to it: it subscribes here, once, before its first tick. A run with no input of its own — the headless capture — passes a writer nothing is fed, and the panel still lays its frames out.