diff --git a/Cargo.toml b/Cargo.toml index a0431007..26f78c8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ opt-level = 1 codegen-units = 1 [patch.crates-io] +bevy = { git = "https://github.com/bevyengine/bevy" } +nalgebra = { git = "https://github.com/dimforge/nalgebra" } + #nalgebra = { path = "../nalgebra" } #parry2d = { path = "../parry/crates/parry2d" } #parry3d = { path = "../parry/crates/parry3d" } diff --git a/bevy_rapier2d/Cargo.toml b/bevy_rapier2d/Cargo.toml index 63b06a54..c4147b42 100644 --- a/bevy_rapier2d/Cargo.toml +++ b/bevy_rapier2d/Cargo.toml @@ -32,18 +32,18 @@ headless = [] async-collider = [ "bevy/bevy_asset", "bevy/bevy_scene" ] [dependencies] -bevy = { version = "0.12", default-features = false } -nalgebra = { version = "0.32.3", features = [ "convert-glam024" ] } +bevy = { version = "0.13", default-features = false } +nalgebra = { version = "0.32.3", features = [ "convert-glam025" ] } rapier2d = "0.18.0" bitflags = "2.4" log = "0.4" serde = { version = "1", features = [ "derive" ], optional = true} [dev-dependencies] -bevy = { version = "0.12", default-features = false, features = ["x11"]} +bevy = { version = "0.13", default-features = false, features = ["x11"] } oorandom = "11" approx = "0.5.1" -glam = { version = "0.24", features = [ "approx" ] } +glam = { version = "0.25", features = [ "approx" ] } [package.metadata.docs.rs] # Enable all the features when building the docs on docs.rs diff --git a/bevy_rapier2d/examples/player_movement2.rs b/bevy_rapier2d/examples/player_movement2.rs index 70774fc7..99e01f0e 100644 --- a/bevy_rapier2d/examples/player_movement2.rs +++ b/bevy_rapier2d/examples/player_movement2.rs @@ -49,14 +49,14 @@ pub fn spawn_player(mut commands: Commands, mut rapier_config: ResMut>, + keyboard_input: Res>, mut player_info: Query<(&Player, &mut Velocity)>, ) { for (player, mut rb_vels) in &mut player_info { - let up = keyboard_input.any_pressed([KeyCode::W, KeyCode::Up]); - let down = keyboard_input.any_pressed([KeyCode::S, KeyCode::Down]); - let left = keyboard_input.any_pressed([KeyCode::A, KeyCode::Left]); - let right = keyboard_input.any_pressed([KeyCode::D, KeyCode::Right]); + let up = keyboard_input.any_pressed([KeyCode::KeyW, KeyCode::ArrowUp]); + let down = keyboard_input.any_pressed([KeyCode::KeyS, KeyCode::ArrowDown]); + let left = keyboard_input.any_pressed([KeyCode::KeyA, KeyCode::ArrowLeft]); + let right = keyboard_input.any_pressed([KeyCode::KeyD, KeyCode::ArrowRight]); let x_axis = -(left as i8) + right as i8; let y_axis = -(down as i8) + up as i8; diff --git a/bevy_rapier2d/examples/testbed2.rs b/bevy_rapier2d/examples/testbed2.rs index ff1094d6..37da3069 100644 --- a/bevy_rapier2d/examples/testbed2.rs +++ b/bevy_rapier2d/examples/testbed2.rs @@ -37,7 +37,7 @@ struct ExamplesRes { fn main() { let mut app = App::new(); - app.add_state::() + app.init_state::() .init_resource::() .add_plugins(( DefaultPlugins, @@ -186,7 +186,7 @@ fn cleanup(world: &mut World) { fn check_toggle( state: Res>, mut next_state: ResMut>, - mouse_input: Res>, + mouse_input: Res>, ) { if mouse_input.just_pressed(MouseButton::Left) { let next = match *state.get() { diff --git a/bevy_rapier3d/Cargo.toml b/bevy_rapier3d/Cargo.toml index 31ce5832..a8487673 100644 --- a/bevy_rapier3d/Cargo.toml +++ b/bevy_rapier3d/Cargo.toml @@ -33,17 +33,17 @@ headless = [ ] async-collider = [ "bevy/bevy_asset", "bevy/bevy_scene" ] [dependencies] -bevy = { version = "0.12", default-features = false } -nalgebra = { version = "0.32.3", features = [ "convert-glam024" ] } +bevy = { version = "0.13", default-features = false } +nalgebra = { version = "0.32.3", features = [ "convert-glam025" ] } rapier3d = "0.18" bitflags = "2.4" log = "0.4" serde = { version = "1", features = [ "derive" ], optional = true} [dev-dependencies] -bevy = { version = "0.12", default-features = false, features = ["x11", "tonemapping_luts"]} +bevy = { version = "0.13", default-features = false, features = ["x11", "tonemapping_luts"]} approx = "0.5.1" -glam = { version = "0.24", features = [ "approx" ] } +glam = { version = "0.25", features = [ "approx" ] } [package.metadata.docs.rs] # Enable all the features when building the docs on docs.rs diff --git a/bevy_rapier3d/examples/ray_casting3.rs b/bevy_rapier3d/examples/ray_casting3.rs index babe037c..4599a722 100644 --- a/bevy_rapier3d/examples/ray_casting3.rs +++ b/bevy_rapier3d/examples/ray_casting3.rs @@ -94,7 +94,7 @@ pub fn cast_ray( // Then cast the ray. let hit = rapier_context.cast_ray( ray.origin, - ray.direction, + ray.direction.into(), f32::MAX, true, QueryFilter::only_dynamic(), diff --git a/bevy_rapier3d/examples/testbed3.rs b/bevy_rapier3d/examples/testbed3.rs index 8ea8ca54..1d3e3db1 100644 --- a/bevy_rapier3d/examples/testbed3.rs +++ b/bevy_rapier3d/examples/testbed3.rs @@ -35,7 +35,7 @@ struct ExamplesRes { fn main() { let mut app = App::new(); - app.add_state::() + app.init_state::() .init_resource::() .add_plugins(( DefaultPlugins, @@ -177,7 +177,7 @@ fn cleanup(world: &mut World) { fn check_toggle( state: Res>, mut next_state: ResMut>, - mouse_input: Res>, + mouse_input: Res>, ) { if mouse_input.just_pressed(MouseButton::Left) { let next = match *state.get() { diff --git a/src/plugin/systems.rs b/src/plugin/systems.rs index 327a276b..fe21cc93 100644 --- a/src/plugin/systems.rs +++ b/src/plugin/systems.rs @@ -1518,7 +1518,7 @@ pub fn update_character_controls( #[cfg(test)] mod tests { #[cfg(all(feature = "dim3", feature = "async-collider"))] - use bevy::prelude::shape::{Capsule, Cube}; + use bevy::prelude::{Capsule3d, Cuboid}; use bevy::{ asset::AssetPlugin, ecs::event::Events, @@ -1629,7 +1629,7 @@ mod tests { .add_systems(Update, init_async_colliders); let mut meshes = app.world.resource_mut::>(); - let cube = meshes.add(Cube::default().into()); + let cube = meshes.add(Cuboid::default()); let entity = app.world.spawn((cube, AsyncCollider::default())).id(); @@ -1654,8 +1654,8 @@ mod tests { .add_systems(PostUpdate, init_async_scene_colliders); let mut meshes = app.world.resource_mut::>(); - let cube_handle = meshes.add(Cube::default().into()); - let capsule_handle = meshes.add(Capsule::default().into()); + let cube_handle = meshes.add(Cuboid::default()); + let capsule_handle = meshes.add(Capsule3d::default()); let cube = app.world.spawn((Name::new("Cube"), cube_handle)).id(); let capsule = app.world.spawn((Name::new("Capsule"), capsule_handle)).id(); @@ -1843,6 +1843,7 @@ mod tests { backends: None, ..Default::default() }), + ..Default::default() }, ImagePlugin::default(), )); diff --git a/src/render/mod.rs b/src/render/mod.rs index 7bc01880..c68ec41c 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -98,7 +98,7 @@ struct BevyLinesRenderBackend<'world, 'state, 'a, 'b> { physics_scale: f32, custom_colors: Query<'world, 'state, &'a ColliderDebugColor>, context: &'b RapierContext, - gizmos: Gizmos<'state>, + gizmos: Gizmos<'world, 'state>, } impl<'world, 'state, 'a, 'b> BevyLinesRenderBackend<'world, 'state, 'a, 'b> {