Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-12-23 15:25:40 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-12-23 15:28:32 +0300
commit02f083cdcecf74a169114850337a99c802c53e34 (patch)
tree5bfd5c4ca3fb61a48d8205875e2451b51a84a2d4 /source/blender/blenlib
parent1574b691f3cc5928c408f24901c8b5a3ebfe7103 (diff)
BLI_math_rotation: properly name the quaternion power function.
"angular mult factor" is a completely unintelligible description for a function that raises a unit quaternion to the scalar power.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_rotation.h3
-rw-r--r--source/blender/blenlib/intern/math_rotation.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index 5b1568ab902..2bc82bac8d8 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -53,7 +53,8 @@ void copy_qt_qt(float q[4], const float a[4]);
void mul_qt_qtqt(float q[4], const float a[4], const float b[4]);
void mul_qt_v3(const float q[4], float r[3]);
void mul_qt_fl(float q[4], const float f);
-void mul_fac_qt_fl(float q[4], const float f);
+
+void pow_qt_fl_normalized(float q[4], const float f);
void sub_qt_qtqt(float q[4], const float a[4], const float b[4]);
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 3e74173ef78..8e5b3f0000e 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -193,9 +193,10 @@ void sub_qt_qtqt(float q[4], const float q1[4], const float q2[4])
mul_qt_qtqt(q, q1, nq2);
}
-/* angular mult factor */
-void mul_fac_qt_fl(float q[4], const float fac)
+/* raise a unit quaternion to the specified power */
+void pow_qt_fl_normalized(float q[4], const float fac)
{
+ BLI_ASSERT_UNIT_QUAT(q);
const float angle = fac * saacos(q[0]); /* quat[0] = cos(0.5 * angle), but now the 0.5 and 2.0 rule out */
const float co = cosf(angle);
const float si = sinf(angle);