diff options
| author | Mel <einebeere@gmail.com> | 2023-07-11 04:52:24 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-11 04:52:24 +0200 |
| commit | 0ce26f2a49fd6d64a690b84b1932126edfbfbee6 (patch) | |
| tree | f0846f7f0e394d3c213986a2f85e0240dc8e5402 /src/Math/Matrix.hpp | |
| parent | e6812d2df6bd8a0a71375096abe46f8039d8c570 (diff) | |
| download | meowcraft-0ce26f2a49fd6d64a690b84b1932126edfbfbee6.tar.zst meowcraft-0ce26f2a49fd6d64a690b84b1932126edfbfbee6.zip | |
Add simple scrolling non-tiling 2D clouds
Diffstat (limited to 'src/Math/Matrix.hpp')
| -rw-r--r-- | src/Math/Matrix.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
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); }); |
