pub struct MjRendererBuilder { /* private fields */ }
Expand description
A builder for MjRenderer
.
Implementations§
Source§impl MjRendererBuilder
impl MjRendererBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a builder with default configuration. Defaults are:
width
andheight
: use offwidth and offheight of MuJoCo’s visual/global settings from the model,num_visual_internal_geom
: 100,num_visual_user_geom
: 0,rgb
: true,depth
: false.
Sourcepub fn width(self, value: u32) -> Self
pub fn width(self, value: u32) -> Self
Set image width.
The width must be less or equal to the offscreen buffer width, which can be configured at the top of the model’s XML like so:
<visual>
<global offwidth="1920" .../>
</visual>
Sourcepub fn height(self, value: u32) -> Self
pub fn height(self, value: u32) -> Self
Set image height.
The height must be less or equal to the offscreen buffer height, which can be configured at the top of the model’s XML like so:
<visual>
<global offheight="1080" .../>
</visual>
Sourcepub fn num_visual_internal_geom(self, value: u32) -> Self
pub fn num_visual_internal_geom(self, value: u32) -> Self
Set maximum number of additional visual-only internal geoms to allocate for.
Note that the total number of geoms in the internal scene will be
num_visual_internal_geom
+ num_visual_user_geom
.
Sourcepub fn num_visual_user_geom(self, value: u32) -> Self
pub fn num_visual_user_geom(self, value: u32) -> Self
Set maximum number of additional visual-only user geoms (drawn by the user).
Sourcepub fn depth(self, value: bool) -> Self
pub fn depth(self, value: bool) -> Self
Set depth rendering enabled (true) or disabled (false).
Sourcepub fn font_scale(self, value: MjtFontScale) -> Self
pub fn font_scale(self, value: MjtFontScale) -> Self
Set font scale of drawn text (with MjrContext).
Sourcepub fn build(self, model: &MjModel) -> Result<MjRenderer<'_>, RendererError>
pub fn build(self, model: &MjModel) -> Result<MjRenderer<'_>, RendererError>
Builds a MjRenderer
.