pub trait ContactManifoldGenerator<N: Real>: Any + Send + Sync {
fn update(
&mut self,
dispatcher: &dyn ContactDispatcher<N>,
ida: usize,
ma: &Isometry<N>,
a: &dyn Shape<N>,
idb: usize,
mb: &Isometry<N>,
b: &dyn Shape<N>,
prediction: &ContactPrediction<N>,
id_alloc: &mut IdAllocator
) -> bool;
fn num_contacts(&self) -> usize;
fn contacts<'a: 'b, 'b>(&'a self, out: &'b mut Vec<&'a ContactManifold<N>>);
}
Expand description
Trait implemented algorithms that compute contact points, normals and penetration depths.
Required Methods§
sourcefn update(
&mut self,
dispatcher: &dyn ContactDispatcher<N>,
ida: usize,
ma: &Isometry<N>,
a: &dyn Shape<N>,
idb: usize,
mb: &Isometry<N>,
b: &dyn Shape<N>,
prediction: &ContactPrediction<N>,
id_alloc: &mut IdAllocator
) -> bool
fn update(
&mut self,
dispatcher: &dyn ContactDispatcher<N>,
ida: usize,
ma: &Isometry<N>,
a: &dyn Shape<N>,
idb: usize,
mb: &Isometry<N>,
b: &dyn Shape<N>,
prediction: &ContactPrediction<N>,
id_alloc: &mut IdAllocator
) -> bool
Runs the collision detection on two objects. It is assumed that the same collision detector (the same structure) is always used with the same pair of object.
sourcefn num_contacts(&self) -> usize
fn num_contacts(&self) -> usize
The number of contacts found.
sourcefn contacts<'a: 'b, 'b>(&'a self, out: &'b mut Vec<&'a ContactManifold<N>>)
fn contacts<'a: 'b, 'b>(&'a self, out: &'b mut Vec<&'a ContactManifold<N>>)
Collects the contact manifolds generated by the last update.