Implementation:Google deepmind Mujoco Studio App
| Knowledge Sources | |
|---|---|
| Domains | Application, Simulation, GUI |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Implements the main MuJoCo Studio application, orchestrating model loading, simulation stepping, GUI construction, rendering, and user interaction.
Description
app.cc is the central implementation of the MuJoCo Studio application (mujoco::studio::App). It coordinates all subsystems: model loading (from file, buffer, or spec), physics simulation stepping via StepControl, scene rendering via Renderer, user interaction via the platform Interaction module, and the full GUI overlay built from platform GUI panels. The file defines toolbar icon constants from FontAwesome, helper functions like ToggleFlag, ToggleWindow, and SelectParentPerturb, and manages the interaction between simulation state (mjModel, mjData), visualization state (mjvOption, mjvCamera, mjvPerturb), and the rendering pipeline.
Usage
Instantiated as the top-level application object in MuJoCo Studio. The main loop calls Update() to process events and advance simulation, BuildGui() to construct the ImGui interface, and the renderer to produce each frame. Models can be loaded interactively through the GUI or programmatically via LoadModelFromFile and LoadModelFromBuffer.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/experimental/studio/app.cc
- Lines: 1-1849
Key Functions
static void ToggleFlag(mjtByte& flag);
static void ToggleWindow(bool& window);
static void SelectParentPerturb(const mjModel* model, mjvPerturb& perturb);
// App::Update(), App::BuildGui(), App::LoadModelFromFile(), App::LoadModelFromBuffer()
// Uses PauseState from platform::StepControl
Import
#include "experimental/studio/app.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config | App::Config | Yes | Window dimensions, INI path, offscreen mode |
| filepath | std::string | No | Path to .xml, .mjb, or .mjz model file |
| buffer | std::span<const std::byte> | No | In-memory model data with content type |
Outputs
| Name | Type | Description |
|---|---|---|
| Rendered frame | Window surface | Rendered simulation scene with GUI overlay |
| Updated simulation | mjModel*/mjData* | Advanced simulation state |