Crate collision_detection

Source
Expand description

This crate defines an infrastructure to handle collision detection.

It’s based on the collide crate, so your colliders need need to implement the Collider trait.

The CollisionManager, which can only contain one type of collider. When you want to use multiple colliders, you currently need to use trait objects or enums.

Then you can colliders to the manager. You should store their indices, which will be used when you modify or remove them. When you’re done, you can compute the collisions, which you can use to update your objects. You can either compute the collisions between all objects internally or between this object with a different layer. Before computing the collisions again, you should update your colliders, for example if the position of the object changed.

Structs§

CollisionManager
The collision manager, which manages collisions. Can contain multiple colliders.
IndexedCollisionInfo
The collision info with the index of the other collider.