Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GlobalTransform updates for entities with non-physics children #392

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Jul 2, 2024

Objective

#380 significantly sped up transform propagation by reducing unnecessary work with physics entity ancestor markers. However, it also seems to have caused a severe bug: GlobalTransform is not updated for rigid bodies that have children that all are not physics entities.

The problem lies in propagate_transforms_physics, which only iterates through entities that are marked as ancestors of rigid bodies or colliders. Rigid bodies that have children but no physics entity descendants are just skipped.

Solution

In sync_simple_transforms_physics, don't only iterate through rigid bodies with no children, but also through rigid bodies that have children but are not ancestors of other physics entities.

@Jondolf Jondolf added the bugfix label Jul 2, 2024
@Jondolf Jondolf merged commit 8254115 into bevy-0.14 Jul 2, 2024
4 checks passed
@Jondolf Jondolf deleted the fix-transform-update-bug branch July 19, 2024 21:50
@Jondolf Jondolf added C-Bug Something isn't working and removed bugfix labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant