diff options
-rw-r--r-- | source/blender/blenlib/BLI_math_rotation.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 5 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 |
3 files changed, 6 insertions, 4 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); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index a4605eddd79..5694c760371 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -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); |