From bae3a3e72f6b22b72155d377d38725cdbdff688c Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 31 May 2020 17:45:26 +0200 Subject: fixed to CAutomobile and friends --- src/math/math.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/math/math.cpp') diff --git a/src/math/math.cpp b/src/math/math.cpp index eeb9d3fa..29f18d03 100644 --- a/src/math/math.cpp +++ b/src/math/math.cpp @@ -59,6 +59,12 @@ CMatrix::RotateX(float x) Rotate(x, 0.0f, 0.0f); } +void +CMatrix::RotateY(float y) +{ + Rotate(0.0f, y, 0.0f); +} + void CMatrix::RotateZ(float z) { -- cgit v1.2.3 From 95e96c86a1924a98c648fbcd251c9dca5d66c4bb Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 4 Jun 2020 17:39:18 +0200 Subject: minor stuff --- 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 29f18d03..0cfc2ce9 100644 --- a/src/math/math.cpp +++ b/src/math/math.cpp @@ -183,6 +183,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