aboutsummaryrefslogtreecommitdiffstats
path: root/src/camera.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2025-12-24 15:35:21 +0100
committerladevieq <ladevie.quentin@gmail.com>2025-12-24 15:35:21 +0100
commitb4d24e8f2cb4838acc0b827f007e7faa609039ba (patch)
treeba6504b67923789d84b2473eb4e14f7002e34ab7 /src/camera.cpp
parentc29105b461135f3909cca0308fb05715cee45763 (diff)
Use build.bat for building
Everything is included in main.cpp Do not rely on vcpkg anymore
Diffstat (limited to 'src/camera.cpp')
-rw-r--r--src/camera.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index 6950fec..4c63630 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -1,5 +1,3 @@
-#include <cmath>
-
#include "camera.hpp"
#include "utils.hpp"
@@ -38,8 +36,12 @@ void camera::move(const vec3& v) {
}
void camera::rotate_y(float theta) {
- forward.v[0] = forward.v[0] * cos(theta) - forward.v[2] * sin(theta);
- forward.v[2] = forward.v[0] * sin(theta) + forward.v[2] * cos(theta);
+ float v0 = forward.get<0>();
+ float v2 = forward.get<2>();
+ float new_v0 = v0 * cos(theta) - v2 * sin(theta);
+ float new_v2 = v0 * sin(theta) + v2 * cos(theta);
+ forward.set<0>(new_v0);
+ forward.set<2>(new_v2);
forward.normalize();
right = forward.cross(vec3{ 0.0, 1.0, 0.0 }).normalize();