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
fn contacts<F: FnMut(Contact)>(&self, rhs: &RHS, callback: F) -> bool
Calls the closure for each contact found. Returns true if any contact was found.
Provided Methods
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
Returns the last contact found, if one exists.
Implementors
impl Contacts<Moving<Component>> for Plane
impl Contacts<Moving<Component>> for Triangle
impl Contacts<Moving<Component>> for Rectangle
impl Contacts<Moving<Component>> for Sphere
impl Contacts<Moving<Component>> for Capsule
impl<RHS> Contacts<RHS> for Moving<Component> where
RHS: Contacts<Moving<Sphere>> + Contacts<Moving<Capsule>>,impl<RHS> Contacts<RHS> for Compound where
RHS: Contacts<Component> + BoundedBy<AABB>,impl Contacts<Moving<Sphere>> for Plane
impl Contacts<Moving<Capsule>> for Plane
impl Contacts<Plane> for Moving<Sphere>
impl Contacts<Plane> for Moving<Capsule>
impl<Poly: Polygon> Contacts<Moving<Sphere>> for Poly
impl Contacts<Triangle> for Moving<Sphere>
impl Contacts<Rectangle> for Moving<Sphere>
impl Contacts<Triangle> for Moving<Capsule>
impl Contacts<Rectangle> for Moving<Capsule>
impl<Poly: Polygon> Contacts<Moving<Capsule>> for Poly
impl Contacts<Moving<Sphere>> for Sphere
impl Contacts<Moving<Capsule>> for Sphere
impl Contacts<Moving<Sphere>> for Capsule
impl Contacts<Moving<Capsule>> for Capsule
impl<Recv, Arg> Contacts<Arg> for Moving<Recv> where
Arg: Shape + Copy,
Recv: Contacts<Moving<Arg>> + Shape,impl<Recv, Arg> Contacts<Moving<Arg>> for Moving<Recv> where
Recv: Contacts<Moving<Arg>> + Shape + Copy,
Arg: Shape + Copy,impl<RHS> Contacts<RHS> for Mesh where
RHS: Contacts<Triangle> + Contacts<Rectangle> + BoundedBy<AABB>,