Skip to content

Commit

Permalink
Camera zoom level should be i8
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshiew committed Jan 8, 2025
1 parent 54d8a99 commit 839c38d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.example.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
hview_distance: 16
vview_distance: 16
world: "MountainIslands"
zoom_level: 0.0
zoom_level: 0
wx: -1283.0
wy: 140.0
wz: -1752.0
Expand Down
2 changes: 1 addition & 1 deletion crates/infinigen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Plugin for AppPlugin {
});
app.init_state::<AppState>()
.insert_resource(CameraSettings {
zoom_level: self.settings.zoom_level as f32,
zoom_level: self.settings.zoom_level,
rotation_x: self.settings.rotation_x as f32,
rotation_y: self.settings.rotation_y as f32,
rotation_z: self.settings.rotation_z as f32,
Expand Down
4 changes: 2 additions & 2 deletions crates/plugins/src/camera/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy_flycam::FlyCam;

#[derive(Resource)]
pub struct CameraSettings {
pub zoom_level: f32,
pub zoom_level: i8,
pub rotation_x: f32,
pub rotation_y: f32,
pub rotation_z: f32,
Expand All @@ -18,7 +18,7 @@ pub struct CameraSettings {
}

pub fn setup(mut commands: Commands, settings: Res<CameraSettings>) {
let zoom = 2f32.powf(settings.zoom_level);
let zoom = 2f32.powf(settings.zoom_level as f32);
let mut transform =
Transform::from_xyz(settings.wx * zoom, settings.wy * zoom, settings.wz * zoom);
transform.rotation.x = settings.rotation_x;
Expand Down

0 comments on commit 839c38d

Please sign in to comment.