Skip to content

Commit

Permalink
Merge pull request #10 from romenjelly/bevy_0_12
Browse files Browse the repository at this point in the history
Update to Bevy 0.12, bump to 0.4
  • Loading branch information
JonahPlusPlus authored Nov 10, 2023
2 parents 9c8d05d + 4cadfac commit f4d05fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_spectator"
description = "A spectator camera plugin for Bevy"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
authors = ["JonahPlusPlus <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -11,10 +11,10 @@ repository = "https://github.com/JonahPlusPlus/bevy_spectator"
exclude = ["/examples/"]

[dependencies]
bevy = { version = "0.11", default-features = false }
bevy = { version = "0.12", default-features = false }

[dev-dependencies]
bevy = { version = "0.11", default-features = false, features = [
bevy = { version = "0.12", default-features = false, features = [
"bevy_asset",
"bevy_core_pipeline",
"bevy_pbr",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fn setup(mut commands: Commands) {

| bevy | bevy_spectator |
|------|----------------|
| 0.12 | 0.4 |
| 0.11 | 0.3 |
| 0.10 | 0.2 |
| 0.9 | 0.1 |
6 changes: 3 additions & 3 deletions examples/3d_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use bevy_spectator::*;
fn main() {
App::new()
.insert_resource(SpectatorSettings {
base_speed: 0.05,
alt_speed: 0.2,
sensitivity: 0.05,
base_speed: 5.0,
alt_speed: 15.0,
sensitivity: 0.0015,
..default()
})
.add_plugins(DefaultPlugins)
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ fn spectator_update(
window
}
None => {
let Some((window, _)) = windows.iter_mut().find(|(_, primary)| primary.is_some()) else {
let Some((window, _)) = windows.iter_mut().find(|(_, primary)| primary.is_some())
else {
panic!("No primary window found!");
};

Expand Down Expand Up @@ -121,7 +122,7 @@ fn spectator_update(
{
let mouse_delta = {
let mut total = Vec2::ZERO;
for d in motion.iter() {
for d in motion.read() {
total += d.delta;
}
total
Expand All @@ -133,7 +134,7 @@ fn spectator_update(
let mut dof: Vec3 = camera_transform.rotation.to_euler(EulerRot::YXZ).into();

dof.x += mouse_x;
// At 90 degrees, yaw gets misinterpeted as roll. Making 89 the limit fixes that.
// At 90 degrees, yaw gets misinterpreted as roll. Making 89 the limit fixes that.
dof.y = (dof.y + mouse_y).clamp(-89f32.to_radians(), 89f32.to_radians());
dof.z = 0f32;

Expand Down

0 comments on commit f4d05fd

Please sign in to comment.