[−][src]Struct nphysics2d::world::GeometricalWorld
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, Handle: BodyHandle, CollHandle: ColliderHandle> GeometricalWorld<N, Handle, CollHandle>
[src]
pub fn from_parts<BF>(
broad_phase: BF,
narrow_phase: NarrowPhase<N, CollHandle>
) -> Self where
BF: BroadPhase<N, AABB<N>, CollHandle>,
[src]
broad_phase: BF,
narrow_phase: NarrowPhase<N, CollHandle>
) -> Self where
BF: BroadPhase<N, AABB<N>, CollHandle>,
Creates a geometrical world from the provided broad-phase and narrow-phase structures.
pub fn new() -> Self
[src]
Creates a new collision world.
pub fn maintain<Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&mut self,
bodies: &mut dyn BodySet<N, Handle = Handle>,
colliders: &mut Colliders
)
[src]
&mut self,
bodies: &mut dyn BodySet<N, Handle = Handle>,
colliders: &mut Colliders
)
Maintain the internal structures of the geometrical world by handling body removals and colliders insersion and removals.
pub fn sync_colliders<Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&mut self,
bodies: &dyn BodySet<N, Handle = Handle>,
colliders: &mut Colliders
)
[src]
&mut self,
bodies: &dyn BodySet<N, Handle = Handle>,
colliders: &mut Colliders
)
Synchronize all colliders with their body parent and the underlying collision world.
pub fn body_colliders(&self, body: Handle) -> Option<&[CollHandle]>
[src]
Returns the set of colliders attached to the specified body.
Returns None
if the body has no collider attached to it, of if the body does not exist.
pub fn clear_events(&mut self)
[src]
Empty the contact and proximity event pools.
pub fn perform_broad_phase<Colliders>(&mut self, colliders: &Colliders) where
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
[src]
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Executes the broad phase of the collision detection pipeline.
pub fn perform_narrow_phase<Colliders>(&mut self, colliders: &Colliders) where
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
[src]
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Executes the narrow phase of the collision detection pipeline.
pub fn broad_phase(&self) -> &dyn BroadPhase<N, AABB<N>, CollHandle>
[src]
The broad-phase used by this geometrical world.
pub fn interferences_with_ray<'a, 'b, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
ray: &'b Ray<N>,
groups: &'b CollisionGroups
) -> InterferencesWithRay<'a, 'b, N, Colliders>
[src]
&'a self,
colliders: &'a Colliders,
ray: &'b Ray<N>,
groups: &'b CollisionGroups
) -> InterferencesWithRay<'a, 'b, N, Colliders>
Computes the interferences between every rigid bodies on this world and a ray.
pub fn interferences_with_point<'a, 'b, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
point: &'b Point<N>,
groups: &'b CollisionGroups
) -> InterferencesWithPoint<'a, 'b, N, Colliders>
[src]
&'a self,
colliders: &'a Colliders,
point: &'b Point<N>,
groups: &'b CollisionGroups
) -> InterferencesWithPoint<'a, 'b, N, Colliders>
Computes the interferences between every rigid bodies of a given broad phase, and a point.
pub fn interferences_with_aabb<'a, 'b, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
aabb: &'b AABB<N>,
groups: &'b CollisionGroups
) -> InterferencesWithAABB<'a, 'b, N, Colliders>
[src]
&'a self,
colliders: &'a Colliders,
aabb: &'b AABB<N>,
groups: &'b CollisionGroups
) -> InterferencesWithAABB<'a, 'b, N, Colliders>
Computes the interferences between every rigid bodies of a given broad phase, and a aabb.
pub fn contact_events(&self) -> &ContactEvents<CollHandle>
[src]
The contact events pool.
pub fn proximity_events(&self) -> &ProximityEvents<CollHandle>
[src]
The proximity events pool.
pub fn interaction_pairs<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
effective_only: bool
) -> impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a Interaction<N>)>
[src]
&'a self,
colliders: &'a Colliders,
effective_only: bool
) -> impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a Interaction<N>)>
All the potential interactions pairs.
Refer to the official user guide for details.
pub fn contact_pairs<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
effective_only: bool
) -> impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a ContactAlgorithm<N>, &'a ContactManifold<N>)>
[src]
&'a self,
colliders: &'a Colliders,
effective_only: bool
) -> impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a ContactAlgorithm<N>, &'a ContactManifold<N>)>
All the potential contact pairs.
Refer to the official user guide for details.
pub fn proximity_pairs<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
effective_only: bool
) -> impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a dyn ProximityDetector<N>, Proximity)>
[src]
&'a self,
colliders: &'a Colliders,
effective_only: bool
) -> impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a dyn ProximityDetector<N>, Proximity)>
All the potential proximity pairs.
Refer to the official user guide for details.
pub fn interaction_pair<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle1: CollHandle,
handle2: CollHandle,
effective_only: bool
) -> Option<(CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a Interaction<N>)>
[src]
&'a self,
colliders: &'a Colliders,
handle1: CollHandle,
handle2: CollHandle,
effective_only: bool
) -> Option<(CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a Interaction<N>)>
The potential interaction pair between the two specified colliders.
Refer to the official user guide for details.
pub fn contact_pair<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle1: CollHandle,
handle2: CollHandle,
effective_only: bool
) -> Option<(CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a ContactAlgorithm<N>, &'a ContactManifold<N>)>
[src]
&'a self,
colliders: &'a Colliders,
handle1: CollHandle,
handle2: CollHandle,
effective_only: bool
) -> Option<(CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a ContactAlgorithm<N>, &'a ContactManifold<N>)>
The potential contact pair between the two specified colliders.
Refer to the official user guide for details.
pub fn proximity_pair<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle1: CollHandle,
handle2: CollHandle,
effective_only: bool
) -> Option<(CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a dyn ProximityDetector<N>, Proximity)>
[src]
&'a self,
colliders: &'a Colliders,
handle1: CollHandle,
handle2: CollHandle,
effective_only: bool
) -> Option<(CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a dyn ProximityDetector<N>, Proximity)>
The potential proximity pair between the two specified colliders.
Refer to the official user guide for details.
pub fn interactions_with<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle: CollHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a Interaction<N>)>>
[src]
&'a self,
colliders: &'a Colliders,
handle: CollHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a Interaction<N>)>>
All the interaction pairs involving the specified collider.
Refer to the official user guide for details.
pub fn contacts_with<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle: CollHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a ContactAlgorithm<N>, &'a ContactManifold<N>)>>
[src]
&'a self,
colliders: &'a Colliders,
handle: CollHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a ContactAlgorithm<N>, &'a ContactManifold<N>)>>
All the contact pairs involving the specified collider.
Refer to the official user guide for details.
pub fn proximities_with<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle: CollHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a dyn ProximityDetector<N>, Proximity)>>
[src]
&'a self,
colliders: &'a Colliders,
handle: CollHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>, CollHandle, &'a Collider<N, Handle>, &'a dyn ProximityDetector<N>, Proximity)>>
All the proximity pairs involving the specified collider.
Refer to the official user guide for details.
pub fn colliders_interacting_with<'a, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle: CollHandle
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>)>>
[src]
&'a self,
colliders: &'a Colliders,
handle: CollHandle
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>)>>
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, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle: CollHandle
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>)>>
[src]
&'a self,
colliders: &'a Colliders,
handle: CollHandle
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>)>>
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, Colliders: ColliderSet<N, Handle, Handle = CollHandle>>(
&'a self,
colliders: &'a Colliders,
handle: CollHandle
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>)>>
[src]
&'a self,
colliders: &'a Colliders,
handle: CollHandle
) -> Option<impl Iterator<Item = (CollHandle, &'a Collider<N, Handle>)>>
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, Handle, CollHandle> Send for GeometricalWorld<N, Handle, CollHandle> where
N: Scalar,
N: Scalar,
impl<N, Handle, CollHandle> Sync for GeometricalWorld<N, Handle, CollHandle> where
N: Scalar,
N: Scalar,
impl<N, Handle, CollHandle> Unpin for GeometricalWorld<N, Handle, CollHandle> where
CollHandle: Unpin,
Handle: Unpin,
N: Scalar + Unpin,
CollHandle: Unpin,
Handle: Unpin,
N: Scalar + Unpin,
impl<N, Handle, CollHandle> !UnwindSafe for GeometricalWorld<N, Handle, CollHandle>
impl<N, Handle, CollHandle> !RefUnwindSafe for GeometricalWorld<N, Handle, CollHandle>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,