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:
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r--source/blender/blenlib/intern/math_rotation.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 4d015e527a8..f72269f6d7b 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -135,10 +135,7 @@ void mul_fac_qt_fl(float *q, const float fac)
float si= (float)sin(angle);
q[0]= co;
normalize_v3(q+1);
- q[1]*= si;
- q[2]*= si;
- q[3]*= si;
-
+ mul_v3_fl(q+1, si);
}
void quat_to_mat3(float m[][3], float *q)
@@ -595,9 +592,8 @@ void axis_angle_to_quat(float q[4], float axis[3], float angle)
{
float nor[3];
float si;
-
- copy_v3_v3(nor, axis);
- normalize_v3(nor);
+
+ normalize_v3_v3(nor, axis);
angle /= 2;
si = (float)sin(angle);
@@ -654,8 +650,7 @@ void axis_angle_to_mat3(float mat[3][3],float axis[3], float angle)
float nor[3], nsi[3], co, si, ico;
/* normalise the axis first (to remove unwanted scaling) */
- copy_v3_v3(nor, axis);
- normalize_v3(nor);
+ normalize_v3_v3(nor, axis);
/* now convert this to a 3x3 matrix */
co= (float)cos(angle);