From 3e36428568d1b26306a9639ed04aa49b578ac74e Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 4 Jun 2020 17:38:41 +0200 Subject: more CBike and fixes --- src/math/math.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/math/math.cpp') diff --git a/src/math/math.cpp b/src/math/math.cpp index e8b459ae..0661dcac 100644 --- a/src/math/math.cpp +++ b/src/math/math.cpp @@ -170,6 +170,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) { -- cgit v1.2.3