loadScene(newConfig)
Load a new model, replacing the current scene entirely.New scene configuration. See Loading Models for all fields.
Promise<void> — resolves when the new model is loaded and ready.
This method:
- Fetches the new model files
- Applies XML patches and injects scene objects
- Compiles the model with
mj_loadXML - Creates new model/data objects
- Rebuilds the scene graph (SceneRenderer will re-render)
- Fires the
onReadycallback with the updated API
Example: Robot Switcher
Utility Functions
These standalone functions are exported for advanced use cases (e.g., building custom loaders).getName(model, address)
Read a null-terminated C string from the WASM model’s name buffer.find*ByName(model, name)
Look up element indices by name. All return-1 if not found.