Struct ncollide2df64::narrow::IncrementalContactManifoldGenerator
pub struct IncrementalContactManifoldGenerator<CD> { // some fields omitted }
Contact manifold generator which keeps track of several contacts.
One contact is added per update until the maximum number of contact is reached. When the maximum number of contact is reached, each time a new contact is created, the new manifold is computed by maximizing the variance along each canonical axis (of the space in which leaves the contacts).
Methods
impl<CD> IncrementalContactManifoldGenerator<CD>
fn new(prediction: N, cd: CD) -> IncrementalContactManifoldGenerator<CD>
Creates a new incremental contact manifold generator.
Arguments:
cd
- collision detection sub-algorithm used to generate the contact points.
impl<CD: CollisionDetector<G1, G2>, G1, G2> IncrementalContactManifoldGenerator<CD>
fn get_sub_collision(&mut self, m1: &M, g1: &G1, m2: &M, g2: &G2) -> Option<Contact>
Gets a collision from the sub-detector used by this manifold generator. This does not update the manifold itself.
fn add_new_contacts(&mut self, m1: &M, g1: &G1, m2: &M, g2: &G2)
Updates the current manifold by adding one point.
fn update_contacts(&mut self, m1: &M, m2: &M)
Updates the contacts already existing on this manifold.
Trait Implementations
impl<__E: Encoder, CD: Encodable<__E>> Encodable<__E> for IncrementalContactManifoldGenerator<CD>
Automatically derived.
fn encode(&self, __arg_0: &mut __E)
impl<__D: Decoder, CD: Decodable<__D>> Decodable<__D> for IncrementalContactManifoldGenerator<CD>
Automatically derived.
fn decode(__arg_0: &mut __D) -> IncrementalContactManifoldGenerator<CD>
impl<CD: Clone> Clone for IncrementalContactManifoldGenerator<CD>
Automatically derived.
fn clone(&self) -> IncrementalContactManifoldGenerator<CD>
impl<CD: CollisionDetector<G1, G2>, G1, G2> CollisionDetector<G1, G2> for IncrementalContactManifoldGenerator<CD>
fn update(&mut self, m1: &M, g1: &G1, m2: &M, g2: &G2)
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.
fn num_colls(&self) -> uint
The number of collision detected during the last update.
fn colls(&self, out_colls: &mut ~[Contact])
Collects the collisions detected during the last update.
fn toi(_: Option<IncrementalContactManifoldGenerator<CD>>, m1: &M, dir: &V, dist: &N, g1: &G1, m2: &M, g2: &G2) -> Option<N>
Computes the time of impact of two objects.
Arguments
m1
- the first object transform.dir
- the first object displacement direction.dist
- the first object displacement distance.g1
- the first object.m2
- the second object transform.g2
- the second object.