[Bf-blender-cvs] [8c7e1b6] master: Fix: correctly describing Quaternion.normalize()

Sybren A. Stüvel noreply at git.blender.org
Sun Feb 1 10:36:37 CET 2015


Commit: 8c7e1b648b782542c4906ccb849c39b167265558
Author: Sybren A. Stüvel
Date:   Sat Jan 31 14:34:27 2015 +0100
Branches: master
https://developer.blender.org/rB8c7e1b648b782542c4906ccb849c39b167265558

Fix: correctly describing Quaternion.normalize()

The original comment seems to suggest that only the rotation vector
is normalized, leaving the rotation angle alone. This is not what happens,
though. The new comment matches the actual implementation, and the
implementation matches what is commonly understood as quaternion
normalization.

===================================================================

M	source/blender/python/mathutils/mathutils_Quaternion.c

===================================================================

diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index d422634..98ee2fb 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -334,7 +334,8 @@ static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value)
 }
 
 /* ----------------------------Quaternion.normalize()---------------- */
-/* normalize the axis of rotation of [theta, vector] */
+/* Normalize the quaternion. This may change the angle as well as the
+ * rotation axis, as all of (w, x, y, z) are scaled. */
 PyDoc_STRVAR(Quaternion_normalize_doc,
 ".. function:: normalize()\n"
 "\n"




More information about the Bf-blender-cvs mailing list