Skip to main content

Crate colider_lib

Crate colider_lib 

Source
Expand description

This crate is a bevy collision detection crate. This crate adds a collider and a collision event.

Structs§

ColliderBuilder
This is the collider builder. This is how you use it: Create a collider using [ColliderBuilder::new_cuboid_collider]. Add the collider to an object when spawning using Commands::spawn it to add collision to that object. Add an Update system that checks for collision between two colliders using [RectangleCollider::check_collider_collision] if the event_feature is not enabled. If the event feature is enabled, then add an observer to get triggered by the CollisionEvent. Add another Update system that updates collider position using [Collider::move_collider] if auto_move is disabled. If auto_move is enabled, then move the object with the collider. If you want to use the event or auto_move features, add the ColliderPlugin to your app. WARNING! Physics is not present in this library. If you want a physics library, use bevy_rapier2d. WARNING!
ColliderPlugin
This plugin adds a collision event and automatic collider movement if the vent and auto_move features are enabled. It is meant to be used with EntityCommands::observe. This feature is enabled with the event or the auto_move features;
CollisionEvent
This is an event that gets triggered if there is a collision between two colliders.

Functions§

event_trigger