From 7703063a5816b089483e78ccd74bb9902ccfbea8 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 13 Mar 2021 17:40:18 +0800 Subject: ... --- include/cru/platform/Matrix.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/cru/platform/Matrix.hpp') 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); -- cgit v1.2.3