diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-10-23 20:33:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-10-23 20:33:54 +0300 |
commit | ba1df8265d7d4105c5ecadaecb8ca28fffb34242 (patch) | |
tree | a503c3c161f844c4f6b18ea5b4f10a1328ab49f1 /source/blender/editors/space_view3d/view3d_edit.c | |
parent | 9d8a01dba195880c4b3bc8a5fb2914881b3abeca (diff) |
Cleanup: simplify ED_view3d_from_m4
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4665360d0b8..53cacc0d4b3 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -5031,16 +5031,12 @@ void ED_view3d_from_m4(float mat[4][4], float ofs[3], float quat[4], float *dist /* Quat */ if (quat) { - float imat[3][3]; - invert_m3_m3(imat, nmat); - mat3_to_quat(quat, imat); + mat3_to_quat(quat, nmat); + invert_qt_normalized(quat); } if (ofs && dist) { - float vec[3] = {0.0f, 0.0f, -(*dist)}; - - mul_m3_v3(nmat, vec); - sub_v3_v3(ofs, vec); + madd_v3_v3fl(ofs, nmat[2], *dist); } } |