Repository navigation
Conversation
Added logic to manage collider enabled state based on parent.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1023.
ColliderSet::set_parentrewired the collider but never recomputed the inherited enabled projection from the new parent. A collider moved from a disabled body to an enabled body stayedDisabledByParent, and one moved onto a disabled body could stayEnabled, so collision participation depended on the previous parent instead of the final graph.The fix recomputes the inherited state from the new parent (or from standalone status when detached) whenever the collider is not explicitly
Disabled, and setsColliderChanges::ENABLED_OR_DISABLEDwhen the projection changes. An explicitly disabled collider stays disabled, matching how body enable/disable already treats it.Regression tests in
src/geometry/collider_set.rscover reparenting disabled->enabled, enabled->disabled, detach to standalone, and preservation of an explicitly disabled collider across all three transitions. The tests are compiled into both rapier2d and rapier3d.Testing:
cargo testruns were attempted but exceeded the time budget in long-running existing integration cases (3Dsoft_bodies, 2Dheightfield_solver_graph); no assertion failure occurred before the timeout.rapier3d, which is unavailable to the rapier2d doctest harness; that error is insrc/data/arena.rs, untouched by this change.