pub struct CollisionBuilder { /* private fields */ }
Expand description
The builder for Collision
components.
The CollisionBuilder
is used to construct Collision
elements of Links
.
This will configure the collision data:
geometry
: The geometry used for collision checking1.transform
(Optional): The transform from theLink
frame to thegeometry
.name
(Optional): The string identifier (or name) of this collision 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_collider
.
A CollisionBuilder
can be converted to a VisualBuilder
to make defining Visual
easier.
If this is used, it might be easier to first create the VisualBuilder
, and convert that back to a CollisionBuilder
, since it contains more information.
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 CollisionBuilder
impl CollisionBuilder
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 CollisionBuilder
with the specified Geometry
.
Sourcepub fn new_full(
name: Option<String>,
transform: Option<Transform>,
geometry: impl Into<Box<dyn GeometryInterface + Sync + Send>>,
) -> Self
pub fn new_full( name: Option<String>, transform: Option<Transform>, geometry: impl Into<Box<dyn GeometryInterface + Sync + Send>>, ) -> Self
Create a new CollisionBuilder
with all fields specified.
Sourcepub fn transformed(self, transform: Transform) -> Self
pub fn transformed(self, transform: Transform) -> Self
Specify a transform
for this CollisionBuilder
.
The default is a no transformation (The frame of the Collision
will be the same as the frame of the parent Link
).
Sourcepub fn to_visual(&self) -> VisualBuilder
pub fn to_visual(&self) -> VisualBuilder
Creates a VisualBuilder
from this CollisionBuilder
reference by upgrading.
Creates a VisualBuilder
from the CollisionBuilder
by cloning the following fields:
name
transform
geometry
The other fields are left empty, since they are optional.
Trait Implementations§
Source§impl Clone for CollisionBuilder
impl Clone for CollisionBuilder
Source§impl Debug for CollisionBuilder
impl Debug for CollisionBuilder
Source§impl From<CollisionBuilder> for Collision
impl From<CollisionBuilder> for Collision
Source§fn from(value: CollisionBuilder) -> Self
fn from(value: CollisionBuilder) -> Self
Source§impl GroupIDChanger for CollisionBuilder
impl GroupIDChanger for CollisionBuilder
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 CollisionBuilder
impl PartialEq for CollisionBuilder
Auto Trait Implementations§
impl Freeze for CollisionBuilder
impl !RefUnwindSafe for CollisionBuilder
impl Send for CollisionBuilder
impl Sync for CollisionBuilder
impl Unpin for CollisionBuilder
impl !UnwindSafe for CollisionBuilder
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.