From 2c8360de342872f65bdef037f3fb5d598b8f26a0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Jan 2025 22:04:34 +0100 Subject: unprojecting to ui surf is hard --- client/src/window.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/src/window.rs') diff --git a/client/src/window.rs b/client/src/window.rs index 107be34..68ca25b 100644 --- a/client/src/window.rs +++ b/client/src/window.rs @@ -85,7 +85,7 @@ impl ApplicationHandler for WindowState { _ => (), } } - sta.delta.move_dir += match event.physical_key { + sta.input_state.move_dir += match event.physical_key { PhysicalKey::Code(KeyCode::KeyW) => Vec3::X, PhysicalKey::Code(KeyCode::KeyS) => Vec3::NEG_X, PhysicalKey::Code(KeyCode::KeyA) => Vec3::NEG_Z, @@ -100,7 +100,7 @@ impl ApplicationHandler for WindowState { sta.click(button, state.is_pressed()); } WindowEvent::CursorMoved { position, .. } => { - sta.delta.cursor_pos = vec2(position.x as f32, position.y as f32); + sta.input_state.cursor_pos = vec2(position.x as f32, position.y as f32); } WindowEvent::CloseRequested => { event_loop.exit(); @@ -119,8 +119,8 @@ impl ApplicationHandler for WindowState { match event { DeviceEvent::MouseMotion { delta } => { if self.lock { - sta.delta.mouse_acc.x += delta.0 as f32; - sta.delta.mouse_acc.y += delta.1 as f32; + sta.input_state.mouse_acc.x += delta.0 as f32; + sta.input_state.mouse_acc.y += delta.1 as f32; } } _ => (), -- cgit v1.2.3-70-g09d2