Module bevy_xpbd_3d::plugins::collision
source · Expand description
Collision detection is used to detect and compute intersections between Collider
s.
In bevy_xpbd
, collision detection is split into three plugins:
BroadPhasePlugin
: Collects pairs of potentially colliding entities intoBroadCollisionPairs
.NarrowPhasePlugin
: Computes contacts for broad phase collision pairs and adds them toCollisions
.ContactReportingPlugin
(optional): Sends collision events and updatesCollidingEntities
based onCollisions
.
Spatial queries are handled by the SpatialQueryPlugin
.
You can also find several utility methods for computing contacts in contact_query
.
Modules§
- Collects pairs of potentially colliding entities into
BroadCollisionPairs
using AABB intersection checks. - Handles generic collider backend logic, like initializing colliders and AABBs and updating related components.
- Contact queries compute information about contacts between two
Collider
s. - Sends collision events and updates
CollidingEntities
. - Computes contacts between entities.
Structs§
- A component that will automatically generate a
Collider
based on the entity’sMesh
. The type of the generated collider can be specified usingComputedCollider
. - A component that will automatically generate colliders for the meshes in a scene once the scene has been loaded. The type of the generated collider can be specified using
ComputedCollider
. - Configuration for a specific collider generated from a scene using
AsyncSceneCollider
. - A collider used for detecting collisions and generating contacts.
- The Axis-Aligned Bounding Box of a collider.
- The transform of a collider relative to the rigid body it’s attached to. This is in the local space of the body, not the collider itself.
- A component that stores the entities that are colliding with an entity.
- 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 component that marks a
Collider
as a sensor, also known as a trigger. - Data related to a single contact between two bodies.
Enums§
- Determines how a
Collider
is generated from aMesh
.
Traits§
- A trait that generalizes over colliders. Implementing this trait allows colliders to be used with the physics engine.
- A trait for creating colliders from other types.
- A trait for colliders that support scaling.
Type Aliases§
- Flags used for the preprocessing of a triangle mesh collider.
- Parameters controlling the VHACD convex decomposition algorithm.