summaryrefslogtreecommitdiff
path: root/core/math/math_2d.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2016-09-20 09:28:26 +0200
committerGitHub <noreply@github.com>2016-09-20 09:28:26 +0200
commit1c50dfdf6c352574391c953d88732382adc15e83 (patch)
treef719805d251e51d8dd87e12d35318e512601a177 /core/math/math_2d.cpp
parent82f5130cad04c2a959a87ea0bca63e82454fa3cf (diff)
parentaa5ade834c8646b81e2320089314393c00ee8020 (diff)
Merge pull request #6557 from anneomcl/master
Fix for #6158
Diffstat (limited to 'core/math/math_2d.cpp')
-rw-r--r--core/math/math_2d.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp
index 0e2060008c..2cc11aa738 100644
--- a/core/math/math_2d.cpp
+++ b/core/math/math_2d.cpp
@@ -475,18 +475,18 @@ Matrix32::Matrix32(real_t p_rot, const Vector2& p_pos) {
elements[2]=p_pos;
}
-Vector2 Matrix32::get_scale() const {
+Size2 Matrix32::get_scale() const {
- return Vector2( elements[0].length(), elements[1].length() );
+ return Size2( elements[0].length(), elements[1].length() );
}
-void Matrix32::scale(const Vector2& p_scale) {
+void Matrix32::scale(const Size2& p_scale) {
elements[0]*=p_scale;
elements[1]*=p_scale;
elements[2]*=p_scale;
}
-void Matrix32::scale_basis(const Vector2& p_scale) {
+void Matrix32::scale_basis(const Size2& p_scale) {
elements[0]*=p_scale;
elements[1]*=p_scale;
@@ -501,7 +501,6 @@ void Matrix32::translate( const Vector2& p_translation ) {
elements[2]+=basis_xform(p_translation);
}
-
void Matrix32::orthonormalize() {
// Gram-Schmidt Process
@@ -550,11 +549,6 @@ void Matrix32::operator*=(const Matrix32& p_transform) {
elements[2] = xform(p_transform.elements[2]);
float x0,x1,y0,y1;
-/*
- x0 = p_transform.tdotx(elements[0]);
- x1 = p_transform.tdoty(elements[0]);
- y0 = p_transform.tdotx(elements[1]);
- y1 = p_transform.tdoty(elements[1]);*/
x0 = tdotx(p_transform.elements[0]);
x1 = tdoty(p_transform.elements[0]);
@@ -576,7 +570,7 @@ Matrix32 Matrix32::operator*(const Matrix32& p_transform) const {
}
-Matrix32 Matrix32::scaled(const Vector2& p_scale) const {
+Matrix32 Matrix32::scaled(const Size2& p_scale) const {
Matrix32 copy=*this;
copy.scale(p_scale);
@@ -584,7 +578,7 @@ Matrix32 Matrix32::scaled(const Vector2& p_scale) const {
}
-Matrix32 Matrix32::basis_scaled(const Vector2& p_scale) const {
+Matrix32 Matrix32::basis_scaled(const Size2& p_scale) const {
Matrix32 copy=*this;
copy.scale_basis(p_scale);
@@ -629,8 +623,8 @@ Matrix32 Matrix32::interpolate_with(const Matrix32& p_transform, float p_c) cons
real_t r1 = get_rotation();
real_t r2 = p_transform.get_rotation();
- Vector2 s1 = get_scale();
- Vector2 s2 = p_transform.get_scale();
+ Size2 s1 = get_scale();
+ Size2 s2 = p_transform.get_scale();
//slerp rotation
Vector2 v1(Math::cos(r1), Math::sin(r1));