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.
This commit is contained in:
2018-12-23 15:25:40 +03:00
parent 1574b691f3
commit 02f083cdce
3 changed files with 6 additions and 4 deletions

View File

@@ -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]);

View File

@@ -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);

View File

@@ -276,7 +276,7 @@ static void sculpt_rake_rotate(
sub_v3_v3v3(vec_rot, v_co, sculpt_co);
copy_qt_qt(q_interp, ss->cache->rake_rotation_symmetry);
mul_fac_qt_fl(q_interp, factor);
pow_qt_fl_normalized(q_interp, factor);
mul_qt_v3(q_interp, vec_rot);
add_v3_v3(vec_rot, sculpt_co);