pub struct ContactKinematic<N: RealField + Copy> { /* private fields */ }
Expand description
Local contact kinematic of a pair of solids around two given points.
This is used to update the localization of contact points between two solids from one frame to another. To achieve this, the local shape of the solids around the given points are approximated by either dilated lines (unbounded cylinders), planes, dilated points (spheres).
Implementations§
Source§impl<N: RealField + Copy> ContactKinematic<N>
impl<N: RealField + Copy> ContactKinematic<N>
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes an empty contact kinematic.
All the contact kinematic information must be filled using methods
prefixed by set_
.
Sourcepub fn transform1(&mut self, m: &Isometry<N>)
pub fn transform1(&mut self, m: &Isometry<N>)
Applies the given transformation to the first set of contact information.
Sourcepub fn transform2(&mut self, m: &Isometry<N>)
pub fn transform2(&mut self, m: &Isometry<N>)
Applies the given transformation to the second set of contact information.
Sourcepub fn local1(&self) -> Point<N>
pub fn local1(&self) -> Point<N>
The tracked point in local space of the first solid.
This may not correspond to the contact point in the local space of the first since it does not takes the dilation into account.
Sourcepub fn local2(&self) -> Point<N>
pub fn local2(&self) -> Point<N>
The tracked point in local space of the second solid.
This may not correspond to the contact point in the local space of the second solid since it does not takes the dilation into account.
Sourcepub fn feature1(&self) -> FeatureId
pub fn feature1(&self) -> FeatureId
The shape-dependent identifier of the feature of the first solid on which lies the contact point.
Sourcepub fn feature2(&self) -> FeatureId
pub fn feature2(&self) -> FeatureId
The shape-dependent identifier of the feature of the second solid on which lies the contact point.
Sourcepub fn set_feature1(&mut self, f: FeatureId)
pub fn set_feature1(&mut self, f: FeatureId)
Sets the shape-dependent identifier of the feature of the first solid on which lies the contact point.
Sourcepub fn set_feature2(&mut self, f: FeatureId)
pub fn set_feature2(&mut self, f: FeatureId)
Sets the shape-dependent identifier of the feature of the second solid on which lies the contact point.
Sourcepub fn set_dilation1(&mut self, margin: N)
pub fn set_dilation1(&mut self, margin: N)
Sets the dilation of the first solid.
Sourcepub fn set_dilation2(&mut self, margin: N)
pub fn set_dilation2(&mut self, margin: N)
Sets the dilation of the second solid.
Sourcepub fn approx1(&self) -> &LocalShapeApproximation<N>
pub fn approx1(&self) -> &LocalShapeApproximation<N>
The local approximation of the first shape.
Sourcepub fn approx2(&self) -> &LocalShapeApproximation<N>
pub fn approx2(&self) -> &LocalShapeApproximation<N>
The local approximation of the first shape.
Sourcepub fn approx1_mut(&mut self) -> &mut LocalShapeApproximation<N>
pub fn approx1_mut(&mut self) -> &mut LocalShapeApproximation<N>
The local approximation of the first shape.
Sourcepub fn approx2_mut(&mut self) -> &mut LocalShapeApproximation<N>
pub fn approx2_mut(&mut self) -> &mut LocalShapeApproximation<N>
The local approximation of the second shape.
Sourcepub fn set_approx1(
&mut self,
feature: FeatureId,
point: Point<N>,
geom: NeighborhoodGeometry<N>,
)
pub fn set_approx1( &mut self, feature: FeatureId, point: Point<N>, geom: NeighborhoodGeometry<N>, )
Sets the local approximation of the first shape.
Sourcepub fn set_approx2(
&mut self,
feature: FeatureId,
point: Point<N>,
geom: NeighborhoodGeometry<N>,
)
pub fn set_approx2( &mut self, feature: FeatureId, point: Point<N>, geom: NeighborhoodGeometry<N>, )
Sets the local approximation of the second shape.
Sourcepub fn contact(
&self,
m1: &Isometry<N>,
s1: &dyn Shape<N>,
deformations1: Option<&[N]>,
m2: &Isometry<N>,
s2: &dyn Shape<N>,
deformations2: Option<&[N]>,
default_normal1: &Unit<Vector<N>>,
) -> Option<Contact<N>>
pub fn contact( &self, m1: &Isometry<N>, s1: &dyn Shape<N>, deformations1: Option<&[N]>, m2: &Isometry<N>, s2: &dyn Shape<N>, deformations2: Option<&[N]>, default_normal1: &Unit<Vector<N>>, ) -> Option<Contact<N>>
Computes the updated contact points with the new positions of the solids.
The vector default_normal1
is the normal of the resulting contact
in the rare case where the contact normal cannot be determined by the update.
Typically, this should be set to the latest contact normal known.
Trait Implementations§
Source§impl<N: Clone + RealField + Copy> Clone for ContactKinematic<N>
impl<N: Clone + RealField + Copy> Clone for ContactKinematic<N>
Source§fn clone(&self) -> ContactKinematic<N>
fn clone(&self) -> ContactKinematic<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl<N: Copy + RealField + Copy> Copy for ContactKinematic<N>
Auto Trait Implementations§
impl<N> Freeze for ContactKinematic<N>where
N: Freeze,
impl<N> RefUnwindSafe for ContactKinematic<N>where
N: RefUnwindSafe,
impl<N> Send for ContactKinematic<N>
impl<N> Sync for ContactKinematic<N>
impl<N> Unpin for ContactKinematic<N>where
N: Unpin,
impl<N> UnwindSafe for ContactKinematic<N>where
N: UnwindSafe,
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>
. Box<dyn Any>
can
then be further downcast
into Box<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>
. Rc<Any>
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> DowncastSync for T
impl<T> DowncastSync for T
Source§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.