From fdbfa8e36f85eee051fc562f1a8588970257a20f Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 6 Oct 2022 02:48:43 +0200 Subject: Rotating camera with mouse --- src/Math/Matrix.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Math/Matrix.hpp') diff --git a/src/Math/Matrix.hpp b/src/Math/Matrix.hpp index d77760a..545b6a5 100644 --- a/src/Math/Matrix.hpp +++ b/src/Math/Matrix.hpp @@ -4,6 +4,7 @@ #include #include #include "Rotation.hpp" +#include "Trig.hpp" template struct Matrix { @@ -39,8 +40,10 @@ public: } static Matrix<4, 4> rotation(Rotation angles) { - auto c = angles.vector.map([](auto a) { return cos(a); }); - auto s = angles.vector.map([](auto a) { return sin(a); }); + auto radians = angles.vector.map([](auto a) { return Math::radians(a); }); + + auto c = radians.map([](auto a) { return cos(a); }); + auto s = radians.map([](auto a) { return sin(a); }); Matrix<4, 4> rotation_x{ 1.0f, 0.0f, 0.0f, 0.0f, -- cgit 1.4.1