bevy/crates/bevy_transform
James Liu 7d0edbc4d6 Improve change detection behavior for transform propagation (#6870)
# Objective
Fix #4647. If any child is changed, or even reordered, `Changed<Children>` is true, which causes transform propagation to propagate changes to all siblings of a changed child, even if they don't need to be.

## Solution
As `Parent` and `Children` are updated in tandem in hierarchy commands after #4800. `Changed<Parent>` is true on the child when `Changed<Children>` is true on the parent. However, unlike checking children, checking `Changed<Parent>` is only localized to the current entity and will not force propagation to the siblings.

Also took the opportunity to change propagation to use `Query::iter_many` instead of repeated `Query::get` calls. Should cut a bit of the overhead out of propagation. This means we won't panic when there isn't a `Parent` on the child, just skip over it.

The tests from #4608 still pass, so the change detection here still works just fine under this approach.
2023-01-17 22:26:51 +00:00
..
src Improve change detection behavior for transform propagation (#6870) 2023-01-17 22:26:51 +00:00
Cargo.toml Parallelized transform propagation (#4775) 2022-11-21 18:18:38 +00:00
README.md transform: remove some dependencies and cleanup 2020-07-10 01:49:23 -07:00

Bevy Transform

This crate is largely a 1:1 port from legion_transform (ecs: legion, math: nalgebra) to bevy (ecs: bevy_ecs, math: glam)