Skip to content

Commit

Permalink
Upgrade to Bevy 0.12 (#21)
Browse files Browse the repository at this point in the history
Updates dependencies to support Bevy 0.12 and replaces the depracated
`iter` method to `read` for event readers. A really easy migration :)
  • Loading branch information
Jondolf authored Nov 11, 2023
1 parent bb7206c commit d1820b1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

* Bump `bevy` to `0.12.x`
* Bump `bevy_rapier3d` to `0.23.x`
* Bump `bevy_inspector_egui` to `0.21.x`
* Fixed clippy warnings for rust 1.72.0 (#19)
* Added rustfmt config (#19)
* Added vertex colors in flag example (#19)
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ rapier_collisions = ["bevy_rapier3d"]
thiserror = "1.0"

[dependencies.bevy]
version = "0.11"
version = "0.12"
default-features = false
features = ["bevy_render", "bevy_asset"]

[dependencies.bevy_rapier3d]
version = "0.22"
version = "0.23"
optional = true
default-features = false
features = ["dim3", "async-collider"]

[dev-dependencies]
bevy-inspector-egui = "0.19"
bevy_rapier3d = "0.22"
bevy-inspector-egui = "0.21"
bevy_rapier3d = "0.23"
rand = "0.8"

[dev-dependencies.bevy]
version = "0.11"
version = "0.12"
features = [
"bevy_asset",
"bevy_winit",
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ use bevy_silk::prelude::*;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(ClothPlugin)
.add_plugins((DefaultPlugins, ClothPlugin))
// ... Add your resources and systems
.run();
}
Expand Down Expand Up @@ -170,14 +169,13 @@ use bevy_silk::prelude::*;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins((DefaultPlugins, ClothPlugin))
.insert_resource(ClothConfig {
gravity: Vec3::new(0.0, -9.81, 0.0),
friction: 0.02,
sticks_computation_depth: 5,
acceleration_smoothing: AccelerationSmoothing::default()
})
.add_plugin(ClothPlugin)
// ... Add your resources and systems
.run();
}
Expand All @@ -203,7 +201,7 @@ use bevy_silk::prelude::*;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins((DefaultPlugins, ClothPlugin))
.insert_resource(Winds {
wind_forces: vec![Wind::SinWave {
max_velocity: Vec3::new(10.0, 15.0, -5.0),
Expand All @@ -212,7 +210,6 @@ fn main() {
abs: false
}]
})
.add_plugin(ClothPlugin)
// ... Add your resources and systems
.run();
}
Expand Down
6 changes: 3 additions & 3 deletions examples/camera_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ pub fn handle_camera(
let up = transform.local_y();
// Rotate
if buttons.pressed(MouseButton::Left) {
for ev in motion_evr.iter() {
for ev in motion_evr.read() {
let delta = -ev.delta * delta_time * 0.1;
transform.rotate_y(delta.x);
transform.rotate_local_x(delta.y);
}
}
// Pan
if buttons.pressed(MouseButton::Right) {
for ev in motion_evr.iter() {
for ev in motion_evr.read() {
let delta = ev.delta * delta_time;
transform.translation += -right * delta.x;
transform.translation += up * delta.y;
}
}
// Zoom
for ev in scroll_evr.iter() {
for ev in scroll_evr.read() {
transform.translation += ev.y * delta_time * forward * 10.0;
}
}
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugin(ClothPlugin)
//! .add_plugins((DefaultPlugins, ClothPlugin))
//! // ... Add your resources and systems
//! .run();
//! }
Expand Down Expand Up @@ -161,14 +160,13 @@
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugins((DefaultPlugins, ClothPlugin))
//! .insert_resource(ClothConfig {
//! gravity: Vec3::new(0.0, -9.81, 0.0),
//! friction: 0.02,
//! sticks_computation_depth: 5,
//! acceleration_smoothing: AccelerationSmoothing::default()
//! })
//! .add_plugin(ClothPlugin)
//! // ... Add your resources and systems
//! .run();
//! }
Expand All @@ -194,7 +192,7 @@
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugins((DefaultPlugins, ClothPlugin))
//! .insert_resource(Winds {
//! wind_forces: vec![Wind::SinWave {
//! max_velocity: Vec3::new(10.0, 15.0, -5.0),
Expand All @@ -203,7 +201,6 @@
//! abs: false
//! }]
//! })
//! .add_plugin(ClothPlugin)
//! // ... Add your resources and systems
//! .run();
//! }
Expand Down

0 comments on commit d1820b1

Please sign in to comment.