Manages a simulation scene that steps asynchronously using the SuperDex Physics worker pool.
More...
|
| virtual void | CancelActorQuery (ActorHandle actor, QueryHandle handle)=0 |
| | Cancel a query previously registered with an actor.
|
| virtual void | CancelCallback (CallbackHandle handle)=0 |
| | Cancel a previously registered callback.
|
| virtual AsyncStepParams | GetAsyncStepParams () const =0 |
| | Get the parameters controlling async stepping behavior.
|
| virtual Context * | GetContext ()=0 |
| | Get the Context that owns this AsyncScene.
|
| virtual bool | IsPaused () const =0 |
| | Check if the simulation is currently paused.
|
| virtual void | Pause (bool shouldPause)=0 |
| | Pause or unpause the simulation.
|
| virtual void | QueueActorCommand (ActorHandle actor, std::function< void(Actor *)> callback)=0 |
| | Queue a command to operate on a specific actor on the simulation thread.
|
| virtual void | QueueCommand (std::function< void(Scene *)> callback)=0 |
| | Queue a command to execute on the simulation thread before the next step.
|
| virtual QueryHandle | RegisterActorQuery (ActorHandle actor, QueryType type, bool forceCompute=false)=0 |
| | Register a query with an actor.
|
| virtual CallbackHandle | RegisterPostStepCallback (std::string_view debugName, std::function< void(StepInfo const &)> callback, int priority=Scene::kDefaultCallbackPriority)=0 |
| | Register a callback to execute after each simulation step.
|
| virtual CallbackHandle | RegisterPreStepCallback (std::string_view debugName, std::function< void(StepInfo const &)> callback, int priority=Scene::kDefaultCallbackPriority)=0 |
| | Register a callback to execute before each simulation step.
|
| virtual void | RequestStepThenPause ()=0 |
| | Advance the simulation by exactly one step, then pause.
|
| virtual void | SetAsyncStepParams (AsyncStepParams const ¶ms, Error &error)=0 |
| | Set the parameters controlling async stepping behavior.
|
| virtual void | WaitForQueuedCommands ()=0 |
| | Block the calling thread until all previously queued commands have executed.
|
Manages a simulation scene that steps asynchronously using the SuperDex Physics worker pool.
AsyncScene wraps a synchronous Scene and automatically steps it using a long-lived simulation task executed by the SuperDex Physics worker pool, decoupling physics updates from the main thread. This enables real-time interactive simulations where physics rate is independent of rendering rate.
- Note
- In general, commands to modify the scene are queued and executed before the next simulation step.
-
Thread-safe as long as the synchronous Scene and Actor APIs are only accessed within callbacks.
-
Outside of callbacks, store ActorHandle (not Actor*).
-
The AsyncScene owns its underlying Scene.
- Warning
- Concurrent access to the underlying Scene outside of callbacks is illegal.
Definition at line 39 of file mochi_async_scene.h.