From 0a0abfe7b093d91447fb7070820a0e6d56d6c22d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 7 Jan 2025 16:50:44 +0100 Subject: normal texture --- client/src/camera.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src/camera.rs') diff --git a/client/src/camera.rs b/client/src/camera.rs index 289e773..1471a48 100644 --- a/client/src/camera.rs +++ b/client/src/camera.rs @@ -18,8 +18,8 @@ impl Camera { } pub fn update(&mut self, input_move: Vec3, input_rot: Vec2, dt: f32) { self.pos += input_move * dt; - self.rot.x += input_rot.x * 0.002; - self.rot.y += input_rot.y * 0.002; + self.rot.x += input_rot.y * 0.002; + self.rot.y += input_rot.x * 0.002; } pub fn to_matrix(&self) -> Mat4 { // let tdir = @@ -28,10 +28,11 @@ impl Camera { Mat4::perspective_infinite_reverse_rh(self.fov, self.aspect, 0.1) * Mat4::from_mat3(Mat3::from_euler( - EulerRot::ZXY, + EulerRot::YXZ, self.rot.x, self.rot.y, self.rot.z, )) + * Mat4::from_translation(-self.pos) } } -- cgit v1.2.3-70-g09d2