Refactor Viewer to be a base class owning the communication with the simulation, handler registry, core visualization objects and the render function
ViewerApp is simplified, interacting with the endpoint and handlers through the Viewer instance. This change makes it possible to write simulation viewers without using the UI/UX provided by ViewerApp (which should be renamed StudioApp) PiperOrigin-RevId: 943642660 Change-Id: Id8eb3d4e6a27ceda93833367fec4699fa6bc838e
This commit is contained in:
committed by
Copybara-Service
parent
ae58855c15
commit
8079ab3d4d
@@ -116,9 +116,25 @@ class ResetEvent(Event):
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ModelEvent(Event):
|
||||
"""An event that transports a MuJoCo model."""
|
||||
"""An event that transports a MuJoCo model.
|
||||
|
||||
Attributes:
|
||||
model: The compiled MuJoCo model.
|
||||
path: Optional file path the model was loaded from.
|
||||
"""
|
||||
|
||||
model: mujoco.MjModel
|
||||
path: str = ''
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class BuildGuiEvent(Event):
|
||||
"""Lifecycle event dispatched on every frame on the viewer side to build ImGui elements."""
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class UpdateEvent(Event):
|
||||
"""Lifecycle event dispatched on every frame on the viewer side before building GUI."""
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
|
||||
Reference in New Issue
Block a user