diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/star_control/fmatrix.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/fmatrix.h | 15 | ||||
-rw-r--r-- | engines/titanic/star_control/viewport.cpp | 4 |
3 files changed, 17 insertions, 6 deletions
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp index 23a2ce2203..21b2e4e385 100644 --- a/engines/titanic/star_control/fmatrix.cpp +++ b/engines/titanic/star_control/fmatrix.cpp @@ -104,7 +104,7 @@ void FMatrix::set(const FVector &v) { _row2.normalize(); } -void FMatrix::fn2(const FMatrix &m) { +void FMatrix::matRProd(const FMatrix &m) { float x1 = _row1._y * m._row2._x + _row1._z * m._row3._x + _row1._x * m._row1._x; float y1 = _row1._x * m._row1._y + m._row2._y * _row1._y + m._row3._y * _row1._z; float z1 = _row1._x * m._row1._z + _row1._y * m._row2._z + _row1._z * m._row3._z; @@ -120,7 +120,7 @@ void FMatrix::fn2(const FMatrix &m) { _row3 = FVector(x3, y3, z3); } -void FMatrix::fn3(const FMatrix &m) { +void FMatrix::matLProd(const FMatrix &m) { float x1 = _row2._x * m._row1._y + m._row1._z * _row3._x + _row1._x * m._row1._x; float y1 = m._row1._x * _row1._y + _row3._y * m._row1._z + _row2._y * m._row1._y; float z1 = m._row1._x * _row1._z + m._row1._y * _row2._z + m._row1._z * _row3._z; diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h index 95bb91cf73..e783a2342c 100644 --- a/engines/titanic/star_control/fmatrix.h +++ b/engines/titanic/star_control/fmatrix.h @@ -85,8 +85,19 @@ public: */ void set(const FVector &v); - void fn2(const FMatrix &m); - void fn3(const FMatrix &m); + /** + * Changes this matrix, A, to be C, where C=Am. + * Matrix m multiplies this matrix (A) on its Right. + * Matrix m is said to premultiply A (previous this matrix). + */ + void matRProd(const FMatrix &m); + + /** + * Changes this matrix, A, to be C, where C=mA. + * Matrix m multiplies this matrix (A) on its Left. + * m is said to postmultiply A (previous this matrix). + */ + void matLProd(const FMatrix &m); /** * Returns true if the passed matrix equals this one diff --git a/engines/titanic/star_control/viewport.cpp b/engines/titanic/star_control/viewport.cpp index c3625b85c4..39d2c5f201 100644 --- a/engines/titanic/star_control/viewport.cpp +++ b/engines/titanic/star_control/viewport.cpp @@ -156,7 +156,7 @@ void CViewport::fn12() { FPose s2(s1, m3); m1.copyFrom(s2); - _orientation.fn2(m1); + _orientation.matRProd(m1); _flag = false; } @@ -181,7 +181,7 @@ void CViewport::reposition(double factor) { } void CViewport::fn15(const FMatrix &matrix) { - _orientation.fn3(matrix); + _orientation.matLProd(matrix); _flag = false; } |