diff --git a/include/quaternion.h b/include/quaternion.h index 9fb5c5a8..5fdff798 100644 --- a/include/quaternion.h +++ b/include/quaternion.h @@ -140,7 +140,7 @@ class quaternion quaternion& makeInverse(); //! Set this quaternion to the linear interpolation between two quaternions - /** NOTE: lerp result is *not* a normalized quaternion. In most cases + /** NOTE: lerp result is *not* a normalized quaternion. In most cases you will want to use lerpN instead as most other quaternion functions expect to work with a normalized quaternion. \param q1 First quaternion to be interpolated. @@ -152,7 +152,7 @@ class quaternion quaternion& lerp(quaternion q1, quaternion q2, f32 time); //! Set this quaternion to the linear interpolation between two quaternions and normalize the result - /** + /** \param q1 First quaternion to be interpolated. \param q2 Second quaternion to be interpolated. \param time Progress of interpolation. For time=0 the result is @@ -585,7 +585,7 @@ inline quaternion& quaternion::normalize() { // removed conditional branch since it may slow down and anyway the condition was // false even after normalization in some cases. - return (*this *= reciprocal_squareroot ( X*X + Y*Y + Z*Z + W*W )); + return (*this *= (f32)reciprocal_squareroot ( (f64)(X*X + Y*Y + Z*Z + W*W) )); } // Set this quaternion to the result of the linear interpolation between two quaternions diff --git a/tests/testQuaternion.cpp b/tests/testQuaternion.cpp index e8f9189c..b54f0c88 100644 --- a/tests/testQuaternion.cpp +++ b/tests/testQuaternion.cpp @@ -18,7 +18,7 @@ inline bool compareQ(const core::vector3df& v, const core::vector3df& turn=core: logTestString("Inequality before quat.toEuler(): %f,%f,%f\n", v.X,v.Y,v.Z); return false; } - + q.toEuler(v2); v2*=core::RADTODEG; v2=v2.rotationToDirection(turn); @@ -110,7 +110,7 @@ bool testQuatEulerMatrix() core::vector3df v6 = mat.getRotationDegrees()*core::DEGTORAD; // make sure comparison matrix is correct result &= v4.equals(v6); - + core::matrix4 mat2 = q1.getMatrix(); result &= mat.equals(mat2, 0.0005f); diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 5016da9e..1034815d 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ -Tests finished. 72 tests of 72 passed. -Compiled as DEBUG -Test suite pass at GMT Fri Jan 03 14:40:24 2020 - +Tests finished. 72 tests of 72 passed. +Compiled as DEBUG +Test suite pass at GMT Fri Jan 3 17:05:41 2020 +