[−][src]Struct nphysics3d::world::ColliderWorld
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: Real> 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]
The underlying collision world from the ncollide crate.
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:
- Clears the event pools.
- Executes the broad phase first.
- 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]
&'a self,
name: &'a str
) -> impl Iterator<Item = &'a Collider<N>>
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]
&self,
handle: BodyPartHandle
) -> impl Iterator<Item = &Collider<N>>
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]
F: BroadPhasePairFilter<N, ColliderData<N>>,
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]
&self
) -> impl Iterator<Item = &Collider<N>>
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]
&mut self,
handle: ColliderHandle
) -> Option<&mut Collider<N>>
Returns a mutable reference to the collider identified by its handle.
pub fn set_collision_groups(
&mut self,
handle: ColliderHandle,
groups: CollisionGroups
)
[src]
&mut self,
handle: ColliderHandle,
groups: CollisionGroups
)
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]
&'a self,
ray: &'a Ray<N>,
groups: &'a CollisionGroups
) -> impl Iterator<Item = (&'a Collider<N>, RayIntersection<N>)>
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]
&'a self,
point: &'a Point<N>,
groups: &'a CollisionGroups
) -> impl Iterator<Item = &'a Collider<N>>
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]
&'a self,
aabb: &'a AABB<N>,
groups: &'a CollisionGroups
) -> impl Iterator<Item = &'a Collider<N>>
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]
&self,
effective_only: bool
) -> impl Iterator<Item = (&Collider<N>, &Collider<N>, &Interaction<N>)>
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]
&self,
effective_only: bool
) -> impl Iterator<Item = (&Collider<N>, &Collider<N>, &ContactAlgorithm<N>, &ContactManifold<N>)>
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]
&self,
effective_only: bool
) -> impl Iterator<Item = (&Collider<N>, &Collider<N>, &ProximityAlgorithm<N>)>
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]
&self,
handle1: ColliderHandle,
handle2: ColliderHandle,
effective_only: bool
) -> Option<(&Collider<N>, &Collider<N>, &Interaction<N>)>
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]
&self,
handle1: ColliderHandle,
handle2: ColliderHandle,
effective_only: bool
) -> Option<(&Collider<N>, &Collider<N>, &ContactAlgorithm<N>, &ContactManifold<N>)>
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]
&self,
handle1: ColliderHandle,
handle2: ColliderHandle,
effective_only: bool
) -> Option<(&Collider<N>, &Collider<N>, &ProximityAlgorithm<N>)>
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]
&self,
handle: ColliderHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (&Collider<N>, &Collider<N>, &Interaction<N>)>>
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]
&self,
handle: ColliderHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (&Collider<N>, &Collider<N>, &ContactAlgorithm<N>, &ContactManifold<N>)>>
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]
&self,
handle: ColliderHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (&Collider<N>, &Collider<N>, &ProximityAlgorithm<N>)>>
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]
&'a self,
handle: ColliderHandle
) -> Option<impl Iterator<Item = &Collider<N>> + 'a>
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]
&'a self,
handle: ColliderHandle
) -> Option<impl Iterator<Item = &Collider<N>> + 'a>
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]
&'a self,
handle: ColliderHandle
) -> Option<impl Iterator<Item = &Collider<N>> + 'a>
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,
N: Scalar,
impl<N> Sync for ColliderWorld<N> where
N: Scalar,
N: Scalar,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Same for T
type Output = T
Should always be Self