--- source/blender/blenlib/intern/math_rotation.c +++ source/blender/blenlib/intern/math_rotation.c @@ -78,7 +78,13 @@ void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4]) q[2] = t2; } -/* Assumes a unit quaternion */ +/* Shortcut for q v q* when v is actually a quaternion. This removes the need + * for converting a vector to a quaternion, calculating q's conjugate and + * converting back to a vector. It also happens to be faster (17+,24* vs + * 24+,32*). If q is not a unit quaternion, then v will be both rotated by + * the same amount as if q was a unit quaternion, and scaled by the square of + * the length of q. + */ void mul_qt_v3(const float q[4], float v[3]) { float t0, t1, t2;