Merged
Conversation
I'm not totally convinced yet, this leads to unfortunate API impacts to users, + bevy_mod_debugdump a bit difficult to parse, see jakobhellermann/bevy_mod_debugdump#50
This was referenced Sep 11, 2024
… new RapierContext once we've split everything
ThierryBerger
commented
Sep 20, 2024
ThierryBerger
commented
Sep 20, 2024
8a05e9a to
3e98da1
Compare
ThierryBerger
added a commit
to ThierryBerger/rapier.rs
that referenced
this pull request
Oct 15, 2024
ThierryBerger
added a commit
to ThierryBerger/rapier.rs
that referenced
this pull request
Oct 15, 2024
…d confusion with bevy ecs World
ThierryBerger
commented
Dec 9, 2024
Comment on lines
+93
to
+95
| let context = rapier_context.single(); | ||
| // Then cast the ray. | ||
| let hit = rapier_context.cast_ray( | ||
| let hit = context.cast_ray( |
Contributor
Author
There was a problem hiding this comment.
We could avoid this indirection to single() if we implemented all methods of RapierContext on its systemParam ; but:
- it would require making the query each time we call a method
- Probably not so much of an issue if queries are cached
- it would require to add another 400 lines of code, I already fear for the maintenance of current layer of indirection, I'd like to keep it at the minimum.
- a declarative macro to generate those ended up a bit too complex, and not much lines saved
- maybe a procedural or a template step could be interesting.
ThierryBerger
commented
Dec 9, 2024
Contributor
Author
There was a problem hiding this comment.
Most of added lines come from this file, which holds a shortcut to functions users are accustomed to. Rather than looking up which component they have to rely on, they have a RapierContext-like API, and can look into it to see what queries it resolves to if they want.
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.
RapierContext#502RapierContextSimulationRapierContextis now aQueryDataaggregating all previously available information from that.Opportunities for parallelized execution seem limited, but exist, this also enables better separation of systems, with more typed information leading to a clearer intent.
I'm not 100% convinced it's a net positive in terms of maintainability, bevy_mod_debugdump is currently harder to read due to this bug: jakobhellermann/bevy_mod_debugdump#50.