pub struct MjcfVisualMesh {
pub shape: SharedShape,
pub local_pose: Pose,
pub rgba: Option<[f32; 4]>,
pub uvs: Option<Vec<[f32; 2]>>,
pub normals: Option<Vec<[f32; 3]>>,
pub texture: Option<PathBuf>,
pub material: Option<MjcfRenderMaterial>,
}Expand description
A render-only mesh declared by an MJCF <geom> (typically a
<geom type="mesh"> with contype = conaffinity = 0). The loader
surfaces these so the caller can render them attached to the parent
body without inserting them into the physics collider set.
Fields§
§shape: SharedShapeShape, ready to be handed to a renderer.
local_pose: PosePose of the mesh in the body’s local frame.
rgba: Option<[f32; 4]>Resolved color, prioritized in this order: <geom rgba> over the
MJCF <material rgba> over the OBJ MTL diffuse color. None
when no source set one — the caller’s fallback applies.
uvs: Option<Vec<[f32; 2]>>Per-vertex texture coordinates parallel to the shape’s vertex
buffer. Some only for mesh geoms loaded from an asset that
carried UV data; None for primitives and for meshes whose
source didn’t include texture coordinates.
normals: Option<Vec<[f32; 3]>>Per-vertex normals parallel to the shape’s vertex buffer. Computed
from the geometry (crease-aware smoothing, honoring the asset’s
smoothnormal) the way MuJoCo generates mesh normals — faceted
sources like STL carry no usable shared-vertex normals of their own.
Some for mesh geoms; None for primitives. When present, a
renderer should use these directly instead of recomputing flat
per-face normals, so meshes render smooth-shaded like MuJoCo’s
viewer rather than faceted.
texture: Option<PathBuf>Resolved filesystem path to a 2D color texture. Pulled from the
MJCF <material texture=…> when set, otherwise from the OBJ
MTL’s map_Kd. None for geoms that aren’t textured.
material: Option<MjcfRenderMaterial>PBR shading parameters resolved from the geom’s <material>. None
when the geom references no material — the renderer then keeps its own
default shading rather than being forced to a metallic-roughness look.
Trait Implementations§
Source§impl Clone for MjcfVisualMesh
impl Clone for MjcfVisualMesh
Source§fn clone(&self) -> MjcfVisualMesh
fn clone(&self) -> MjcfVisualMesh
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MjcfVisualMesh
impl !UnwindSafe for MjcfVisualMesh
impl Freeze for MjcfVisualMesh
impl Send for MjcfVisualMesh
impl Sync for MjcfVisualMesh
impl Unpin for MjcfVisualMesh
impl UnsafeUnpin for MjcfVisualMesh
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.