From eefca1ada97a6bc5db38936d23da323a78b2044d Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 26 Jul 2016 17:19:49 +0200 Subject: Prettier str() for some math types --- core/math/matrix3.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'core/math/matrix3.cpp') diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index 71e6b62212..7b811c245c 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -233,19 +233,26 @@ bool Matrix3::operator!=(const Matrix3& p_matrix) const { Matrix3::operator String() const { - String mtx; + String mtx("("); for (int i=0;i<3;i++) { + if (i!=0) + mtx+=", "; + + mtx+="("; + for (int j=0;j<3;j++) { - if (i!=0 || j!=0) + if (j!=0) mtx+=", "; mtx+=rtos( elements[i][j] ); } + + mtx+=")"; } - return mtx; + return mtx+")"; } Matrix3::operator Quat() const { -- cgit v1.2.3