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 Planeimpl Contacts<Moving<Component>> for Triangleimpl Contacts<Moving<Component>> for Rectangleimpl Contacts<Moving<Component>> for Sphereimpl Contacts<Moving<Component>> for Capsuleimpl<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 Planeimpl Contacts<Moving<Capsule>> for Planeimpl Contacts<Plane> for Moving<Sphere>impl Contacts<Plane> for Moving<Capsule>impl<Poly: Polygon> Contacts<Moving<Sphere>> for Polyimpl 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 Polyimpl Contacts<Moving<Sphere>> for Sphereimpl Contacts<Moving<Capsule>> for Sphereimpl Contacts<Moving<Sphere>> for Capsuleimpl Contacts<Moving<Capsule>> for Capsuleimpl<Recv, Arg> Contacts<Arg> for Moving<Recv> where
Arg: Shape + Copy,
Recv: Contacts<Moving<Arg>> + Shape + Copy,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>,impl<RHS> Contacts<RHS> for RigidBody where
RHS: Contacts<Moving<Component>> + BoundedBy<AABB>,impl<'a, S, RHS> Contacts<RHS> for StaticBody<'a, S> where
S: Contacts<RHS> + Shape,