[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57659] trunk/blender/source/blender: remove vec_rot_to_mat3(), replace with axis_angle_normalized_to_mat3()

Campbell Barton ideasman42 at gmail.com
Sun Jun 23 01:58:52 CEST 2013


Revision: 57659
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57659
Author:   campbellbarton
Date:     2013-06-22 23:58:52 +0000 (Sat, 22 Jun 2013)
Log Message:
-----------
remove vec_rot_to_mat3(), replace with axis_angle_normalized_to_mat3()

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/armature.c
    trunk/blender/source/blender/blenlib/BLI_math_rotation.h
    trunk/blender/source/blender/blenlib/intern/math_rotation.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/editors/transform/transform.c

Modified: trunk/blender/source/blender/blenkernel/intern/armature.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/armature.c	2013-06-22 23:37:45 UTC (rev 57658)
+++ trunk/blender/source/blender/blenkernel/intern/armature.c	2013-06-22 23:58:52 UTC (rev 57659)
@@ -1474,7 +1474,7 @@
 		theta = angle_normalized_v3v3(target, nor);
 
 		/* Make Bone matrix*/
-		vec_rot_to_mat3(bMatrix, axis, theta);
+		axis_angle_normalized_to_mat3(bMatrix, axis, theta);
 	}
 	else {
 		/* if nor is a multiple of target ... */
@@ -1490,7 +1490,7 @@
 	}
 
 	/* Make Roll matrix */
-	vec_rot_to_mat3(rMatrix, nor, roll);
+	axis_angle_normalized_to_mat3(rMatrix, nor, roll);
 
 	/* Combine and output result */
 	mul_m3_m3m3(mat, rMatrix, bMatrix);

Modified: trunk/blender/source/blender/blenlib/BLI_math_rotation.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_rotation.h	2013-06-22 23:37:45 UTC (rev 57658)
+++ trunk/blender/source/blender/blenlib/BLI_math_rotation.h	2013-06-22 23:58:52 UTC (rev 57659)
@@ -106,13 +106,6 @@
 
 void single_axis_angle_to_mat3(float R[3][3], const char axis, const float angle);
 
-/****************************** Vector/Rotation ******************************/
-/* old axis angle code                                                       */
-/* TODO: the following calls should probably be deprecated sometime         */
-
-/* conversion */
-void vec_rot_to_mat3(float mat[3][3], const float vec[3], const float phi);
-
 /******************************** XYZ Eulers *********************************/
 
 void eul_to_quat(float quat[4], const float eul[3]);

Modified: trunk/blender/source/blender/blenlib/intern/math_rotation.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_rotation.c	2013-06-22 23:37:45 UTC (rev 57658)
+++ trunk/blender/source/blender/blenlib/intern/math_rotation.c	2013-06-22 23:58:52 UTC (rev 57659)
@@ -861,35 +861,6 @@
 	}
 }
 
-/****************************** Vector/Rotation ******************************/
-/* TODO: the following calls should probably be deprecated sometime         */
-
-/* TODO, replace use of this function with axis_angle_to_mat3() */
-void vec_rot_to_mat3(float mat[3][3], const float vec[3], const float phi)
-{
-	/* rotation of phi radials around vec */
-	float vx, vx2, vy, vy2, vz, vz2, co, si;
-
-	vx = vec[0];
-	vy = vec[1];
-	vz = vec[2];
-	vx2 = vx * vx;
-	vy2 = vy * vy;
-	vz2 = vz * vz;
-	co = cosf(phi);
-	si = sinf(phi);
-
-	mat[0][0] = vx2 + co * (1.0f - vx2);
-	mat[0][1] = vx * vy * (1.0f - co) + vz * si;
-	mat[0][2] = vz * vx * (1.0f - co) - vy * si;
-	mat[1][0] = vx * vy * (1.0f - co) - vz * si;
-	mat[1][1] = vy2 + co * (1.0f - vy2);
-	mat[1][2] = vy * vz * (1.0f - co) + vx * si;
-	mat[2][0] = vz * vx * (1.0f - co) + vy * si;
-	mat[2][1] = vy * vz * (1.0f - co) - vx * si;
-	mat[2][2] = vz2 + co * (1.0f - vz2);
-}
-
 /******************************** XYZ Eulers *********************************/
 
 /* XYZ order */

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-06-22 23:37:45 UTC (rev 57658)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-06-22 23:58:52 UTC (rev 57659)
@@ -1160,8 +1160,8 @@
 		short axis;
 		
 		/* setup a 45 degree rotation matrix */
