No need to calculate AABB separately.
This commit is contained in:
parent
224a4043e2
commit
2379ee6900
|
@ -177,13 +177,13 @@ fn update_opacity_map(
|
|||
mut opacity_map: ResMut<OpacityMap>,
|
||||
spatial_query: SpatialQuery,
|
||||
query: Query<
|
||||
(Entity, &GlobalTransform, &Collider, &Visible),
|
||||
(Entity, &GlobalTransform, &ColliderAabb, &Visible),
|
||||
Or<(Changed<GlobalTransform>, Changed<Visible>)>,
|
||||
>,
|
||||
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!(
|
||||
|
|
Loading…
Reference in New Issue
Block a user