diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-09-24 21:49:33 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-09-24 21:49:33 +0400 |
commit | b57e09544a430a585e8665c7064252be1b59ec57 (patch) | |
tree | 352b65f75f37c064091887901ba7c985c1a946e3 /source/blender/blenlib | |
parent | 3567eebcc20acbefd393fb8263cd2b750bcf8a93 (diff) |
Fix for [#21875] Copy rotation only on y axies
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_rotation.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h index ac8ed041ebc..1b3f4dced02 100644 --- a/source/blender/blenlib/BLI_math_rotation.h +++ b/source/blender/blenlib/BLI_math_rotation.h @@ -147,6 +147,7 @@ void mat4_to_eulO(float eul[3], short order, float mat[4][4]); void axis_angle_to_eulO(float eul[3], short order, float axis[3], float angle); void mat3_to_compatible_eulO(float eul[3], float old[3], short order, float mat[3][3]); +void mat4_to_compatible_eulO(float eul[3], float old[3], short order, float mat[4][4]); void rotate_eulO(float eul[3], short order, char axis, float angle); diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index f72269f6d7b..b8cef511293 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1249,6 +1249,15 @@ void mat3_to_compatible_eulO(float eul[3], float oldrot[3], short order,float ma copy_v3_v3(eul, eul1); } +void mat4_to_compatible_eulO(float eul[3], float oldrot[3], short order,float M[4][4]) +{ + float m[3][3]; + + /* for now, we'll just do this the slow way (i.e. copying matrices) */ + copy_m3_m4(m, M); + normalize_m3(m); + mat3_to_compatible_eulO(eul, oldrot, order, m); +} /* rotate the given euler by the given angle on the specified axis */ // NOTE: is this safe to do with different axis orders? void rotate_eulO(float beul[3], short order, char axis, float ang) |