1
0
Fork 0

Math/Transform.cpp: indent fixes.

This commit is contained in:
Henrik Hautakoski 2020-02-12 19:20:20 +01:00
parent 72e1bfdade
commit 1194128627
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745

View file

@ -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);
}