From 728b713d86e69a57aa84a9aa5ce830befec67238 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 15 Aug 2010 15:14:08 +0000 Subject: use more BLI math functions. --- source/blender/blenlib/intern/math_rotation.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'source/blender/blenlib/intern/math_rotation.c') 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); -- cgit v1.2.3