Repository navigation
Transfer supported Box2D bodies through rigid area portals - #698
Merged
Merged
Conversation
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.
The Box2D adapter can move one supported whole body between independent area worlds through a rigid portal. Each world steps once before crossing collection; non-stepping staging preserves the source until destination creation succeeds, then commits entity ownership and publishes one traversal. Missing, blocked, full, joint-connected and invalid staging cases retain source ownership; uncertain effects stop the owner with best-effort actual-state inspection.
Preserves supported circle/box descriptors, material, momentum and current awake state. Exit hysteresis prevents immediate reverse traversal, and portal-aware interpolation snaps moved entities. Fixed Runtime filter/damping/sleep defaults remain the supported state boundary. Adds a real rotated two-area entry point, focused tests and generated adapter surface baselines.
Validation: the real
Box2D.Portalsentry passed with one body/entity/traversal, mapped position(9.9,5.15), velocity(-1,4), angular velocity2, and exact five-tick replay under Box2D.NET 3.1.654, .NET runtime 10.0.12 and SDK 10.0.401. Pose/momentum tolerance is2e-5; staging directly constructs rotation to avoid compounding the engine approximation. All 11 focused tests passed, including real staged-body cleanup under an explicitly injected commit interruption; that injection does not claim a native allocator failure. Complete 13-project solution build passed with zero warnings/errors; canonical refresh changed only adapter baselines. Native repository checks and merge readback remain pending; publication and installed support remain separate.