[−][src]Struct ncollide2d::pipeline::world::CollisionWorld
A world that handles collision objects.
Fields
objects: CollisionObjectSlab<N, T>
The set of objects on this collision world.
broad_phase: BroadPhaseObject<N>
The broad phase used by this collision world.
narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>
The narrow-phase used by this collision world.
interactions: InteractionGraph<N, CollisionObjectSlabHandle>
The graph of interactions detected so far.
pair_filters: Option<Box<dyn BroadPhasePairFilter<N, CollisionObject<N, T>, CollisionObjectSlabHandle>>>
A user-defined broad-phase pair filter.
Methods
impl<N: RealField, T> CollisionWorld<N, T>
[src]
pub fn new(margin: N) -> CollisionWorld<N, T>
[src]
Creates a new collision world.
pub fn add(
&mut self,
position: Isometry<N>,
shape: ShapeHandle<N>,
collision_groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T
) -> (CollisionObjectSlabHandle, &mut CollisionObject<N, T>)
[src]
&mut self,
position: Isometry<N>,
shape: ShapeHandle<N>,
collision_groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T
) -> (CollisionObjectSlabHandle, &mut CollisionObject<N, T>)
Adds a collision object to the world.
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 remove(&mut self, handles: &[CollisionObjectSlabHandle])
[src]
Removed the specified set of collision objects from the world.
Panics of any handle is invalid, or if the list contains duplicates.
pub fn set_position(
&mut self,
handle: CollisionObjectSlabHandle,
pos: Isometry<N>
)
[src]
&mut self,
handle: CollisionObjectSlabHandle,
pos: Isometry<N>
)
Call directly the method .set_position
on the collision object.
Sets the position of the collision object attached to the specified object.
pub fn set_query_type(
&mut self,
handle: CollisionObjectSlabHandle,
query_type: GeometricQueryType<N>
)
[src]
&mut self,
handle: CollisionObjectSlabHandle,
query_type: GeometricQueryType<N>
)
Call directly the method .set_query_type
on the collision object.
Sets the GeometricQueryType
of the collision object.
pub fn set_shape(
&mut self,
handle: CollisionObjectSlabHandle,
shape: ShapeHandle<N>
)
[src]
&mut self,
handle: CollisionObjectSlabHandle,
shape: ShapeHandle<N>
)
Call directly the method .set_shape
on the collision object.
Sets the shape of the given collision object.
pub fn set_deformations(
&mut self,
handle: CollisionObjectSlabHandle,
coords: &[N]
)
[src]
&mut self,
handle: CollisionObjectSlabHandle,
coords: &[N]
)
Call directly the method .set_deformations
on the collision object.
Apply the given deformations to the specified object.
pub fn set_broad_phase_pair_filter<F>(&mut self, filter: Option<F>) where
F: BroadPhasePairFilter<N, CollisionObject<N, T>, CollisionObjectSlabHandle>,
[src]
F: BroadPhasePairFilter<N, CollisionObject<N, T>, CollisionObjectSlabHandle>,
Sets the user-defined filter that tells if a potential collision pair should be ignored or not.
The proximity filter returns false
for a given pair of collision objects 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 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 broad_phase_aabb(
&self,
handle: CollisionObjectSlabHandle
) -> Option<&AABB<N>>
[src]
&self,
handle: CollisionObjectSlabHandle
) -> Option<&AABB<N>>
The broad-phase aabb for the given collision object.
ⓘImportant traits for CollisionObjects<'a, N, T>pub fn collision_objects(&self) -> CollisionObjects<N, T>
[src]
Iterates through all collision objects.
pub fn collision_object(
&self,
handle: CollisionObjectSlabHandle
) -> Option<&CollisionObject<N, T>>
[src]
&self,
handle: CollisionObjectSlabHandle
) -> Option<&CollisionObject<N, T>>
Returns a reference to the collision object identified by its handle.
pub fn get_mut(
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<&mut CollisionObject<N, T>>
[src]
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<&mut CollisionObject<N, T>>
Returns a mutable reference to the collision object identified by its handle.
pub fn collision_object_pair_mut(
&mut self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle
) -> (Option<&mut CollisionObject<N, T>>, Option<&mut CollisionObject<N, T>>)
[src]
&mut self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle
) -> (Option<&mut CollisionObject<N, T>>, Option<&mut CollisionObject<N, T>>)
Returns a mutable reference to a pair collision object identified by their handles.
Panics if both handles are equal.
pub fn set_collision_groups(
&mut self,
handle: CollisionObjectSlabHandle,
groups: CollisionGroups
)
[src]
&mut self,
handle: CollisionObjectSlabHandle,
groups: CollisionGroups
)
Call directly the method .set_collision_groups
on the collision object.
Sets the collision groups of the given collision object.
pub fn sweep_test<'a>(
&'a self,
shape: &'a dyn Shape<N>,
isometry: &'a Isometry<N>,
direction: &'a Unit<Vector<N>>,
maximum_distance: N,
groups: &'a CollisionGroups
) -> impl Iterator<Item = (CollisionObjectSlabHandle, TOI<N>)> + 'a
[src]
&'a self,
shape: &'a dyn Shape<N>,
isometry: &'a Isometry<N>,
direction: &'a Unit<Vector<N>>,
maximum_distance: N,
groups: &'a CollisionGroups
) -> impl Iterator<Item = (CollisionObjectSlabHandle, TOI<N>)> + 'a
Returns all objects in the collision world that intersect with the shape
transformed by isometry
along direction
until maximum_distance
is
reached. The objects are not returned in any particular order. You may
use the toi
returned for each object to determine the closest object.
ⓘImportant traits for InterferencesWithRay<'a, 'b, N, Objects>pub fn interferences_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> InterferencesWithRay<'a, 'b, N, CollisionObjectSlab<N, T>>
[src]
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> InterferencesWithRay<'a, 'b, N, CollisionObjectSlab<N, T>>
Computes the interferences between every rigid bodies on this world and a ray.
pub fn first_interference_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> Option<FirstInterferenceWithRay<'a, N, CollisionObjectSlab<N, T>>>
[src]
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> Option<FirstInterferenceWithRay<'a, N, CollisionObjectSlab<N, T>>>
Computes the first interference with ray
and
ⓘImportant traits for InterferencesWithPoint<'a, 'b, N, Objects>pub fn interferences_with_point<'a, 'b>(
&'a self,
point: &'b Point<N>,
groups: &'b CollisionGroups
) -> InterferencesWithPoint<'a, 'b, N, CollisionObjectSlab<N, T>>
[src]
&'a self,
point: &'b Point<N>,
groups: &'b CollisionGroups
) -> InterferencesWithPoint<'a, 'b, N, CollisionObjectSlab<N, T>>
Computes the interferences between every rigid bodies of a given broad phase, and a point.
ⓘImportant traits for InterferencesWithAABB<'a, 'b, N, Objects>pub fn interferences_with_aabb<'a, 'b>(
&'a self,
aabb: &'b AABB<N>,
groups: &'b CollisionGroups
) -> InterferencesWithAABB<'a, 'b, N, CollisionObjectSlab<N, T>>
[src]
&'a self,
aabb: &'b AABB<N>,
groups: &'b CollisionGroups
) -> InterferencesWithAABB<'a, 'b, N, CollisionObjectSlab<N, T>>
Computes the interferences between every rigid bodies of a given broad phase, and a aabb.
pub fn set_narrow_phase(
&mut self,
narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>
)
[src]
&mut self,
narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>
)
Customize the selection of narrowphase collision detection algorithms
pub fn interaction_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
[src]
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &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 = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &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 = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
[src]
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
All the potential proximity pairs.
Refer to the official user guide for details.
pub fn interaction_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
[src]
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
The potential interaction pair between the two specified collision objects.
Refer to the official user guide for details.
pub fn contact_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
[src]
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
The potential contact pair between the two specified collision objects.
Refer to the official user guide for details.
pub fn proximity_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
[src]
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
The potential proximity pair between the two specified collision objects.
Refer to the official user guide for details.
pub fn interactions_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>>
[src]
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>>
All the interaction pairs involving the specified collision object.
Refer to the official user guide for details.
pub fn interactions_with_mut(
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<(&mut NarrowPhase<N, CollisionObjectSlabHandle>, impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, TemporaryInteractionIndex, &mut Interaction<N>)>)>
[src]
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<(&mut NarrowPhase<N, CollisionObjectSlabHandle>, impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, TemporaryInteractionIndex, &mut Interaction<N>)>)>
All the mutable interactions pairs involving the specified collision object.
This also returns a mutable reference to the narrow-phase which is necessary for updating the interaction if needed. For interactions between a collision object and itself, only one mutable reference to the collision object is returned.
pub fn proximities_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>>
[src]
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>>
All the proximity pairs involving the specified collision object.
Refer to the official user guide for details.
pub fn contacts_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>>
[src]
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>>
All the contact pairs involving the specified collision object.
Refer to the official user guide for details.
pub fn collision_objects_interacting_with<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
[src]
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
All the collision object handles of collision objects interacting with the specified collision object.
Refer to the official user guide for details.
pub fn collision_objects_in_contact_with<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
[src]
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
All the collision object handles of collision objects in potential contact with the specified collision object.
Refer to the official user guide for details.
pub fn collision_objects_in_proximity_of<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
[src]
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
All the collision object handles of collision objects in potential proximity of with the specified collision object.
Refer to the official user guide for details.
pub fn contact_events(&self) -> &ContactEvents<CollisionObjectSlabHandle>
[src]
The contact events pool.
pub fn proximity_events(&self) -> &ProximityEvents<CollisionObjectSlabHandle>
[src]
The proximity events pool.
Auto Trait Implementations
impl<N, T> !RefUnwindSafe for CollisionWorld<N, T>
impl<N, T> Send for CollisionWorld<N, T> where
N: Scalar,
T: Send,
N: Scalar,
T: Send,
impl<N, T> Sync for CollisionWorld<N, T> where
N: Scalar,
T: Sync,
N: Scalar,
T: Sync,
impl<N, T> Unpin for CollisionWorld<N, T> where
N: Scalar + Unpin,
T: Unpin,
N: Scalar + Unpin,
T: Unpin,
impl<N, T> !UnwindSafe for CollisionWorld<N, T>
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>,