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§
Sourcefn local_contacts<F: FnMut(LocalContact)>(&self, rhs: &RHS, callback: F) -> bool
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§
Sourcefn last_local_contact(&self, rhs: &RHS) -> Option<LocalContact>
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.