Trait LocalContacts

Source
pub trait LocalContacts<RHS> {
    // Required method
    fn local_contacts<F: FnMut(LocalContact)>(
        &self,
        rhs: &RHS,
        callback: F,
    ) -> bool;

    // Provided method
    fn last_local_contact(&self, rhs: &RHS) -> Option<LocalContact> { ... }
}
Expand description

A type that can produce a point of contact with another and convert it to local coordinates.

Because the points in a Contact are global at the time of collision, they are not immediately useful to physics resolution. Upon being translated to local coordinates, which refer to the points as if the origin was the center of the object they belong to.

Required Methods§

Source

fn local_contacts<F: FnMut(LocalContact)>(&self, rhs: &RHS, callback: F) -> bool

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

Provided Methods§

Source

fn last_local_contact(&self, rhs: &RHS) -> Option<LocalContact>

Returns the last contact found, if one exists.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl LocalContacts<Moving<Component>> for Moving<Component>

Source§

impl<Recv, Arg> LocalContacts<Moving<Arg>> for Moving<Recv>
where Recv: Contacts<Moving<Arg>> + Shape + Copy, Arg: Shape + Copy,

Source§

impl<Recv, Arg> LocalContacts<Moving<Arg>> for Recv
where Recv: Contacts<Moving<Arg>> + Shape, Arg: Shape + Copy,

Source§

impl<Recv, Arg> LocalContacts<Arg> for Moving<Recv>
where Recv: Shape + Copy, Arg: Contacts<Moving<Recv>> + Shape,

Source§

impl<Recv, Arg> LocalContacts<Arg> for Recv
where Recv: Contacts<Arg> + Shape + Delta, Arg: Shape + Delta,