mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
f32ee63fb1
# Objective - Fix #7263 This has nothing to do with #7024. This is for the case where the user opted to **not** keep the same global transform on update. ## Solution - Add a `RemovedComponent<Parent>` to `propagate_transforms` - Add a `RemovedComponent<Parent>` and `Local<Vec<Entity>>` to `sync_simple_transforms` - Add test to make sure all of this works. ### Performance note This should only incur a cost in cases where a parent is removed. A minimal overhead (one look up in the `removed_components` sparse set) per root entities without children which transform didn't change. A `Vec` the size of the largest number of entities removed with a `Parent` component in a single frame, and a binary search on a `Vec` per root entities. It could slow up considerably in situations where a lot of entities are orphaned consistently during every frame, since `sync_simple_transforms` is not parallel. But in this situation, it is likely that the overhead of archetype updates overwhelms everything. --- ## Changelog - Fix the `GlobalTransform` not getting updated when `Parent` is removed ## Migration Guide - If you called `bevy_transform::systems::sync_simple_transforms` and `bevy_transform::systems::propagate_transforms` (which is not re-exported by bevy) you need to account for the additional `RemovedComponents<Parent>` parameter. --------- Co-authored-by: vyb <vyb@users.noreply.github.com> Co-authored-by: JoJoJet <21144246+JoJoJet@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
Bevy Transform
This crate is largely a 1:1 port from legion_transform (ecs: legion, math: nalgebra) to bevy (ecs: bevy_ecs, math: glam)