summaryrefslogtreecommitdiffstats
path: root/src/math/math.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/math/math.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/math/math.cpp b/src/math/math.cpp
index 29f18d03..0cfc2ce9 100644
--- a/src/math/math.cpp
+++ b/src/math/math.cpp
@@ -184,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;