summaryrefslogtreecommitdiffstats
path: root/src/math/Matrix.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-06 13:26:50 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-06 13:26:50 +0200
commite10f5ee6a3f94a5ff2559f868c884e47d4628271 (patch)
tree3b2a2ceafc26e4215b49bf56e75cf80568251f26 /src/math/Matrix.h
parentcar AI (diff)
parentFixed player blip heading when looking left/right/behind (diff)
downloadre3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.gz
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.bz2
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.lz
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.xz
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.zst
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.zip
Diffstat (limited to '')
-rw-r--r--src/math/Matrix.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h
index 7d8c02ab..5145f0ac 100644
--- a/src/math/Matrix.h
+++ b/src/math/Matrix.h
@@ -204,6 +204,22 @@ public:
m_matrix.at.y = 0.0f;
m_matrix.at.z = 1.0f;
}
+ void SetRotateZOnlyScaled(float angle, float scale) {
+ float c = Cos(angle);
+ float s = Sin(angle);
+
+ m_matrix.right.x = c * scale;
+ m_matrix.right.y = s * scale;
+ m_matrix.right.z = 0.0f;
+
+ m_matrix.up.x = -s * scale;
+ m_matrix.up.y = c * scale;
+ m_matrix.up.z = 0.0f;
+
+ m_matrix.at.x = 0.0f;
+ m_matrix.at.y = 0.0f;
+ m_matrix.at.z = scale;
+ }
void SetRotateZ(float angle){
SetRotateZOnly(angle);
m_matrix.pos.x = 0.0f;
@@ -213,6 +229,7 @@ public:
void SetRotate(float xAngle, float yAngle, float zAngle);
void Rotate(float x, float y, float z);
void RotateX(float x);
+ void RotateZ(float z);
void Reorthogonalise(void);
void CopyOnlyMatrix(CMatrix *other){