pub struct ContactManifold<N: RealField + Copy> { /* private fields */ }
Expand description
A contact manifold.
A contact manifold is a set of contacts between two shapes. If the shapes are convex, then the convex hull of those contacts are often interpreted as surface. This structure is responsible for matching new contacts with old ones in order to perform an approximate tracking of the contact points.
Implementations§
Source§impl<N: RealField + Copy> ContactManifold<N>
impl<N: RealField + Copy> ContactManifold<N>
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes a contact manifold without any contact.
The default contact tracking mode is set to ContactTrackingMode::DistanceBased(0.02)
.
Sourcepub fn contacts(&self) -> impl Iterator<Item = &TrackedContact<N>>
pub fn contacts(&self) -> impl Iterator<Item = &TrackedContact<N>>
All the contact tracked by this manifold.
Sourcepub fn contacts_mut(&mut self) -> impl Iterator<Item = &mut TrackedContact<N>>
pub fn contacts_mut(&mut self) -> impl Iterator<Item = &mut TrackedContact<N>>
Mutable reference to all the contact tracked by this manifold.
Sourcepub fn deepest_contact(&self) -> Option<&TrackedContact<N>>
pub fn deepest_contact(&self) -> Option<&TrackedContact<N>>
The contact of this manifold with the deepest penetration depth.
Sourcepub fn tracking_mode(&self) -> ContactTrackingMode<N>
pub fn tracking_mode(&self) -> ContactTrackingMode<N>
Gets the technique currently used for tracking contacts.
Sourcepub fn set_tracking_mode(&mut self, mode: ContactTrackingMode<N>)
pub fn set_tracking_mode(&mut self, mode: ContactTrackingMode<N>)
Sets the technique used for tracking contacts.
If the selected method is different from the current one, the current contact cache is cleared.
Sourcepub fn save_cache_and_clear(&mut self)
pub fn save_cache_and_clear(&mut self)
Save the contacts to a cache and empty the manifold.
Sourcepub fn push(
&mut self,
contact: Contact<N>,
kinematic: ContactKinematic<N>,
tracking_pt: Point<N>,
preprocessor1: Option<&dyn ContactPreprocessor<N>>,
preprocessor2: Option<&dyn ContactPreprocessor<N>>,
) -> bool
pub fn push( &mut self, contact: Contact<N>, kinematic: ContactKinematic<N>, tracking_pt: Point<N>, preprocessor1: Option<&dyn ContactPreprocessor<N>>, preprocessor2: Option<&dyn ContactPreprocessor<N>>, ) -> bool
Add a new contact to the manifold.
The manifold will attempt to match this contact with another one
previously added and added to the cache by the last call to
save_cache_and_clear
. The matching is done by spacial proximity, i.e.,
two contacts that are sufficiently close will be given the same identifier.
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for ContactManifold<N>where
N: Freeze,
impl<N> RefUnwindSafe for ContactManifold<N>where
N: RefUnwindSafe,
impl<N> Send for ContactManifold<N>
impl<N> Sync for ContactManifold<N>
impl<N> Unpin for ContactManifold<N>where
N: Unpin,
impl<N> UnwindSafe for ContactManifold<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.