Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-07-25 20:37:24 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-07-25 20:37:24 +0400
commit8197ae005407f86b1eeb1d805c9402eb17f8cefa (patch)
treea7da7a5099e7ed71f07887068d8491412e4dd7a4 /source/blender/blenlib
parent7fba5779ede5d96fa6a9db0d7d529022be692d09 (diff)
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.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/math_rotation.c9
1 files changed, 5 insertions, 4 deletions
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);