diff options
Diffstat (limited to '')
-rw-r--r-- | src/math/Matrix.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h index c849a5c4..2d721e93 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -82,7 +82,8 @@ public: return *this; } - CVector &GetPosition(void){ return *(CVector*)&m_matrix.pos; } + const CVector &GetPosition(void) const { return *(CVector*)&m_matrix.pos; } + CVector& GetPosition(void) { return *(CVector*)&m_matrix.pos; } CVector &GetRight(void) { return *(CVector*)&m_matrix.right; } CVector &GetForward(void) { return *(CVector*)&m_matrix.up; } CVector &GetUp(void) { return *(CVector*)&m_matrix.at; } @@ -133,13 +134,18 @@ public: { float *pFloatMatrix = (float*)&m_matrix; for (int i = 0; i < 3; i++) -#ifdef FIX_BUGS // BUGFIX from VC for (int j = 0; j < 3; j++) -#else - for (int j = 0; j < 4; j++) -#endif pFloatMatrix[i * 4 + j] *= scale; } + void Scale(float sx, float sy, float sz) + { + float *pFloatMatrix = (float*)&m_matrix; + for (int i = 0; i < 3; i++){ + pFloatMatrix[i * 4 + 0] *= sx; + pFloatMatrix[i * 4 + 1] *= sy; + pFloatMatrix[i * 4 + 2] *= sz; + } + } void SetRotateXOnly(float angle){ |