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:
authorCampbell Barton <ideasman42@gmail.com>2011-04-02 07:05:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-02 07:05:49 +0400
commitf1b42a129f0f9299a9e67eb0495131a37464c9cc (patch)
tree99bda9a0c293524a04f0ba4cfd91cc87c378810f /source/blender/python/generic/mathutils_Matrix.c
parent69bd72c3b6aa1fdaab0c1232a6ba1e3e4c9029fa (diff)
add angle wrapping functions: angle_wrap_rad(), angle_wrap_deg().
use with mathutils.
Diffstat (limited to 'source/blender/python/generic/mathutils_Matrix.c')
-rw-r--r--source/blender/python/generic/mathutils_Matrix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/python/generic/mathutils_Matrix.c b/source/blender/python/generic/mathutils_Matrix.c
index 936c761bf90..41d9626db16 100644
--- a/source/blender/python/generic/mathutils_Matrix.c
+++ b/source/blender/python/generic/mathutils_Matrix.c
@@ -226,8 +226,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
}
}
- /* clamp angle between -360 and 360 in radians */
- angle= fmod(angle + M_PI*2, M_PI*4) - M_PI*2;
+ angle= angle_wrap_rad(angle);
if(matSize != 2 && matSize != 3 && matSize != 4) {
PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix");