diff options
author | crupest <crupest@outlook.com> | 2021-03-13 17:40:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-03-13 17:40:18 +0800 |
commit | 7703063a5816b089483e78ccd74bb9902ccfbea8 (patch) | |
tree | b4b0fd45eb6a89831921d6b78c322e6aa882c239 /include/cru/platform/Matrix.hpp | |
parent | 49dfb2bc9f965b398aa12e711148696d28443eaf (diff) | |
download | cru-7703063a5816b089483e78ccd74bb9902ccfbea8.tar.gz cru-7703063a5816b089483e78ccd74bb9902ccfbea8.tar.bz2 cru-7703063a5816b089483e78ccd74bb9902ccfbea8.zip |
...
Diffstat (limited to 'include/cru/platform/Matrix.hpp')
-rw-r--r-- | include/cru/platform/Matrix.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cru/platform/Matrix.hpp b/include/cru/platform/Matrix.hpp index e702df90..8ec5faaa 100644 --- a/include/cru/platform/Matrix.hpp +++ b/include/cru/platform/Matrix.hpp @@ -50,10 +50,15 @@ struct Matrix { return Matrix{1.0f, 0.0f, 0.0f, 1.0f, x, y}; } + static Matrix Translation(const Point& point) { + return Translation(point.x, point.y); + } + static Matrix Scale(float sx, float sy) { return Matrix{sx, 0.0f, 0.0f, sy, 0.0f, 0.0f}; } + // Clockwise. static Matrix Rotation(float angle) { float r = AngleToRadian(angle); float s = std::sin(r); |