From 95df65f1b55d311be4171f71bb106f9c7d193a79 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Feb 2011 00:40:55 +0000 Subject: - some parts of the code to remove rotation were not removing axis/angle rotation (only functional change of this commit). - use BLI_math functions for removing rotations from objects and pose channels. - add unit_axis_angle() to avoid setting the Y axis inline anywhere rotation needs removing. --- source/blender/blenlib/intern/math_rotation.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (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 28a37d9675a..2038121e3f2 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -34,7 +34,17 @@ /* used to test is a quat is not normalized */ #define QUAT_EPSILON 0.0001 -void unit_qt(float *q) +/* convenience, avoids setting Y axis everywhere */ +void unit_axis_angle(float axis[3], float *angle) +{ + axis[0]= 0.0f; + axis[1]= 1.0f; + axis[2]= 0.0f; + *angle= 0.0f; +} + + +void unit_qt(float q[4]) { q[0]= 1.0f; q[1]= q[2]= q[3]= 0.0f; -- cgit v1.2.3