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

Changing collider transforms doesn't check if the position actually needs updated - causing a lot of useless work #592

Open
AnthonyTornetta opened this issue Oct 21, 2024 · 0 comments · May be fixed by #593

Comments

@AnthonyTornetta
Copy link
Contributor

When calling Collider::set_position or Collider::set_position_wrt_parent it adds the ColliderChanges::PARENT flag to the collider. This causes the step_simulation to do a lot of extra work handling those changes. We call these methods when detecting a change in the Transform of a collider in apply_collider_user_changes, but don't verify that the transform has actually changed based on what is currently set in rapier. This leads to a lot of useless work being done in step_simulation that can lead to huge slowdowns.
This is a very easy fix, and can be done by verifying the value we are setting is different from what is there before setting it.

AnthonyTornetta added a commit to AnthonyTornetta/bevy_rapier that referenced this issue Oct 21, 2024
This prevents excess work from being done in step_simulation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant