From 5d935c26589c014e6dc2941481988abf50e51fdf Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Jan 2025 03:11:29 +0100 Subject: fix triple inverted projection madness --- client/src/camera.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/src/camera.rs') diff --git a/client/src/camera.rs b/client/src/camera.rs index d7a69c5..f5a911b 100644 --- a/client/src/camera.rs +++ b/client/src/camera.rs @@ -33,15 +33,15 @@ impl Camera { } } pub fn update(&mut self, input_move: Vec3, input_rot: Vec2, dt: f32) { - self.pos += self.rotation_mat() * (-vec3(input_move.z, input_move.y, input_move.x) * dt); - self.rot.x += input_rot.x * 0.002; - self.rot.y += input_rot.y * 0.002; + self.pos += self.rotation_mat() * (vec3(input_move.z, input_move.y, -input_move.x) * dt); + self.rot.x += input_rot.x * -0.002; + self.rot.y += input_rot.y * -0.002; } pub fn rotation_mat(&self) -> Mat3 { Mat3::from_euler(EulerRot::YXZ, self.rot.x, self.rot.y, self.rot.z) } pub fn to_matrix(&self) -> Mat4 { - Mat4::perspective_infinite_reverse_rh(self.fov, self.aspect, 0.1) + Mat4::perspective_rh(self.fov, self.aspect, 0.1, 100.) * Mat4::from_mat3(self.rotation_mat().inverse()) * Mat4::from_translation(-self.pos) } -- cgit v1.2.3-70-g09d2