-
-
Notifications
You must be signed in to change notification settings - Fork 275
Split RapierContext #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ThierryBerger
merged 31 commits into
dimforge:master
from
ThierryBerger:split_rapiercontext
Dec 10, 2024
Merged
Split RapierContext #585
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
b9f3a6f
add example to output a debugdump of postupdate
ThierryBerger ff03180
better multiple sets for propagate transforms
ThierryBerger 16c3e3f
allow system race for writeback
ThierryBerger b669fe2
remove ambiguity from example
ThierryBerger 2c586e9
Merge remote-tracking branch 'upstream' into debugdump
ThierryBerger 310ab56
filter out some less relevant systems
ThierryBerger 8e553a8
Merge branch 'debugdump' into system_schedules
ThierryBerger e32c4a6
remove dbg
ThierryBerger ad498ee
Merge branch 'debugdump' into system_schedules
ThierryBerger c7ee449
split joints and colliders out of rapier context
ThierryBerger 6beece6
split query pipeline + add a 'RapierContextWhole', designed to be the…
ThierryBerger 20c47d8
split rigidbody set
ThierryBerger 7519a8c
Merge branch 'master' into split_rapiercontext
ThierryBerger 4df1d88
use a RapierContext systemparam for a better API ; rework modules + u…
ThierryBerger 6b44512
add some missing doc for systemparams
ThierryBerger 7b93dba
remove unnecessary macro + fix clippy + docs
ThierryBerger fe1b49a
use a bundle to create correct rapier context components
ThierryBerger 83c795f
Merge branch 'master' into split_rapiercontext
ThierryBerger 78dc64e
add an example to access a specific component of RapierContext
ThierryBerger 8d78d77
changelog adaptations
ThierryBerger 3e98da1
more functions transparent for RapierContext and RapierContextMut
ThierryBerger a8c94b4
Merge branch 'master' into split_rapiercontext
ThierryBerger e302ed9
avoid using term 'world' when referring to a physics context, to avoi…
ThierryBerger 7cff2c2
please clippy
ThierryBerger 6698a9e
Merge upstream main into split_rapiercontext
ThierryBerger 186dcd2
Merge remote-tracking branch 'upstream' into split_rapiercontext
ThierryBerger e5adab3
adapt changelog +_doc + bevy 0.15 fixes
ThierryBerger 64127e5
use required components
ThierryBerger fc82f9b
run component example after syncBackend to have correct state at the …
ThierryBerger 6950734
run component example after syncBackend to have correct state at the …
ThierryBerger d9701e1
fix doc
ThierryBerger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| use bevy::prelude::*; | ||
| use bevy_rapier3d::prelude::*; | ||
|
|
||
| fn main() { | ||
| App::new() | ||
| .add_plugins(( | ||
| DefaultPlugins, | ||
| RapierPhysicsPlugin::<NoUserData>::default(), | ||
| RapierDebugRenderPlugin::default(), | ||
| )) | ||
| .add_systems(Startup, (setup_physics, setup_graphics)) | ||
| .add_systems( | ||
| PostUpdate, | ||
| display_nb_colliders.after(PhysicsSet::SyncBackend), | ||
| ) | ||
| .run(); | ||
| } | ||
|
|
||
| /// Demonstrates how to access a more specific component of [`RapierContext`] | ||
| fn display_nb_colliders( | ||
| query_context: Query<&RapierContextColliders, With<DefaultRapierContext>>, | ||
| mut exit: EventWriter<AppExit>, | ||
| ) { | ||
| let nb_colliders = query_context.single().colliders.len(); | ||
| println!("There are {nb_colliders} colliders."); | ||
| assert!(nb_colliders > 0); | ||
| exit.send(AppExit::Success); | ||
| } | ||
|
|
||
| pub fn setup_physics(mut commands: Commands) { | ||
| /* | ||
| * Ground | ||
| */ | ||
| let ground_size = 5.1; | ||
| let ground_height = 0.1; | ||
|
|
||
| let starting_y = -0.5 - ground_height; | ||
|
|
||
| commands.spawn(( | ||
| Transform::from_xyz(0.0, starting_y, 0.0), | ||
| Collider::cuboid(ground_size, ground_height, ground_size), | ||
| )); | ||
|
|
||
| for _ in 0..3 { | ||
| /* | ||
| * Create the cubes | ||
| */ | ||
|
|
||
| commands.spawn(( | ||
| Transform::default(), | ||
| RigidBody::Dynamic, | ||
| Collider::cuboid(0.5, 0.5, 0.5), | ||
| )); | ||
| } | ||
| } | ||
|
|
||
| fn setup_graphics(mut commands: Commands) { | ||
| commands.spawn(( | ||
| Camera3d::default(), | ||
| Transform::from_xyz(0.0, 3.0, -10.0).looking_at(Vec3::new(0.0, 0.0, 0.0), Vec3::Y), | ||
| )); | ||
| } |
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could avoid this indirection to
single()if we implemented all methods ofRapierContexton its systemParam ; but: