From 77ea099880b6e331d3810d5632aeb4e1ea992b6c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 4 Oct 2023 22:20:49 -0700 Subject: [PATCH] use absolute pos --- src/physics.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index 7d79768..263b1bc 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -173,8 +173,8 @@ impl PhysicsCamera { a.y=a.y.clamp(-std::f64::consts::FRAC_PI_2, std::f64::consts::FRAC_PI_2); return a } - fn simulate_move_rotation_y(&self, delta_x: i32) -> glam::Mat3 { - mat3_from_rotation_y_f64(self.angles.x-self.sensitivity.x*(delta_x as f64)) + fn simulate_move_rotation_y(&self, mouse_pos_x: i32) -> glam::Mat3 { + mat3_from_rotation_y_f64(self.angles.x-self.sensitivity.x*((mouse_pos_x-self.mouse.pos.x) as f64)) } }