fix: Refactor bepu contact management, support compound shape child index lookup and provide Impact Force evaluation to users#2901
Merged
Eideren merged 13 commits intostride3d:masterfrom Oct 1, 2025
Conversation
…into the Contacts passed to On*Touching
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.
PR Details
Made
IContactEventHandlerobsolete and replacing it byIContactHandlerfor two major reason:OnPairCreated,OnPairUpdated,OnPairEndedare called even when the object is not in contact, after playing around with bepu for a while, I can't think of any reason why this would be useful to me or other users. It is also somewhat ambiguous, as user may mistake this method as the one to use to detect contacts.OnContactAddedandOnContactRemovedare definitely more useful, but still fairly niche and would be better off implemented on the users' side to ensure that we don't pay the cost of this feature for every singleIContactEventHandler, but only those that the user actually cares about.Improvements made to the event interface:
Contacts have been made more user friendly, users can now foreach through each contacts instead of manually inspecting the somewhat obtuse manifold:
Surfaced a couple of new information one might need when receiving a collision:
Breaking Changes
IContactEventHandlershould be replaced withIContactHandler, references in yaml are safe as the former inherits from the later. I marked methods that are now unsupported as errors to let users know that those won't be called anymore.Related Issue
Fixes #2884
Types of changes
Checklist
Todo