pub struct MjViewer<'m> { /* private fields */ }Expand description
A Rust-native implementation of the MuJoCo viewer. To confirm to rust safety rules,
the viewer doesn’t store a mutable reference to the MjData struct, but it instead
accepts it as a parameter at its methods.
Currently supported (to be expanded in the future):
- Visualization of the 3D scene,
- Close via Ctrl + Q or by closing the window,
- Body tracking via Ctrl + double left-click,
- Escape from tracked camera via Esc.
Only passive mode is available, which means the user must call MjViewer::sync
to update the state inside the viewer.
Implementations§
Source§impl<'m> MjViewer<'m>
impl<'m> MjViewer<'m>
Sourcepub fn launch_passive(
model: &'m MjModel,
scene_max_ngeom: usize,
) -> Result<Self, MjViewerError>
pub fn launch_passive( model: &'m MjModel, scene_max_ngeom: usize, ) -> Result<Self, MjViewerError>
Launches the MuJoCo viewer. A Result struct is returned that either contains
MjViewer or a MjViewerError.
Trait Implementations§
Auto Trait Implementations§
impl<'m> Freeze for MjViewer<'m>
impl<'m> RefUnwindSafe for MjViewer<'m>
impl<'m> !Send for MjViewer<'m>
impl<'m> !Sync for MjViewer<'m>
impl<'m> Unpin for MjViewer<'m>
impl<'m> UnwindSafe for MjViewer<'m>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more