-		vec_rot_to_mat3(mat, imat[2], (float)M_PI / 4.0f);
-		
+		axis_angle_normalized_to_mat3(mat, imat[2], (float)M_PI / 4.0f);
+
 		/* vectors */
 		mul_v3_v3fl(v1, imat[0], circrad * 1.2f);
 		mul_v3_v3fl(v2, imat[0], circrad * 2.5f);

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2013-06-22 23:37:45 UTC (rev 57658)
+++ trunk/blender/source/blender/editors/transform/transform.c	2013-06-22 23:58:52 UTC (rev 57659)
@@ -3606,7 +3606,7 @@
 	float mat[3][3];
 	int i;
 	
-	vec_rot_to_mat3(mat, axis, angle);
+	axis_angle_normalized_to_mat3(mat, axis, angle);
 	
 	for (i = 0; i < t->total; i++, td++) {
 		
@@ -3618,10 +3618,10 @@
 		
 		if (t->con.applyRot) {
 			t->con.applyRot(t, td, axis, NULL);
-			vec_rot_to_mat3(mat, axis, angle * td->factor);
+			axis_angle_normalized_to_mat3(mat, axis, angle * td->factor);
 		}
 		else if (t->flag & T_PROP_EDIT) {
-			vec_rot_to_mat3(mat, axis, angle * td->factor);
+			axis_angle_normalized_to_mat3(mat, axis, angle * td->factor);
 		}
 		
 		ElementRotation(t, td, mat, t->around);
@@ -3702,14 +3702,14 @@
 	t->flag |= T_NO_CONSTRAINT;
 }
 
-static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float angles[2])
+static void applyTrackball(TransInfo *t, const float axis1[3], const float axis2[3], float angles[2])
 {
 	TransData *td = t->data;
 	float mat[3][3], smat[3][3], totmat[3][3];
 	int i;
 
-	vec_rot_to_mat3(smat, axis1, angles[0]);
-	vec_rot_to_mat3(totmat, axis2, angles[1]);
+	axis_angle_normalized_to_mat3(smat, axis1, angles[0]);
+	axis_angle_normalized_to_mat3(totmat, axis2, angles[1]);
 
 	mul_m3_m3m3(mat, smat, totmat);
 
@@ -3721,8 +3721,8 @@
 			continue;
 
 		if (t->flag & T_PROP_EDIT) {
-			vec_rot_to_mat3(smat, axis1, td->factor * angles[0]);
-			vec_rot_to_mat3(totmat, axis2, td->factor * angles[1]);
+			axis_angle_normalized_to_mat3(smat, axis1, td->factor * angles[0]);
+			axis_angle_normalized_to_mat3(totmat, axis2, td->factor * angles[1]);
 
 			mul_m3_m3m3(mat, smat, totmat);
 		}
@@ -3771,8 +3771,8 @@
 		ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size);
 	}
 
-	vec_rot_to_mat3(smat, axis1, phi[0]);
-	vec_rot_to_mat3(totmat, axis2, phi[1]);
+	axis_angle_normalized_to_mat3(smat, axis1, phi[0]);
+	axis_angle_normalized_to_mat3(totmat, axis2, phi[1]);
 
 	mul_m3_m3m3(mat, smat, totmat);
 




More information about the Bf-blender-cvs mailing list