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>2010-11-16 04:19:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-16 04:19:37 +0300
commit7e0f9229d6e9133338c6e5170699722989b1b8d5 (patch)
treec044d667873ccc84844bce189f00c4653d8d965f /source/blender/blenlib/intern/math_matrix.c
parent7a7b4aff40e1f25cffe92abbc73637e995cf4ef3 (diff)
fix for fix, r33086.
- incorrect range check broke ZYX euler rotations, use MIN/MAX constants so this doesn't happen again. - BGE Armature PyAPI also wasn't using correct min/max with rotation modes. - clamp on file read rather then when calling the rotation functions, so developers don't use invalid args without realizing it. - added assert() checks for debug builds so invalid axis constants don't slip through.
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 58fb3b9b76b..d2bd7a0a2b1 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-
+#include <assert.h>
#include "BLI_math.h"
/********************************* Init **************************************/
@@ -1041,6 +1041,8 @@ void rotate_m4(float mat[][4], const char axis, const float angle)
float temp[4]= {0.0f, 0.0f, 0.0f, 0.0f};
float cosine, sine;
+ assert(axis >= 'X' && axis <= 'Z');
+
cosine = (float)cos(angle);
sine = (float)sin(angle);
switch(axis){