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 add bodies and 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. Before computing the collisions again, you should update your bodies and colliders.

Structs§

Body
An object which might consist of multiple colliders. Collisions between multiple colliders of the same body are not checked.
CollisionManager
The collision manager, which manages collisions. Can contain multiple bodies and other colliders. Collisions between colliders are not checked.
IndexedCollisionInfo
The collision info with the index of the collider or body.

Enums§

ObjectIndex
Represents the index of a static or dynamic inserted object.