diff --git a/Cargo.lock b/Cargo.lock index 4fccc48..616a3a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -338,9 +338,9 @@ dependencies = [ [[package]] name = "bevy-inspector-egui" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd64580f4496ed987c6231c6a7d833068914331a9084bf5a3dd9dcbc66fd8a73" +checksum = "36172627eb6fd8586600972bcbba2880ed6f59e4e243dcf2ed7ff68d987577ce" dependencies = [ "bevy-inspector-egui-derive", "bevy_app", @@ -2402,7 +2402,7 @@ dependencies = [ "vec_map", "wasm-bindgen", "web-sys", - "windows 0.52.0", + "windows 0.58.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1c7bdcf..a7e54b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ bevy = { version = "0.15", default-features = false, features = [ "bevy_gltf", "bevy_mesh_picking_backend", "bevy_pbr", - "bevy_picking", + # "bevy_picking", "bevy_render", "bevy_scene", "bevy_sprite", @@ -84,6 +84,9 @@ android_logger = "0.14" [profile.dev] opt-level = 1 +[profile.release] +debug = true + # Enable a large amount of optimization in the dev profile for dependencies. [profile.dev.package."*"] opt-level = 3 diff --git a/src/camera.rs b/src/camera.rs index d7a264c..fae1f10 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -1,13 +1,15 @@ -use bevy::{math::NormedVectorSpace, picking::{focus::HoverMap, pointer::PointerId}, prelude::*, utils::HashMap, window::PrimaryWindow}; +use std::time::Duration; + +use bevy::{input::mouse::MouseWheel, math::NormedVectorSpace, picking::{focus::HoverMap, pointer::PointerId}, prelude::*, utils::HashMap, window::PrimaryWindow}; use crate::ui; pub struct Plugin; impl bevy::prelude::Plugin for Plugin { fn build(&self, app: &mut App) { - app.add_systems(Startup, setup) - .add_systems(Update, move_cam) - .init_resource::(); + app.add_systems(Startup, setup); + // .add_systems(Update, move_cam) + // .init_resource::(); } } @@ -15,40 +17,39 @@ fn setup(mut cmds: Commands, window: Query<&Window>) { let zoom = 2./window.single().width().min(window.single().height()); cmds.spawn(( Camera2d, - Transform::from_scale(Vec3::new(zoom, zoom, 1.)) + Transform::from_scale(Vec3::new(zoom, zoom, zoom)) )); } #[derive(Resource, Default)] -struct Pointers(HashMap); +struct Pointers(HashMap)>); fn move_cam( mut cam: Query<&mut Transform, With>, map_ui_entity: Query>, mouse_buttons: Res>, + mut ev_scroll: EventReader, touches: Res, window: Query<&Window, With>, mut pointers: ResMut, - hover_map: Res + hover_map: Res, + time: Res