From 11941286277c8bee703154df2bf3c1392f760301 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 12 Feb 2020 19:20:20 +0100 Subject: [PATCH] Math/Transform.cpp: indent fixes. --- source/Math/Transform.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/source/Math/Transform.cpp b/source/Math/Transform.cpp index 4d54068..ef3ace4 100644 --- a/source/Math/Transform.cpp +++ b/source/Math/Transform.cpp @@ -10,9 +10,9 @@ m_matrix (Matrix4f::Identity) } Transform::Transform( float a00, float a01, float a02, - float a10, float a11, float a12, - float a20, float a21, float a22) : -m_matrix (a00, a01, 0.0f, a02, + float a10, float a11, float a12, + float a20, float a21, float a22) : +m_matrix (a00, a01, 0.0f, a02, a10, a11, 0.0f, a12, 0.0f, 0.0f, 1.0f, 0.0f, a20, a21, 0.0f, a22) @@ -52,9 +52,10 @@ Vector2f Transform::getRightVector() const Transform& Transform::translate(float x, float y) { - Transform t( 1, 0, x, - 0, 1, y, - 0, 0, 1); + Transform t(1, 0, x, + 0, 1, y, + 0, 0, 1); + return multiply(t); } @@ -65,23 +66,24 @@ Transform& Transform::translate(Vector2f vec) Transform& Transform::rotate(float theta) { - float r = math::deg2rad(theta); - float c = std::cos(r); - float s = std::sin(r); + float a = math::deg2rad(theta); + float c = std::cos(a); + float s = std::sin(a); // Always rotate along z-axis in 2D. - Transform rot( c, -s, 0, - s, c, 0, - 0, 0, 1); + Transform r(c, -s, 0, + s, c, 0, + 0, 0, 1); - return multiply(rot); + return multiply(r); } Transform& Transform::scale(float x, float y) { - Transform s( x, 0, 0, - 0, y, 0, - 0, 0, 1); + Transform s(x, 0, 0, + 0, y, 0, + 0, 0, 1); + return multiply(s); }