Making SolverGenericContact's contact_id public. #888
Merged
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.
Contact manifolds currently contain a list of points that includes predictive points (eg, points which aren't currently colliding, but which Rapier keeps an eye on to ensure stability). The problem is, when we receive those contact manifolds (in my case, using Godot-Rapier), we then have to filter out those predictive points manually.
Rapier already has methodology for filtering out predictive points; after this filtering process, it uses the remaining verified contact points to generate SolverContacts. Each SolverContact contains a contact_id, which corresponds to the ID of the manifold contact used to generate it. So if we had access to this contact_id, we would be able to simply process only those contact points that generated legitimate solver contacts-- we could avoid having to duplicate Rapier's filtering logic. The only problem is, contact_id is currently only public within its crate. So this PR just makes it public. I think this is ok; I don't see a way for it to backfire personally, but let me know if there's something I've missed.