pub struct CollisionWorld<N: RealField + Copy, T> {
    pub objects: CollisionObjectSlab<N, T>,
    pub broad_phase: BroadPhaseObject<N>,
    pub narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>,
    pub toi_dispatcher: Box<dyn TOIDispatcher<N>>,
    pub interactions: InteractionGraph<N, CollisionObjectSlabHandle>,
    pub pair_filters: Option<Box<dyn BroadPhasePairFilter<N, CollisionObjectSlab<N, T>>>>,
}
Expand description

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.

toi_dispatcher: Box<dyn TOIDispatcher<N>>

The Time of Impact dispatcher used.

interactions: InteractionGraph<N, CollisionObjectSlabHandle>

The graph of interactions detected so far.

pair_filters: Option<Box<dyn BroadPhasePairFilter<N, CollisionObjectSlab<N, T>>>>

A user-defined broad-phase pair filter.

Implementations

Creates a new collision world.

Adds a collision object to the world.

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.

Empty the contact and proximity event pools.

Removed the specified set of collision objects from the world.

Panics of any handle is invalid, or if the list contains duplicates.

👎 Deprecated:

Call directly the method .set_position on the collision object.

Sets the position of the collision object attached to the specified object.

👎 Deprecated:

Call directly the method .set_query_type on the collision object.

Sets the GeometricQueryType of the collision object.

👎 Deprecated:

Call directly the method .set_shape on the collision object.

Sets the shape of the given collision object.

👎 Deprecated:

Call directly the method .set_deformations on the collision object.

Apply the given deformations to the specified object.

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.

Executes the broad phase of the collision detection pipeline.

Executes the narrow phase of the collision detection pipeline.

The broad-phase aabb for the given collision object.

Iterates through all collision objects.

Returns a reference to the collision object identified by its handle.

Returns a mutable reference to the collision object identified by its handle.

Returns a mutable reference to a pair collision object identified by their handles.

Panics if both handles are equal.

👎 Deprecated:

Call directly the method .set_collision_groups on the collision object.

Sets the collision groups of the given collision object.

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.

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

Computes the first interference with ray and

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

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

Customize the selection of narrowphase collision detection algorithms

All the potential interactions pairs.

Refer to the official user guide for details.

All the potential contact pairs.

Refer to the official user guide for details.

All the potential proximity pairs.

Refer to the official user guide for details.

The potential interaction pair between the two specified collision objects.

Refer to the official user guide for details.

The potential contact pair between the two specified collision objects.

Refer to the official user guide for details.

The potential proximity pair between the two specified collision objects.

Refer to the official user guide for details.

All the interaction pairs involving the specified collision object.

Refer to the official user guide for details.

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.

All the proximity pairs involving the specified collision object.

Refer to the official user guide for details.

All the contact pairs involving the specified collision object.

Refer to the official user guide for details.

All the collision object handles of collision objects interacting with the specified collision object.

Refer to the official user guide for details.

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

Refer to the official user guide for details.

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.

The contact events pool.

The proximity events pool.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Casts the value.

Casts the value.

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Performs the conversion.

Performs the conversion.

Casts the value.

OverflowingCasts the value.

Should always be Self

Casts the value.

Casts the value.

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

UnwrappedCasts the value.

Casts the value.

WrappingCasts the value.