From 0ce26f2a49fd6d64a690b84b1932126edfbfbee6 Mon Sep 17 00:00:00 2001 From: Mel Date: Tue, 11 Jul 2023 04:52:24 +0200 Subject: Add simple scrolling non-tiling 2D clouds --- src/Math/Matrix.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Math/Matrix.hpp') diff --git a/src/Math/Matrix.hpp b/src/Math/Matrix.hpp index d51d171..41d3661 100644 --- a/src/Math/Matrix.hpp +++ b/src/Math/Matrix.hpp @@ -37,6 +37,15 @@ struct Matrix { }; } + static Matrix<4, 4, T> scale(Vector<3> factor) { + return { + factor.x(), 0.0, 0.0, 0.0, + 0.0, factor.y(), 0.0, 0.0, + 0.0, 0.0, factor.z(), 0.0, + 0.0, 0.0, 0.0, 1.0 + }; + } + static Matrix<4, 4, T> rotation(Rotation angles) { auto radians = angles.vector.map([](auto a) { return Math::radians(a); }); -- cgit 1.4.1