Struct ncollide2d::query::ContactManifold
source · pub struct ContactManifold<N: Real> { /* private fields */ }
Expand description
A contact manifold.
A contat manifold is a set of contacts lying on the same plane. The convex hull of those contacts are often interpreted as a contact surface. This structure is responsible for matching new contacts with old ones in order to perform an approximat tracking of the contact points.
Implementations§
source§impl<N: Real> ContactManifold<N>
impl<N: Real> ContactManifold<N>
sourcepub fn subshape_id1(&self) -> usize
pub fn subshape_id1(&self) -> usize
The identifier of the first sub-shape the contacts of this manifold lie on.
sourcepub fn set_subshape_id1(&mut self, id: usize)
pub fn set_subshape_id1(&mut self, id: usize)
Sets the identifier of the first sub-shape the contacts of this manifold lie on.
sourcepub fn subshape_id2(&self) -> usize
pub fn subshape_id2(&self) -> usize
The identifier of the first sub-shape the contacts of this manifold lie on.
sourcepub fn set_subshape_id2(&mut self, id: usize)
pub fn set_subshape_id2(&mut self, id: usize)
Sets the identifier of the first sub-shape the contacts of this manifold lie on.
sourcepub fn contacts(&self) -> &[TrackedContact<N>]
pub fn contacts(&self) -> &[TrackedContact<N>]
All the contact tracked by this manifold.
sourcepub fn deepest_contact_id(&self) -> usize
pub fn deepest_contact_id(&self) -> usize
The index of the contact with the greatest penetration depth.
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 save_cache_and_clear(&mut self, gen: &mut IdAllocator)
pub fn save_cache_and_clear(&mut self, gen: &mut IdAllocator)
Save the contacts to a cache and empty the manifold.
sourcepub fn push(
&mut self,
contact: Contact<N>,
kinematic: ContactKinematic<N>,
gen: &mut IdAllocator
) -> bool
pub fn push(
&mut self,
contact: Contact<N>,
kinematic: ContactKinematic<N>,
gen: &mut IdAllocator
) -> 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 identifer.
Trait Implementations§
Auto Trait Implementations§
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<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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.