From 083fc63ffdb664b08a99a21b16f3bf056e22ba84 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 31 Aug 2023 00:54:34 -0700 Subject: [PATCH] fix forward and back --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 945ff9a..83f3312 100644 --- a/src/main.rs +++ b/src/main.rs @@ -504,8 +504,8 @@ impl strafe_client::framework::Example for Skybox { //physique let dt=(time-self.camera.time).as_secs_f32(); self.camera.time=time; - let camera_mat=glam::Mat3::from_euler(glam::EulerRot::YXZ,self.camera.yaw,self.camera.pitch,0f32); - let control_dir=camera_mat*get_control_dir(self.camera.controls&(CONTROL_MOVELEFT|CONTROL_MOVERIGHT)); + let camera_mat=glam::Mat3::from_euler(glam::EulerRot::YXZ,self.camera.yaw,0f32,0f32); + let control_dir=camera_mat*get_control_dir(self.camera.controls&(CONTROL_MOVELEFT|CONTROL_MOVERIGHT|CONTROL_MOVEFORWARD|CONTROL_MOVEBACK)); let d=self.camera.vel.dot(control_dir); if d