From 8197ae005407f86b1eeb1d805c9402eb17f8cefa Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 25 Jul 2012 16:37:24 +0000 Subject: Fix regression introduced in svn rev49122 Would rather have mathematical functions consistent from using the same vector for input and output values point of view then introducing questionable optimizations. --- source/blender/blenlib/intern/math_rotation.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 4d4c1b718cd..a2da9f5f791 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -662,15 +662,16 @@ void print_qt(const char *str, const float q[4]) /* Axis angle to Quaternions */ void axis_angle_to_quat(float q[4], const float axis[3], const float angle) { + float nor[3]; - if (LIKELY(normalize_v3_v3(q + 1, axis) != 0.0f)) { + if (LIKELY(normalize_v3_v3(nor, axis) != 0.0f)) { const float phi = angle / 2.0f; float si; si = sinf(phi); q[0] = cosf(phi); - q[1] *= si; - q[2] *= si; - q[3] *= si; + q[1] = nor[0] * si; + q[2] = nor[1] * si; + q[3] = nor[2] * si; } else { unit_qt(q); -- cgit v1.2.3