From 4e230a869f0b12e7d1cf9159a4900055d31221a1 Mon Sep 17 00:00:00 2001 From: ShenMian Date: Sat, 20 Jul 2024 02:46:18 +0100 Subject: [PATCH 1/3] feat(camera): add mouse-driven panning Enable panning of the camera based on the cursor position relative to the viewport. --- src/camera.rs | 51 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 83daf08..4903c98 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -18,23 +18,59 @@ fn spawn(mut commands: Commands) { pub fn update( keys: Res>, - mut query: Query<(Ref, &mut Transform), With>, + mut query: Query<(&OrthographicProjection, &mut Transform), With>, time: Res