Skip to content

Commit

Permalink
Fix async_scene_collider_initializes
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-blackbird committed Mar 6, 2023
1 parent 2e71f10 commit 5bd3f1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/plugin/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ where
.after(systems::init_joints)
.after(systems::apply_initial_rigid_body_impulses),
#[cfg(all(feature = "dim3", feature = "async-collider"))]
systems::init_async_scene_colliders.before(systems::init_async_colliders),
systems::init_async_scene_colliders
.after(bevy::scene::scene_spawner_system)
.before(systems::init_async_colliders),
)
.into_configs(),
PhysicsSet::SyncBackendFlush => (apply_system_buffers,).into_configs(),
Expand Down
7 changes: 4 additions & 3 deletions src/plugin/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1531,9 +1531,11 @@ mod tests {
#[test]
#[cfg(all(feature = "dim3", feature = "async-collider"))]
fn async_scene_collider_initializes() {
use bevy::scene::scene_spawner_system;

let mut app = App::new();
app.add_plugin(HeadlessRenderPlugin)
.add_system(init_async_scene_colliders);
.add_system(init_async_scene_colliders.after(scene_spawner_system));

let mut meshes = app.world.resource_mut::<Assets<Mesh>>();
let cube_handle = meshes.add(Cube::default().into());
Expand Down Expand Up @@ -1712,8 +1714,7 @@ mod tests {

impl Plugin for HeadlessRenderPlugin {
fn build(&self, app: &mut App) {
app.add_plugin(TaskPoolPlugin::default())
.add_plugin(WindowPlugin::default())
app.add_plugin(WindowPlugin::default())
.add_plugin(AssetPlugin::default())
.add_plugin(ScenePlugin::default())
.add_plugin(RenderPlugin {
Expand Down

0 comments on commit 5bd3f1e

Please sign in to comment.