[][src]Struct nphysics3d::world::ColliderWorld

pub struct ColliderWorld<N: RealField> { /* fields omitted */ }

The world managing all geometric queries.

This is a wrapper over the CollisionWorld structure from ncollide to simplify its use with the [object::Collider] structure.

Methods

impl<N: RealField> ColliderWorld<N>[src]

pub fn new(margin: N) -> Self[src]

Creates a new collision world.

pub fn sync_colliders(&mut self, bodies: &BodySet<N>)[src]

Synchronize all colliders with their body parent and the underlying collision world.

pub fn default_material(&self) -> MaterialHandle<N>[src]

The material given to colliders without user-defined materials.

pub fn as_collider_world(&self) -> &CollisionWorld<N, ColliderData<N>>[src]

Deprecated since 0.11.1:

renamed to as_collision_world

The underlying collision world from the ncollide crate.

pub fn as_collision_world(&self) -> &CollisionWorld<N, ColliderData<N>>[src]

The underlying collision world from the ncollide crate.

pub fn set_narrow_phase(&mut self, narrow_phase: NarrowPhase<N>)[src]

Customize the selection of narrow-phase collision detection algorithms

pub fn into_inner(self) -> CollisionWorld<N, ColliderData<N>>[src]

Unwraps the underlying collision world from the ncollide crate.

pub fn update(&mut self)[src]

Updates the collision world.

This executes the whole collision detection pipeline:

  1. Clears the event pools.
  2. Executes the broad phase first.
  3. Executes the narrow phase.

pub fn clear_events(&mut self)[src]

Empty the contact and proximity event pools.

pub fn colliders_with_name<'a>(
    &'a self,
    name: &'a str
) -> impl Iterator<Item = &'a Collider<N>>
[src]

Iterator through all the colliders with the given name.

pub fn body_colliders(&self, handle: BodyHandle) -> ColliderChain<N>[src]

Iterator through all the colliders attached to the body with the given handle.

Returns an empty iterator if the body does not exists.

pub fn body_part_colliders(
    &self,
    handle: BodyPartHandle
) -> impl Iterator<Item = &Collider<N>>
[src]

Iterator through all the colliders attached to the body part with the given handle.

Returns an empty iterator if the body part does not exists. Does not return deformable colliders.

pub fn set_position(&mut self, handle: ColliderHandle, pos: Isometry<N>)[src]

Sets the position the collider attached to the specified object.

pub fn register_broad_phase_pair_filter<F>(&mut self, name: &str, filter: F) where
    F: BroadPhasePairFilter<N, ColliderData<N>>, 
[src]

Adds a filter that tells if a potential collision pair should be ignored or not.

The proximity filter returns false for a given pair of colliders if they should be ignored by the narrow phase. Keep in mind that modifying the proximity filter will have a non-trivial overhead during the next update as it will force re-detection of all collision pairs.

pub fn unregister_broad_phase_pair_filter(&mut self, name: &str)[src]

Removes the pair filter named name.

pub fn perform_broad_phase(&mut self)[src]

Executes the broad phase of the collision detection pipeline.

pub fn perform_narrow_phase(&mut self)[src]

Executes the narrow phase of the collision detection pipeline.

pub fn colliders(&self) -> impl Iterator<Item = &Collider<N>>[src]

Iterates through all colliders.

pub fn collider(&self, handle: ColliderHandle) -> Option<&Collider<N>>[src]

Returns a reference to the collider identified by its handle.

pub fn collider_mut(
    &mut self,
    handle: ColliderHandle
) -> Option<&mut Collider<N>>
[src]

Returns a mutable reference to the collider identified by its handle.

pub fn set_collision_groups(
    &mut self,
    handle: ColliderHandle,
    groups: CollisionGroups
)
[src]

Sets the collision groups of the given collider.

pub fn interferences_with_ray<'a>(
    &'a self,
    ray: &'a Ray<N>,
    groups: &'a CollisionGroups
) -> impl Iterator<Item = (&'a Collider<N>, RayIntersection<N>)>
[src]

Computes the interferences between every rigid bodies on this world and a ray.

pub fn interferences_with_point<'a>(
    &'a self,
    point: &'a Point<N>,
    groups: &'a CollisionGroups
) -> impl Iterator<Item = &'a Collider<N>>
[src]

Computes the interferences between every rigid bodies of a given broad phase, and a point.

pub fn interferences_with_aabb<'a>(
    &'a self,
    aabb: &'a AABB<N>,
    groups: &'a CollisionGroups
) -> impl Iterator<Item = &'a Collider<N>>
[src]

Computes the interferences between every rigid bodies of a given broad phase, and a aabb.

pub fn contact_events(&self) -> &ContactEvents[src]

The contact events pool.

pub fn proximity_events(&self) -> &ProximityEvents[src]

The proximity events pool.

pub fn interaction_pairs(
    &self,
    effective_only: bool
) -> impl Iterator<Item = (&Collider<N>, &Collider<N>, &Interaction<N>)>
[src]

All the potential interactions pairs.

Refer to the official user guide for details.

pub fn contact_pairs(
    &self,
    effective_only: bool
) -> impl Iterator<Item = (&Collider<N>, &Collider<N>, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]

All the potential contact pairs.

Refer to the official user guide for details.

pub fn proximity_pairs(
    &self,
    effective_only: bool
) -> impl Iterator<Item = (&Collider<N>, &Collider<N>, &ProximityAlgorithm<N>)>
[src]

All the potential proximity pairs.

Refer to the official user guide for details.

pub fn interaction_pair(
    &self,
    handle1: ColliderHandle,
    handle2: ColliderHandle,
    effective_only: bool
) -> Option<(&Collider<N>, &Collider<N>, &Interaction<N>)>
[src]

The potential interaction pair between the two specified colliders.

Refer to the official user guide for details.

pub fn contact_pair(
    &self,
    handle1: ColliderHandle,
    handle2: ColliderHandle,
    effective_only: bool
) -> Option<(&Collider<N>, &Collider<N>, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]

The potential contact pair between the two specified colliders.

Refer to the official user guide for details.

pub fn proximity_pair(
    &self,
    handle1: ColliderHandle,
    handle2: ColliderHandle,
    effective_only: bool
) -> Option<(&Collider<N>, &Collider<N>, &ProximityAlgorithm<N>)>
[src]

The potential proximity pair between the two specified colliders.

Refer to the official user guide for details.

pub fn interactions_with(
    &self,
    handle: ColliderHandle,
    effective_only: bool
) -> Option<impl Iterator<Item = (&Collider<N>, &Collider<N>, &Interaction<N>)>>
[src]

All the interaction pairs involving the specified collider.

Refer to the official user guide for details.

pub fn contacts_with(
    &self,
    handle: ColliderHandle,
    effective_only: bool
) -> Option<impl Iterator<Item = (&Collider<N>, &Collider<N>, &ContactAlgorithm<N>, &ContactManifold<N>)>>
[src]

All the contact pairs involving the specified collider.

Refer to the official user guide for details.

pub fn proximities_with(
    &self,
    handle: ColliderHandle,
    effective_only: bool
) -> Option<impl Iterator<Item = (&Collider<N>, &Collider<N>, &ProximityAlgorithm<N>)>>
[src]

All the proximity pairs involving the specified collider.

Refer to the official user guide for details.

pub fn colliders_interacting_with<'a>(
    &'a self,
    handle: ColliderHandle
) -> Option<impl Iterator<Item = &Collider<N>> + 'a>
[src]

All the collider handles of colliders interacting with the specified collider.

Refer to the official user guide for details.

pub fn colliders_in_contact_with<'a>(
    &'a self,
    handle: ColliderHandle
) -> Option<impl Iterator<Item = &Collider<N>> + 'a>
[src]

All the collider handles of colliders in potential contact with the specified collision object.

Refer to the official user guide for details.

pub fn colliders_in_proximity_of<'a>(
    &'a self,
    handle: ColliderHandle
) -> Option<impl Iterator<Item = &Collider<N>> + 'a>
[src]

All the collider handles of colliders in potential proximity of with the specified collider.

Refer to the official user guide for details.

Auto Trait Implementations

impl<N> Send for ColliderWorld<N> where
    N: Scalar

impl<N> Sync for ColliderWorld<N> where
    N: Scalar

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Downcast for T where
    T: Any
[src]

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self