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:
@@ -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_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_v3(const float q[4], float r[3]);
|
||||||
void mul_qt_fl(float q[4], const float f);
|
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]);
|
void sub_qt_qtqt(float q[4], const float a[4], const float b[4]);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
mul_qt_qtqt(q, q1, nq2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* angular mult factor */
|
/* raise a unit quaternion to the specified power */
|
||||||
void mul_fac_qt_fl(float q[4], const float fac)
|
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 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 co = cosf(angle);
|
||||||
const float si = sinf(angle);
|
const float si = sinf(angle);
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ static void sculpt_rake_rotate(
|
|||||||
sub_v3_v3v3(vec_rot, v_co, sculpt_co);
|
sub_v3_v3v3(vec_rot, v_co, sculpt_co);
|
||||||
|
|
||||||
copy_qt_qt(q_interp, ss->cache->rake_rotation_symmetry);
|
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);
|
mul_qt_v3(q_interp, vec_rot);
|
||||||
|
|
||||||
add_v3_v3(vec_rot, sculpt_co);
|
add_v3_v3(vec_rot, sculpt_co);
|
||||||
|
|||||||
Reference in New Issue
Block a user