summaryrefslogtreecommitdiffstats
path: root/src/math/math.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-06-29 08:37:53 +0200
committerGitHub <noreply@github.com>2020-06-29 08:37:53 +0200
commit860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb (patch)
tree6a8f83b0d46e97b198f095b7624deecca75051e7 /src/math/math.cpp
parentrestore Text.cpp (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.gz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.bz2
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.lz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.xz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.zst
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.zip
Diffstat (limited to '')
-rw-r--r--src/math/math.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/math/math.cpp b/src/math/math.cpp
index eeb9d3fa..0cfc2ce9 100644
--- a/src/math/math.cpp
+++ b/src/math/math.cpp
@@ -60,6 +60,12 @@ CMatrix::RotateX(float x)
}
void
+CMatrix::RotateY(float y)
+{
+ Rotate(0.0f, y, 0.0f);
+}
+
+void
CMatrix::RotateZ(float z)
{
Rotate(0.0f, 0.0f, z);
@@ -178,6 +184,17 @@ CQuaternion::Slerp(const CQuaternion &q1, const CQuaternion &q2, float theta, fl
}
void
+CQuaternion::Set(RwV3d *axis, float angle)
+{
+ float halfCos = Cos(angle*0.5f);
+ float halfSin = Sin(angle*0.5f);
+ x = axis->x*halfSin;
+ y = axis->y*halfSin;
+ z = axis->z*halfSin;
+ w = halfCos;
+}
+
+void
CQuaternion::Get(RwMatrix *matrix)
{
float x2 = x+x;