diff --git a/tempest/matrix/C44Matrix.cpp b/tempest/matrix/C44Matrix.cpp index ce637a4..c8272be 100644 --- a/tempest/matrix/C44Matrix.cpp +++ b/tempest/matrix/C44Matrix.cpp @@ -93,6 +93,12 @@ void C44Matrix::Scale(float scale) { this->c2 *= scale; } +void C44Matrix::Translate(const C3Vector& move) { + this->d0 = this->a0 * move.x + this->b0 * move.y + this->c0 * move.z + this->d0; + this->d1 = this->a1 * move.x + this->b1 * move.y + this->c1 * move.z + this->d1; + this->d2 = this->a2 * move.x + this->b2 * move.y + this->c2 * move.z + this->d2; +} + C44Matrix operator*(const C44Matrix& l, float a) { float a0 = l.a0 * a; float a1 = l.a1 * a; diff --git a/tempest/matrix/C44Matrix.hpp b/tempest/matrix/C44Matrix.hpp index fb92df1..20364ae 100644 --- a/tempest/matrix/C44Matrix.hpp +++ b/tempest/matrix/C44Matrix.hpp @@ -51,6 +51,7 @@ class C44Matrix { void RotateAroundZ(float angle); void Scale(const C3Vector& scale); void Scale(float scale); + void Translate(const C3Vector& move); }; C44Matrix operator*(const C44Matrix& l, float a);