[−][src]Struct ncollide2d::pipeline::narrow_phase::InteractionGraph
A graph where nodes are collision objects and edges are contact or proximity algorithms.
Methods
impl<N: RealField, Handle: CollisionObjectHandle> InteractionGraph<N, Handle>
[src]
pub fn new() -> Self
[src]
Creates a new empty collection of collision objects.
pub fn add_node(&mut self, handle: Handle) -> CollisionObjectGraphIndex
[src]
Adds a handle to this graph.
#[must_use = "The graph index of the collision object returned by this method has been changed to `id`."]
pub fn remove_node(&mut self, id: CollisionObjectGraphIndex) -> Option<Handle>
[src]
Removes a handle from this graph and returns a handle that must have its graph index changed to id
.
When a node is removed, another node of the graph takes it place. This means that the CollisionObjectGraphIndex
of the collision object returned by this method will be equal to id
. Thus if you maintain
a map between CollisionObjectSlabHandle
and CollisionObjectGraphIndex
, then you should update this
map to associate id
to the handle returned by this method. For example:
// Let `id` be the graph index of the collision object we want to remove. if let Some(other_handle) = graph.remove_node(id) { // The graph index of `other_handle` changed to `id` due to the removal. map.insert(other_handle, id) ; }
pub fn interaction_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &Interaction<N>)>
[src]
&self,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &Interaction<N>)>
All the interactions pairs on this graph.
Refer to the official user guide for details.
pub fn contact_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]
&self,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &ContactAlgorithm<N>, &ContactManifold<N>)>
All the contact pairs on this graph.
Refer to the official user guide for details.
pub fn proximity_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &dyn ProximityDetector<N>, Proximity)>
[src]
&self,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &dyn ProximityDetector<N>, Proximity)>
All the proximity pairs on this graph.
Refer to the official user guide for details.
pub fn interaction_pair(
&self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex,
effective_only: bool
) -> Option<(Handle, Handle, &Interaction<N>)>
[src]
&self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex,
effective_only: bool
) -> Option<(Handle, Handle, &Interaction<N>)>
The interaction between the two collision objects identified by their graph index.
Refer to the official user guide for details.
pub fn interaction_pair_mut(
&mut self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex
) -> Option<(Handle, Handle, &mut Interaction<N>)>
[src]
&mut self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex
) -> Option<(Handle, Handle, &mut Interaction<N>)>
The interaction between the two collision objects identified by their graph index.
Refer to the official user guide for details.
pub fn contact_pair(
&self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex,
effective_only: bool
) -> Option<(Handle, Handle, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]
&self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex,
effective_only: bool
) -> Option<(Handle, Handle, &ContactAlgorithm<N>, &ContactManifold<N>)>
The contact pair between the two collision objects identified by their graph index.
Refer to the official user guide for details.
pub fn proximity_pair(
&self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex,
effective_only: bool
) -> Option<(Handle, Handle, &dyn ProximityDetector<N>, Proximity)>
[src]
&self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex,
effective_only: bool
) -> Option<(Handle, Handle, &dyn ProximityDetector<N>, Proximity)>
The proximity pair between the two collision objects identified by their graph index.
Refer to the official user guide for details.
pub fn proximity_pair_mut(
&mut self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex
) -> Option<(Handle, Handle, &mut dyn ProximityDetector<N>, &mut Proximity)>
[src]
&mut self,
id1: CollisionObjectGraphIndex,
id2: CollisionObjectGraphIndex
) -> Option<(Handle, Handle, &mut dyn ProximityDetector<N>, &mut Proximity)>
The proximity pair between the two collision objects identified by their graph index.
Refer to the official user guide for details.
pub fn interactions_with(
&self,
id: CollisionObjectGraphIndex,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &Interaction<N>)>
[src]
&self,
id: CollisionObjectGraphIndex,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &Interaction<N>)>
All the interaction involving the collision object with graph index id
.
Refer to the official user guide for details.
pub fn index_interaction(
&self,
id: TemporaryInteractionIndex
) -> Option<(Handle, Handle, &Interaction<N>)>
[src]
&self,
id: TemporaryInteractionIndex
) -> Option<(Handle, Handle, &Interaction<N>)>
Gets the interaction with the given index.
pub fn interactions_with_mut(
&mut self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = (Handle, Handle, TemporaryInteractionIndex, &mut Interaction<N>)>
[src]
&mut self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = (Handle, Handle, TemporaryInteractionIndex, &mut Interaction<N>)>
All the mutable references to interactions involving the collision object with graph index id
.
Refer to the official user guide for details.
pub fn proximities_with(
&self,
handle: CollisionObjectGraphIndex,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &dyn ProximityDetector<N>, Proximity)>
[src]
&self,
handle: CollisionObjectGraphIndex,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &dyn ProximityDetector<N>, Proximity)>
All the proximity pairs involving the collision object with graph index id
.
Refer to the official user guide for details.
pub fn contacts_with(
&self,
handle: CollisionObjectGraphIndex,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]
&self,
handle: CollisionObjectGraphIndex,
effective_only: bool
) -> impl Iterator<Item = (Handle, Handle, &ContactAlgorithm<N>, &ContactManifold<N>)>
All the contact pairs involving the collision object with graph index id
.
Refer to the official user guide for details.
pub fn collision_objects_interacting_with<'a>(
&'a self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = Handle> + 'a
[src]
&'a self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = Handle> + 'a
All the collision object handles of collision objects interacting with the collision object with graph index id
.
Refer to the official user guide for details.
pub fn collision_objects_in_contact_with<'a>(
&'a self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = Handle> + 'a
[src]
&'a self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = Handle> + 'a
All the collision object handles of collision objects in contact with the collision object with graph index id
.
Refer to the official user guide for details.
pub fn collision_objects_in_proximity_of<'a>(
&'a self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = Handle> + 'a
[src]
&'a self,
id: CollisionObjectGraphIndex
) -> impl Iterator<Item = Handle> + 'a
All the collision object handles of collision objects in proximity of with the collision object with graph index id
.
Refer to the official user guide for details.
Auto Trait Implementations
impl<N, Handle> !RefUnwindSafe for InteractionGraph<N, Handle>
impl<N, Handle> Send for InteractionGraph<N, Handle> where
N: Scalar,
N: Scalar,
impl<N, Handle> Sync for InteractionGraph<N, Handle> where
N: Scalar,
N: Scalar,
impl<N, Handle> Unpin for InteractionGraph<N, Handle> where
Handle: Unpin,
N: Scalar + Unpin,
Handle: Unpin,
N: Scalar + Unpin,
impl<N, Handle> !UnwindSafe for InteractionGraph<N, Handle>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,