[Bf-blender-cvs] [ba1df82] master: Cleanup: simplify ED_view3d_from_m4

Campbell Barton noreply at git.blender.org
Fri Oct 23 22:12:49 CEST 2015


Commit: ba1df8265d7d4105c5ecadaecb8ca28fffb34242
Author: Campbell Barton
Date:   Sat Oct 24 04:33:54 2015 +1100
Branches: master
https://developer.blender.org/rBba1df8265d7d4105c5ecadaecb8ca28fffb34242

Cleanup: simplify ED_view3d_from_m4

===================================================================

M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 4665360..53cacc0 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);
 	}
 }




More information about the Bf-blender-cvs mailing list