]> git.tdb.fi Git - libs/gl.git/blobdiff - source/matrix.cpp
Better naming algorithm for objects in scene export
[libs/gl.git] / source / matrix.cpp
index ece99e344b903381a2a3dfc013ecdbff1571cffb..a4c36a022a9ecb338406a496760f12c1d0655540 100644 (file)
@@ -22,45 +22,19 @@ Matrix::Matrix(const LinAl::Matrix<float, 4, 4> &other):
        Base(other)
 { }
 
-void Matrix::multiply(const Matrix &other)
+Matrix &Matrix::translate(const Vector3 &t)
 {
-       *this = *this*other;
+       return multiply(translation(t));
 }
 
-void Matrix::translate(const Vector3 &t)
+Matrix &Matrix::rotate(const Angle &a, const Vector3 &x)
 {
-       multiply(translation(t));
+       return multiply(rotation(a, x));
 }
 
-void Matrix::rotate(const Angle &a, const Vector3 &x)
+Matrix &Matrix::scale(const Vector3 &s)
 {
-       multiply(rotation(a, x));
-}
-
-void Matrix::scale(const Vector3 &s)
-{
-       multiply(scaling(s));
-}
-
-Matrix Matrix::operator*(const Matrix &other) const
-{
-       return static_cast<const Base &>(*this)*static_cast<const Base &>(other);
-}
-
-Matrix &Matrix::operator*=(const Matrix &other)
-{
-       multiply(other);
-       return *this;
-}
-
-Vector4 Matrix::operator*(const Vector4 &vec) const
-{
-       return static_cast<const Base &>(*this)*LinAl::Vector<float, 4>(vec);
-}
-
-Vector3 Matrix::operator*(const Vector3 &vec) const
-{
-       return ((*this)*compose(vec, 1.0f)).slice<3>(0);
+       return multiply(scaling(s));
 }
 
 float Matrix::operator[](unsigned i) const