working zoom on mobile

This commit is contained in:
Arkitu 2025-05-25 09:42:51 +02:00
parent 2552d0dcdd
commit f46536ecc8
3 changed files with 2 additions and 12 deletions

10
Cargo.lock generated
View File

@ -352,7 +352,6 @@ version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eaad7fe854258047680c51c3cacb804468553c04241912f6254c841c67c0198"
dependencies = [
"bevy_dylib",
"bevy_internal",
]
@ -584,15 +583,6 @@ dependencies = [
"sysinfo",
]
[[package]]
name = "bevy_dylib"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "381b2a0773cfe9d27256fba1e5005a14968b34f751c09397ee4e278f0fb235db"
dependencies = [
"bevy_internal",
]
[[package]]
name = "bevy_ecs"
version = "0.15.3"

View File

@ -36,7 +36,6 @@ bevy = { version = "0.15", default-features = false, features = [
"png",
"tonemapping_luts",
"bevy_pbr",
"dynamic_linking",
] }
#bevy-inspector-egui = { version = "0.28", default-features = false, features = [
# "bevy_image",

View File

@ -86,7 +86,8 @@ fn setup(mut world: Commands, asset_server: Res<AssetServer>) {
if ptrs.0.len() > 1 {
let forward = cam.forward();
cam.translation += forward * (old_d_to_midpoint/new_d_to_midpoint * 0.1);
let z = cam.translation.z;
cam.translation += forward * (z * (1. - (new_d_to_midpoint/old_d_to_midpoint)) / forward.z);
// cam.scale *= old_d_to_midpoint/new_d_to_midpoint;
}
}