Trait ncollide2d::narrow_phase::NarrowPhase [−][src]
pub trait NarrowPhase<N: Real, T>: Any + Send + Sync { fn update(
&mut self,
objects: &CollisionObjectSlab<N, T>,
contact_events: &mut ContactEvents,
proximity_events: &mut ProximityEvents,
timestamp: usize
); fn handle_interaction(
&mut self,
contact_signal: &mut ContactEvents,
proximity_signal: &mut ProximityEvents,
objects: &CollisionObjectSlab<N, T>,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle,
started: bool
); fn handle_removal(
&mut self,
objects: &CollisionObjectSlab<N, T>,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle
); fn contact_pair(
&self,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle
) -> Option<&ContactAlgorithm<N>>; fn contact_pairs<'a>(
&'a self,
objects: &'a CollisionObjectSlab<N, T>
) -> ContactPairs<'a, N, T>; fn proximity_pairs<'a>(
&'a self,
objects: &'a CollisionObjectSlab<N, T>
) -> ProximityPairs<'a, N, T>; }
Trait implemented by the narrow phase manager.
The narrow phase manager is responsible for creating, updating and generating contact pairs between objects identified by the broad phase.
Required Methods
fn update(
&mut self,
objects: &CollisionObjectSlab<N, T>,
contact_events: &mut ContactEvents,
proximity_events: &mut ProximityEvents,
timestamp: usize
)
&mut self,
objects: &CollisionObjectSlab<N, T>,
contact_events: &mut ContactEvents,
proximity_events: &mut ProximityEvents,
timestamp: usize
)
Updates this narrow phase.
fn handle_interaction(
&mut self,
contact_signal: &mut ContactEvents,
proximity_signal: &mut ProximityEvents,
objects: &CollisionObjectSlab<N, T>,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle,
started: bool
)
&mut self,
contact_signal: &mut ContactEvents,
proximity_signal: &mut ProximityEvents,
objects: &CollisionObjectSlab<N, T>,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle,
started: bool
)
Called when the broad phase detects that two objects are, or stop to be, in close proximity.
fn handle_removal(
&mut self,
objects: &CollisionObjectSlab<N, T>,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle
)
&mut self,
objects: &CollisionObjectSlab<N, T>,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle
)
Called when the interactions between two objects have to be removed because at least one of the objects is being removed.
While either objects[handle1]
or objects[handle2]
is being removed, the handle_removal
is assumed to be called before the removal from the list objects
is done.
fn contact_pair(
&self,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle
) -> Option<&ContactAlgorithm<N>>
&self,
handle1: CollisionObjectHandle,
handle2: CollisionObjectHandle
) -> Option<&ContactAlgorithm<N>>
Retrieve the contact pair for the given two objects.
Retruns None
if no pairs is available for those two objects.
fn contact_pairs<'a>(
&'a self,
objects: &'a CollisionObjectSlab<N, T>
) -> ContactPairs<'a, N, T>
&'a self,
objects: &'a CollisionObjectSlab<N, T>
) -> ContactPairs<'a, N, T>
Returns all the potential contact pairs found during the broad phase, and validated by the narrow phase.
fn proximity_pairs<'a>(
&'a self,
objects: &'a CollisionObjectSlab<N, T>
) -> ProximityPairs<'a, N, T>
&'a self,
objects: &'a CollisionObjectSlab<N, T>
) -> ProximityPairs<'a, N, T>
Returns all the potential proximity pairs found during the broad phase, and validated by the narrow phase.
Implementors
impl<N: Real, T> NarrowPhase<N, T> for DefaultNarrowPhase<N>