Skip to content

Scene System

The Scene System provides a high-performance simulation environment that bridges the gap between game engine mechanics (ECS) and content interchange (USD).

  • Hybrid Architecture: Combines Flecs (Entity Component System) for runtime performance with USD (Universal Scene Description) for persistent storage.
  • Schema-Driven Sync: Network replication is defined by data schemas. You define the data structure, and the system handles delta compression and transport.
  • Lifecycle Management: Supports both Transient (temporarily in-memory) and Persistent (saved to disk) scenes.

The SceneGraph wraps the underlying ECS to provide a familiar, object-oriented hierarchy API.

SceneGraph graph;
auto parent = graph.createEntity("Car");
auto wheel = graph.createEntity("Wheel");
// Hierarchy is managed automatically
graph.setParent(wheel, parent);

Seamlessly move data between the runtime simulation and USD format.

// Import a level (requires Stage + USDA content)
usdService.importUsdIntoWorld(world, stage, usdaContent);
// Export the current state
auto usda = usdService.exportWorldToUsd(world, stage);

Components registered with the system automatically synchronize across the network.

// 1. Setup observers (one-time)
client.setupBuiltinSyncObservers(world);
// 2. Changes are now instantly replicated
entity.set<Transform>({0, 10, 0});