From 1b78a9129d1fa5cbc046727c21ff957d6c88f547 Mon Sep 17 00:00:00 2001 From: Mikkel Luja Rasmussen Date: Thu, 27 Jan 2022 11:34:15 +0100 Subject: [PATCH 1/4] Updated readme, example, to edition 2021 & CI --- .github/workflows/rust.yml | 2 ++ Cargo.toml | 16 ++++++++-------- README.md | 10 +++++----- examples/basic.rs | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2b595c7..cda2d9a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,6 +38,8 @@ jobs: needs: update steps: - uses: actions/checkout@v2 + - name: Install libwayland + run: sudo apt install libwayland-dev - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/Cargo.toml b/Cargo.toml index e54b58a..b4634b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,23 +1,23 @@ [package] +name = "bevy_flycam" +version = "0.6.0" authors = ["Spencer Burris "] -categories = ["game-engines", "game-development"] +edition = "2021" +license = "ISC" description = "Basic first-person fly camera for the Bevy game engine" -edition = "2018" homepage = "https://github.com/sburris0/bevy_flycam/" -keywords = ["gamedev", "bevy", "3d", "camera"] -license = "ISC" -name = "bevy_flycam" -readme = "README.md" repository = "https://github.com/sburris0/bevy_flycam/" +readme = "README.md" +keywords = ["gamedev", "bevy", "3d", "camera"] +categories = ["game-engines", "game-development"] resolver = "2" -version = "0.6.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] bevy = {version = "0.6", default-features = false, features = ["render"]} [dev-dependencies] -bevy = {version = "0.6", default-features = false, features = ["render", "bevy_render", "bevy_winit"]} +bevy = {version = "0.6", default-features = false, features = ["bevy_winit"]} [target.'cfg(target_os = "linux")'.dev-dependencies] bevy = {version = "0.6", default-features = false, features = ["x11", "wayland"]} diff --git a/README.md b/README.md index 63bcd05..f8f108e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![docs.rs](https://img.shields.io/docsrs/bevy_flycam) -A basic first-person fly camera for Bevy 0.5 +A basic first-person fly camera for Bevy 0.6 ## Controls * WASD to move horizontally @@ -25,7 +25,7 @@ There are a few notable differences from [bevy_fly_camera](https://github.com/mc 1. Add to `Cargo.toml` or copy `lib.rs` to your own file ```toml [dependencies] -bevy = "0.5" +bevy = "0.6" bevy_flycam = "*" ``` @@ -33,7 +33,7 @@ or ```toml [dependencies] -bevy = "0.5" +bevy = "0.6" bevy_flycam = { git = "https://github.com/sburris0/bevy_flycam" } ``` @@ -48,7 +48,7 @@ Use `NoCameraPlayerPlugin` if you do not want this and make sure to use `.insert ```rust #[bevy_main] fn main() { - App::build() + App::new() .add_plugins(DefaultPlugins) .add_plugin(PlayerPlugin) .run(); @@ -63,7 +63,7 @@ To modify player movement speed or mouse sensitivity, import `bevy_flycam::Movem ```Rust #[bevy_main] fn main() { - App::build() + App::new() .add_plugins(DefaultPlugins) .add_plugin(PlayerPlugin) .insert_resource(MovementSettings { diff --git a/examples/basic.rs b/examples/basic.rs index c536122..e160ff5 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -17,7 +17,7 @@ fn main() { sensitivity: 0.00015, // default: 0.00012 speed: 12.0, // default: 12.0 }) - .add_startup_system(setup.system()) + .add_startup_system(setup) .run(); } From 814182fbaab82cd12ad7725d27cf64be12050dfc Mon Sep 17 00:00:00 2001 From: Mikkel Luja Rasmussen Date: Thu, 27 Jan 2022 11:41:09 +0100 Subject: [PATCH 2/4] Added xkbcommon to CI --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cda2d9a..0b863f6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -40,6 +40,8 @@ jobs: - uses: actions/checkout@v2 - name: Install libwayland run: sudo apt install libwayland-dev + - name: Install xkbcommon + run: sudo apt install xkbcommon - uses: actions-rs/toolchain@v1 with: profile: minimal From 6c483ef12bc8a25572474461e597ff96f9670504 Mon Sep 17 00:00:00 2001 From: Mikkel Luja Rasmussen Date: Thu, 27 Jan 2022 11:46:09 +0100 Subject: [PATCH 3/4] Updated CI to match evy_midi CI --- .github/workflows/rust.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0b863f6..2c2a35c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,10 +38,14 @@ jobs: needs: update steps: - uses: actions/checkout@v2 + - name: Update apt + run: sudo apt update + - name: Install libudev + run: sudo apt install libudev-dev + - name: Install libxkbcommon + run: sudo apt install libxkbcommon-dev - name: Install libwayland run: sudo apt install libwayland-dev - - name: Install xkbcommon - run: sudo apt install xkbcommon - uses: actions-rs/toolchain@v1 with: profile: minimal From 7b194fc1a4aaaa3c35641760432f5c90703ed830 Mon Sep 17 00:00:00 2001 From: Mikkel Luja Rasmussen Date: Thu, 27 Jan 2022 12:03:35 +0100 Subject: [PATCH 4/4] Added info! to examples --- examples/basic.rs | 5 +++++ examples/scroll.rs | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/basic.rs b/examples/basic.rs index e160ff5..e1a3258 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -45,4 +45,9 @@ fn setup( transform: Transform::from_xyz(4.0, 8.0, 4.0), ..Default::default() }); + + info!("Move camera around by using WASD for lateral movement"); + info!("Use Left Shift and Spacebar for vertical movement"); + info!("Use the mouse to look around"); + info!("Press Esc to hide or show the mouse cursor"); } diff --git a/examples/scroll.rs b/examples/scroll.rs index 2d70c8e..66f6717 100644 --- a/examples/scroll.rs +++ b/examples/scroll.rs @@ -27,9 +27,9 @@ fn main() { }) // Setting initial state .add_state(ScrollType::MovementSpeed) - .add_startup_system(setup.system()) - .add_system(switch_scroll_type.system()) - .add_system(scroll.system()) + .add_startup_system(setup) + .add_system(switch_scroll_type) + .add_system(scroll) .run(); } @@ -66,6 +66,9 @@ fn setup( // add plugin commands.spawn_bundle(camera).insert(FlyCam); + + info!("Press 'Z' to switch between Movement Speed and Zoom"); + info!("Changing the selected value by scrolling the mousewheel"); } // Listens for Z key being pressed and toggles between the two scroll-type states