diff options
author | aap <aap@papnet.eu> | 2020-06-04 17:38:41 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-06-04 17:38:41 +0200 |
commit | 3e36428568d1b26306a9639ed04aa49b578ac74e (patch) | |
tree | 8faf914355af8f1507e5a90426a16338fa55b5e4 /src/math/math.cpp | |
parent | Merge branch 'master' into miami (diff) | |
download | re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.gz re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.bz2 re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.lz re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.xz re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.zst re3-3e36428568d1b26306a9639ed04aa49b578ac74e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/math/math.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 @@ -171,6 +171,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; |