From b48567d87fd0eac152e387d633ae782aea89cb9e Mon Sep 17 00:00:00 2001 From: ladevieq Date: Thu, 21 Jan 2021 21:58:02 +0100 Subject: Fix kbd + camera movements --- src/camera.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/camera.cpp') diff --git a/src/camera.cpp b/src/camera.cpp index 54c847d..ff09e20 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -36,3 +36,8 @@ void camera::set_aspect_ratio(float aspect_ratio) { first_pixel = position - horizontal / 2.0 - vertical / 2.0 + focus_distance * forward; } + +void camera::move(vec3 v) { + position += v; + first_pixel = position - horizontal / 2.0 - vertical / 2.0 + focus_distance * forward; +} -- cgit v1.3