diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-30 23:29:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-30 23:29:11 +0400 |
commit | 90e9970094bc6907aec41b581e5b9144551734ae (patch) | |
tree | 6f7136a5b5796c12761cef05597d9dc8b6684232 /source/blender/blenkernel/intern/constraint.c | |
parent | 44e60266269236234146066ab80aff4fa83722d8 (diff) |
change mat4_to_eulO, mat3_to_eulO to calculate 2 rotations and return the smallest one.
mat4_to_eul & mat3_to_eul are already working this way.
Without this we get problems with constraints, eg:
rotation on the Y axis over 90d can be represented by setting the X and Z to -PI, Y would decrease to 0 (infact 180d).
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 9629be330d9..1892f6f0a27 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1381,16 +1381,14 @@ static bConstraintTypeInfo CTI_LOCLIMIT = { static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) { bRotLimitConstraint *data = con->data; - float eul_zero[3]= {0.0f, 0.0f, 0.0f}; float loc[3]; float eul[3]; float size[3]; copy_v3_v3(loc, cob->matrix[3]); mat4_to_size(size, cob->matrix); - - /* use compat function because it uses the rotation without axis flipping [#24002] */ - mat4_to_compatible_eulO(eul, eul_zero, cob->rotOrder, cob->matrix); + + mat4_to_eulO(eul, cob->rotOrder, cob->matrix); /* constraint data uses radians internally */ |