feat: Added detect_colliders system

- Fixed colliders filtering in check_for_collisions
- Fixed group masks in tests
- Test collider_detects_different_groups now passes
This commit is contained in:
Alexey 2026-02-15 14:15:00 +03:00
commit 8f667f08c6
2 changed files with 21 additions and 11 deletions

View file

@ -1,7 +1,7 @@
use bevy::prelude::*;
use bevy_collision_plugin::{Collider, CollisionEvent, CollisionPlugin, CollisionShape, UpdateShapes};
const CHECKED_GROUPS: usize = 1 >> 0 | 1 >> 1;
const CHECKED_GROUPS: usize = 1 << 0 | 1 << 1;
#[derive(Component)]
struct MovingCollider;
@ -27,7 +27,7 @@ fn zerogroup_collider_bundle() -> impl Bundle {
shapes: vec![
CollisionShape::new_aabb(Vec2::new(0., 0.), Vec2::new(10., 10.)),
],
mask: 1 >> 0,
mask: 1 << 0,
check_mask: 0,
},
Transform::from_translation(Vec3::new(53., 5., 0.)),
@ -40,7 +40,7 @@ fn firstgroup_collider_bundle() -> impl Bundle {
shapes: vec![
CollisionShape::new_circle(Vec2::new(0., 0.), 5.),
],
mask: 1 >> 1,
mask: 1 << 1,
check_mask: 0,
},
Transform::from_translation(Vec3::new(53., 18., 0.)),
@ -66,7 +66,7 @@ fn setup(
fn configured_app() -> App {
let mut app = App::new();
app.add_plugins(CollisionPlugin)
.add_systems(Startup, setup)
.add_systems(Update, move_collider);