Trait mgf::Contacts[][src]

pub trait Contacts<RHS> {
    fn contacts<F: FnMut(Contact)>(&self, rhs: &RHS, callback: F) -> bool;

    fn last_contact(&self, rhs: &RHS) -> Option<Contact> { ... }
}

A type that can produce a point of contact with another.

Contacts models a hybrid discrete/continuous approach to collision detection that uses continuous detection to find precise contact points and collision normals over discrete timesteps.

Either the type implementing Contacts or the type paramater must be Volumetric. Both can be as well. In addition, at least one of the types must be Moving in some way.

A Contact collision can potentially produce multiple contacts, in the case of Capsule/Polygon collision and Compound collisions. This is handled by passing a closure to the collision handler.

Required Methods

Calls the closure for each contact found. Returns true if any contact was found.

Provided Methods

Returns the last contact found, if one exists.

Implementors