remove vec_rot_to_mat3(), replace with axis_angle_normalized_to_mat3()

This commit is contained in:
Campbell Barton 2013-06-22 23:58:52 +00:00
parent 80ffe6f9b6
commit adba695209
5 changed files with 14 additions and 50 deletions

View File

@ -1474,7 +1474,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3])
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 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3])
}
/* 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);

View File

@ -106,13 +106,6 @@ void mat4_to_axis_angle(float axis[3], float *angle, float M[4][4]);
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]);

View File

@ -861,35 +861,6 @@ void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float ang
}
}
/****************************** 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 */

View File

@ -1160,8 +1160,8 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
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);

View File

@ -3606,7 +3606,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
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 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
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 @@ void initTrackball(TransInfo *t)
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 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
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 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
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);