Expand description
Collision detection for Collider
s.
Collision detection involves determining pairs of objects that may currently be in contact
(or are expected to come into contact), and computing contact data for each intersection.
These contacts are then used by the solver to generate
ContactConstraint
s and finally resolve overlap.
In Avian, collision detection is split into three plugins:
BroadPhasePlugin
: Performs intersection tests to determine potential collisions, adding them toBroadCollisionPairs
.NarrowPhasePlugin
: ComputesContacts
for each pair inBroadCollisionPairs
, adding them toCollisions
.ContactReportingPlugin
(optional): Sends collision events and updatesCollidingEntities
based onCollisions
.
Spatial queries are handled separately by the SpatialQueryPlugin
.
You can also find several utility methods for computing contacts in contact_query
.
Re-exports§
pub use collider::*;
Modules§
- Collects pairs of potentially colliding entities into
BroadCollisionPairs
using AABB intersection checks. - Components, traits, and plugins related to collider functionality.
- Geometric queries for computing information about contacts between two
Collider
s. - Sends collision events and updates
CollidingEntities
. - Computes contacts between entities.
Structs§
- Defines the collision layers of a collider using memberships and filters.
- A resource that stores all collision pairs.
- Data related to a contact between two bodies.
- A contact manifold between two colliders, containing a set of contact points. Each contact in a manifold shares the same contact normal.
- All contacts between two colliders.
- A bitmask for layers.
- A feature ID indicating the type of a geometric feature: a vertex, an edge, or (in 3D) a face.
- Data related to a single contact between two bodies.
Traits§
- A layer used for determining which entities should interact with each other. Physics layers are used heavily by
CollisionLayers
.