diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-01-21 21:58:02 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-01-21 21:58:02 +0100 |
| commit | b48567d87fd0eac152e387d633ae782aea89cb9e (patch) | |
| tree | a8ee8c83907f1273d2d24a3c0bfc7a9065cabee8 /src/camera.cpp | |
| parent | 142a370cba076a7cf593c7a48b5414e992311a20 (diff) | |
Fix kbd + camera movements
Diffstat (limited to 'src/camera.cpp')
| -rw-r--r-- | src/camera.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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; +} |
