Skip to content

Commit

Permalink
Merge pull request update to 0.6 from mnett82/master
Browse files Browse the repository at this point in the history
Test Suite fails due to the CI system itself, which is gonna remedied after the merge
  • Loading branch information
BlackPhlox authored Jan 27, 2022
2 parents ca25a0f + b5962fd commit 6a0aeb4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
name = "bevy_flycam"
version = "0.5.1"
authors = ["Spencer Burris <[email protected]>"]
edition = "2018"
license = "ISC"
categories = ["game-engines", "game-development"]
description = "Basic first-person fly camera for the Bevy game engine"
edition = "2018"
homepage = "https://github.com/sburris0/bevy_flycam/"
repository = "https://github.com/sburris0/bevy_flycam/"
keywords = ["gamedev", "bevy", "3d", "camera"]
license = "ISC"
name = "bevy_flycam"
readme = "README.md"
keywords = ["gamedev", "bevy", "3d", "camera", ]
categories = ["game-engines", "game-development"]

repository = "https://github.com/sburris0/bevy_flycam/"
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.5", default-features = false, features = ["render"] }
bevy = {version = "0.6", default-features = false, features = ["render"]}

[dev-dependencies]
bevy = { version = "0.5", default-features = false, features = ["render", "bevy_winit", "bevy_wgpu" ] }
bevy = {version = "0.6", default-features = false, features = ["render", "bevy_render", "bevy_winit"]}

[target.'cfg(target_os = "linux")'.dev-dependencies]
bevy = { version = "0.5", default-features = false, features = [ "x11", "wayland" ] }
bevy = {version = "0.6", default-features = false, features = ["x11", "wayland"]}
4 changes: 2 additions & 2 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bevy_flycam::PlayerPlugin;
//https://github.com/bevyengine/bevy/blob/latest/examples/3d/3d_scene.rs

fn main() {
App::build()
App::new()
.insert_resource(Msaa { samples: 4 })
.add_plugins(DefaultPlugins)
.add_plugin(PlayerPlugin)
Expand Down Expand Up @@ -41,7 +41,7 @@ fn setup(
..Default::default()
});
// light
commands.spawn_bundle(LightBundle {
commands.spawn_bundle(PointLightBundle {
transform: Transform::from_xyz(4.0, 8.0, 4.0),
..Default::default()
});
Expand Down
4 changes: 2 additions & 2 deletions examples/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum ScrollType {
}

fn main() {
App::build()
App::new()
.insert_resource(Msaa { samples: 4 })
.add_plugins(DefaultPlugins)
//NoCameraPlayerPlugin as we provide the camera
Expand Down Expand Up @@ -53,7 +53,7 @@ fn setup(
..Default::default()
});
// light
commands.spawn_bundle(LightBundle {
commands.spawn_bundle(PointLightBundle {
transform: Transform::from_xyz(4.0, 8.0, 4.0),
..Default::default()
});
Expand Down
23 changes: 12 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl Default for MovementSettings {
}

/// Used in queries when you want flycams and not other cameras
#[derive(Component)]
pub struct FlyCam;

/// Grabs/ungrabs mouse cursor
Expand Down Expand Up @@ -122,26 +123,26 @@ fn cursor_grab(keys: Res<Input<KeyCode>>, mut windows: ResMut<Windows>) {
/// Contains everything needed to add first-person fly camera behavior to your game
pub struct PlayerPlugin;
impl Plugin for PlayerPlugin {
fn build(&self, app: &mut AppBuilder) {
fn build(&self, app: &mut App) {
app.init_resource::<InputState>()
.init_resource::<MovementSettings>()
.add_startup_system(setup_player.system())
.add_startup_system(initial_grab_cursor.system())
.add_system(player_move.system())
.add_system(player_look.system())
.add_system(cursor_grab.system());
.add_startup_system(setup_player)
.add_startup_system(initial_grab_cursor)
.add_system(player_move)
.add_system(player_look)
.add_system(cursor_grab);
}
}

/// Same as `PlayerPlugin` but does not spawn a camera
pub struct NoCameraPlayerPlugin;
impl Plugin for NoCameraPlayerPlugin {
fn build(&self, app: &mut AppBuilder) {
fn build(&self, app: &mut App) {
app.init_resource::<InputState>()
.init_resource::<MovementSettings>()
.add_startup_system(initial_grab_cursor.system())
.add_system(player_move.system())
.add_system(player_look.system())
.add_system(cursor_grab.system());
.add_startup_system(initial_grab_cursor)
.add_system(player_move)
.add_system(player_look)
.add_system(cursor_grab);
}
}

0 comments on commit 6a0aeb4

Please sign in to comment.