From 02b70c053cc5f896e8a5105245bf8dd174643ae7 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 24 Oct 2025 19:17:36 -0700 Subject: Normalize camera translation vector --- src/plugins/viewer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/viewer.c b/src/plugins/viewer.c index bbdd2ae..b05cfe1 100644 --- a/src/plugins/viewer.c +++ b/src/plugins/viewer.c @@ -225,8 +225,8 @@ static void update_camera( (R)(command.CameraMoveRight ? 1 : 0); const R move_y = (R)(command.CameraMoveForward ? 1 : 0) + (R)(command.CameraMoveBackward ? -1 : 0); - const vec2 translation = - vec2_scale(vec2_make(move_x, move_y), controller->camera_speed * dt); + const vec2 translation = vec2_scale( + vec2_normalize(vec2_make(move_x, move_y)), controller->camera_speed * dt); spatial3_move_right(camera, translation.x); spatial3_move_forwards(camera, translation.y); -- cgit v1.2.3