X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmatrix.cpp;h=ddc0cdf58c8ac64c72e1d830e6226f0edc2dcfa7;hb=d8234c16eea3631c1b6e2c10f391ec86d9b97bfa;hp=ece99e344b903381a2a3dfc013ecdbff1571cffb;hpb=89d3d10b75a42f86b224feb00b20283af66c0b01;p=libs%2Fgl.git diff --git a/source/matrix.cpp b/source/matrix.cpp index ece99e34..ddc0cdf5 100644 --- a/source/matrix.cpp +++ b/source/matrix.cpp @@ -22,24 +22,25 @@ Matrix::Matrix(const LinAl::Matrix &other): Base(other) { } -void Matrix::multiply(const Matrix &other) +Matrix &Matrix::multiply(const Matrix &other) { *this = *this*other; + return *this; } -void Matrix::translate(const Vector3 &t) +Matrix &Matrix::translate(const Vector3 &t) { - multiply(translation(t)); + return multiply(translation(t)); } -void Matrix::rotate(const Angle &a, const Vector3 &x) +Matrix &Matrix::rotate(const Angle &a, const Vector3 &x) { - multiply(rotation(a, x)); + return multiply(rotation(a, x)); } -void Matrix::scale(const Vector3 &s) +Matrix &Matrix::scale(const Vector3 &s) { - multiply(scaling(s)); + return multiply(scaling(s)); } Matrix Matrix::operator*(const Matrix &other) const @@ -49,8 +50,7 @@ Matrix Matrix::operator*(const Matrix &other) const Matrix &Matrix::operator*=(const Matrix &other) { - multiply(other); - return *this; + return multiply(other); } Vector4 Matrix::operator*(const Vector4 &vec) const