diff --git a/src/visibility.rs b/src/visibility.rs index 618e43b..1342178 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -177,13 +177,13 @@ fn update_opacity_map( mut opacity_map: ResMut, spatial_query: SpatialQuery, query: Query< - (Entity, &GlobalTransform, &Collider, &Visible), + (Entity, &GlobalTransform, &ColliderAabb, &Visible), Or<(Changed, Changed)>, >, visible: Query<(Entity, &GlobalTransform, &Collider, &Visible)>, ) { let mut to_update = HashSet::new(); - for (entity, transform, collider, _) in &query { + for (entity, transform, aabb, _) in &query { // println!( // "Updating {entity} at {:?}", // transform.translation().truncate().as_ivec2() @@ -197,7 +197,6 @@ fn update_opacity_map( } let mut current = HashSet::new(); current.insert(transform.translation().truncate().as_ivec2()); - let aabb = collider.aabb(transform.translation().truncate(), transform); for x in aabb.min.x as i32..aabb.max.x as i32 { for y in aabb.min.y as i32..aabb.max.y as i32 { // println!(