pub struct VisualBuilder { /* private fields */ }Expand description
The builder for Visual components.
The VisualBuilder is used to construct Visual elements of Links.
This will configure the visual data:
geometry: The geometry used for visualization.material(Optional): The material is used to control the appearance of thegeometry.transform(Optional): The transform from theLinkframe to thegeometry.name(Optional): The string identifier (or name) of this visual element. For practical purposes, it is recommended to use unique identifiers/names.
They can be added to a LinkBuilder while constructing a Link by calling add_visual.
A VisualBuilder can be converted to a CollisionBuilder to make defining Collision easier.
WARNING: It is not recommended to use high-detail meshes for collision geometries, since this will slow down the collision checking process.
Also, keep in mind, that some simulators only support the use of convex meshes for collisions, if at all.
Implementations§
Source§impl VisualBuilder
impl VisualBuilder
Sourcepub fn new(
geometry: impl Into<Box<dyn GeometryInterface + Sync + Send>>,
) -> Self
pub fn new( geometry: impl Into<Box<dyn GeometryInterface + Sync + Send>>, ) -> Self
Create a new VisualBuilder with the specified Geometry.
Sourcepub fn new_full(
name: Option<String>,
transform: Option<Transform>,
geometry: impl Into<Box<dyn GeometryInterface + Sync + Send>>,
material_description: Option<MaterialDescriptor>,
) -> Self
pub fn new_full( name: Option<String>, transform: Option<Transform>, geometry: impl Into<Box<dyn GeometryInterface + Sync + Send>>, material_description: Option<MaterialDescriptor>, ) -> Self
Create a new VisualBuilder with all fields specified.
Sourcepub fn transformed(self, transform: Transform) -> Self
pub fn transformed(self, transform: Transform) -> Self
Specify a transform for this VisualBuilder.
The default is a no transformation (The frame of the Visual will be the same as the frame of the parent Link).
Sourcepub fn materialized(self, material_description: MaterialDescriptor) -> Self
pub fn materialized(self, material_description: MaterialDescriptor) -> Self
Specify a material for this VisualBuilder.
The default is no material.
Sourcepub fn to_collision(&self) -> CollisionBuilder
pub fn to_collision(&self) -> CollisionBuilder
Creates a CollisionBuilder from this VisualBuilder reference by lossy conversion.
Creates a CollisionBuilder from the VisualBuilder by cloning the following fields:
nametransformgeometry
Source§impl VisualBuilder
Non-builder methods
impl VisualBuilder
Non-builder methods
Sourcepub fn name(&self) -> Option<&String>
pub fn name(&self) -> Option<&String>
Gets an optional reference to the name of this VisualBuilder.
Sourcepub fn transform(&self) -> Option<&Transform>
pub fn transform(&self) -> Option<&Transform>
Gets an optional reference to the transform of this VisualBuilder.
Sourcepub fn geometry(&self) -> &Box<dyn GeometryInterface + Sync + Send>
pub fn geometry(&self) -> &Box<dyn GeometryInterface + Sync + Send>
Gets a reference to the geometry of this VisualBuilder.
Sourcepub fn material(&self) -> Option<&MaterialDescriptor>
pub fn material(&self) -> Option<&MaterialDescriptor>
Gets an optional reference to the MaterialDescriptor of this VisualBuilder.
Trait Implementations§
Source§impl Clone for VisualBuilder
impl Clone for VisualBuilder
Source§impl Debug for VisualBuilder
impl Debug for VisualBuilder
Source§impl GroupIDChanger for VisualBuilder
impl GroupIDChanger for VisualBuilder
Source§unsafe fn change_group_id_unchecked(&mut self, new_group_id: &str)
unsafe fn change_group_id_unchecked(&mut self, new_group_id: &str)
Source§fn apply_group_id(&mut self)
fn apply_group_id(&mut self)
GroupID delimiter replacements. Read moreSource§fn change_group_id(
&mut self,
new_group_id: impl GroupID,
) -> Result<(), GroupIDError>
fn change_group_id( &mut self, new_group_id: impl GroupID, ) -> Result<(), GroupIDError>
Source§impl PartialEq for VisualBuilder
impl PartialEq for VisualBuilder
Auto Trait Implementations§
impl Freeze for VisualBuilder
impl !RefUnwindSafe for VisualBuilder
impl Send for VisualBuilder
impl Sync for VisualBuilder
impl Unpin for VisualBuilder
impl !UnwindSafe for VisualBuilder
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> 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.