Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c215
1 files changed, 68 insertions, 147 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index aae70c055d0..b415484c1c1 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -256,7 +256,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
/* construct offs_bone the same way it is done in armature.c */
copy_m4_m3(offs_bone, pchan->bone->bone_mat);
- VECCOPY(offs_bone[3], pchan->bone->head);
+ copy_v3_v3(offs_bone[3], pchan->bone->head);
offs_bone[3][1]+= pchan->bone->parent->length;
if (pchan->bone->flag & BONE_HINGE) {
@@ -267,7 +267,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
/* the location of actual parent transform */
- VECCOPY(tmat[3], offs_bone[3]);
+ copy_v3_v3(tmat[3], offs_bone[3]);
offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
@@ -309,7 +309,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
/* construct offs_bone the same way it is done in armature.c */
copy_m4_m3(offs_bone, pchan->bone->bone_mat);
- VECCOPY(offs_bone[3], pchan->bone->head);
+ copy_v3_v3(offs_bone[3], pchan->bone->head);
offs_bone[3][1]+= pchan->bone->parent->length;
if (pchan->bone->flag & BONE_HINGE) {
@@ -320,8 +320,8 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
/* the location of actual parent transform */
- VECCOPY(tmat[3], offs_bone[3]);
- offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
+ copy_v3_v3(tmat[3], offs_bone[3]);
+ zero_v3(offs_bone[3]);
mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
mul_m4_m4m4(diff_mat, offs_bone, tmat);
@@ -400,7 +400,7 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
DerivedMesh *dm = NULL;
Mesh *me= ob->data;
EditMesh *em = BKE_mesh_get_editmesh(me);
- float vec[3] = {0.0f, 0.0f, 0.0f}, tvec[3];
+ float vec[3] = {0.0f, 0.0f, 0.0f};
float normal[3] = {0.0f, 0.0f, 0.0f}, plane[3];
float imat[3][3], tmat[3][3];
int dgroup;
@@ -477,9 +477,9 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
mul_m3_v3(tmat, normal);
normalize_v3(normal);
- VECCOPY(plane, tmat[1]);
+ copy_v3_v3(plane, tmat[1]);
- VECCOPY(tmat[2], normal);
+ copy_v3_v3(tmat[2], normal);
cross_v3_v3v3(tmat[0], normal, plane);
cross_v3_v3v3(tmat[1], tmat[2], tmat[0]);
@@ -488,8 +488,7 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
/* apply the average coordinate as the new location */
- mul_v3_m4v3(tvec, ob->obmat, vec);
- VECCOPY(mat[3], tvec);
+ mul_v3_m4v3(mat[3], ob->obmat, vec);
}
}
@@ -554,7 +553,7 @@ static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][
mul_v3_m4v3(tvec, ob->obmat, vec);
/* copy new location to matrix */
- VECCOPY(mat[3], tvec);
+ copy_v3_v3(mat[3], tvec);
}
/* generic function to get the appropriate matrix for most target cases */
@@ -819,11 +818,11 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
copy_m4_m4(invmat, data->invmat);
/* extract components of both matrices */
- VECCOPY(loc, ct->matrix[3]);
+ copy_v3_v3(loc, ct->matrix[3]);
mat4_to_eulO(eul, ct->rotOrder, ct->matrix);
mat4_to_size(size, ct->matrix);
- VECCOPY(loco, invmat[3]);
+ copy_v3_v3(loco, invmat[3]);
mat4_to_eulO(eulo, cob->rotOrder, invmat);
mat4_to_size(sizo, invmat);
@@ -940,9 +939,8 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
float right[3];
float neg = -1;
int right_index;
-
- copy_v3_v3(n, vec);
- if (normalize_v3(n) == 0.0) {
+
+ if (normalize_v3_v3(n, vec) == 0.0) {
n[0] = 0.0;
n[1] = 0.0;
n[2] = 1.0;
@@ -953,9 +951,7 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
/* n specifies the transformation of the track axis */
if (flags & TARGET_Z_UP) {
/* target Z axis is the global up axis */
- u[0] = target_up[0];
- u[1] = target_up[1];
- u[2] = target_up[2];
+ copy_v3_v3(u, target_up);
}
else {
/* world Z axis is the global up axis */
@@ -988,20 +984,13 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
m[right_index][1] = neg * right[1];
m[right_index][2] = neg * right[2];
- m[upflag][0] = proj[0];
- m[upflag][1] = proj[1];
- m[upflag][2] = proj[2];
+ copy_v3_v3(m[upflag], proj);
- m[axis][0] = n[0];
- m[axis][1] = n[1];
- m[axis][2] = n[2];
+ copy_v3_v3(m[axis], n);
}
/* identity matrix - don't do anything if the two axes are the same */
else {
- m[0][0]= m[1][1]= m[2][2]= 1.0;
- m[0][1]= m[0][2]= 0.0;
- m[1][0]= m[1][2]= 0.0;
- m[2][0]= m[2][1]= 0.0;
+ unit_m3(m);
}
}
@@ -1264,7 +1253,7 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
copy_m4_m4(totmat, rmat);
}
- VECCOPY(totmat[3], vec);
+ copy_v3_v3(totmat[3], vec);
mul_serie_m4(ct->matrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
}
@@ -1383,7 +1372,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
float eul[3];
float size[3];
- VECCOPY(loc, cob->matrix[3]);
+ copy_v3_v3(loc, cob->matrix[3]);
mat4_to_size(size, cob->matrix);
mat4_to_eulO(eul, cob->rotOrder, cob->matrix);
@@ -1544,7 +1533,7 @@ static void loclike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float offset[3] = {0.0f, 0.0f, 0.0f};
if (data->flag & LOCLIKE_OFFSET)
- VECCOPY(offset, cob->matrix[3]);
+ copy_v3_v3(offset, cob->matrix[3]);
if (data->flag & LOCLIKE_X) {
cob->matrix[3][0] = ct->matrix[3][0];
@@ -1636,7 +1625,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float eul[3], obeul[3];
float size[3];
- VECCOPY(loc, cob->matrix[3]);
+ copy_v3_v3(loc, cob->matrix[3]);
mat4_to_size(size, cob->matrix);
/* to allow compatible rotations, must get both rotations in the order of the owner... */
@@ -2138,7 +2127,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
}
else {
/* extract location */
- VECCOPY(vec, tempmat[3]);
+ copy_v3_v3(vec, tempmat[3]);
axis= data->type - 20;
}
@@ -2294,10 +2283,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(totmat[1]);
/* the x axis is fixed */
- totmat[0][0] = cob->matrix[0][0];
- totmat[0][1] = cob->matrix[0][1];
- totmat[0][2] = cob->matrix[0][2];
- normalize_v3(totmat[0]);
+ normalize_v3_v3(totmat[0], cob->matrix[0]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
@@ -2311,10 +2297,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(totmat[2]);
/* the x axis is fixed */
- totmat[0][0] = cob->matrix[0][0];
- totmat[0][1] = cob->matrix[0][1];
- totmat[0][2] = cob->matrix[0][2];
- normalize_v3(totmat[0]);
+ normalize_v3_v3(totmat[0], cob->matrix[0]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2329,10 +2312,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
negate_v3(totmat[1]);
/* the x axis is fixed */
- totmat[0][0] = cob->matrix[0][0];
- totmat[0][1] = cob->matrix[0][1];
- totmat[0][2] = cob->matrix[0][2];
- normalize_v3(totmat[0]);
+ normalize_v3_v3(totmat[0], cob->matrix[0]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
@@ -2347,10 +2327,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
negate_v3(totmat[2]);
/* the x axis is fixed */
- totmat[0][0] = cob->matrix[0][0];
- totmat[0][1] = cob->matrix[0][1];
- totmat[0][2] = cob->matrix[0][2];
- normalize_v3(totmat[0]);
+ normalize_v3_v3(totmat[0], cob->matrix[0]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2358,9 +2335,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
break;
default:
{
- totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
- totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
- totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+ unit_m3(totmat);
}
break;
}
@@ -2377,11 +2352,8 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(totmat[0]);
/* the y axis is fixed */
- totmat[1][0] = cob->matrix[1][0];
- totmat[1][1] = cob->matrix[1][1];
- totmat[1][2] = cob->matrix[1][2];
- normalize_v3(totmat[1]);
-
+ normalize_v3_v3(totmat[1], cob->matrix[1]);
+
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
}
@@ -2394,10 +2366,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(totmat[2]);
/* the y axis is fixed */
- totmat[1][0] = cob->matrix[1][0];
- totmat[1][1] = cob->matrix[1][1];
- totmat[1][2] = cob->matrix[1][2];
- normalize_v3(totmat[1]);
+ normalize_v3_v3(totmat[1], cob->matrix[1]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2412,10 +2381,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
negate_v3(totmat[0]);
/* the y axis is fixed */
- totmat[1][0] = cob->matrix[1][0];
- totmat[1][1] = cob->matrix[1][1];
- totmat[1][2] = cob->matrix[1][2];
- normalize_v3(totmat[1]);
+ normalize_v3_v3(totmat[1], cob->matrix[1]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
@@ -2430,10 +2396,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
negate_v3(totmat[2]);
/* the y axis is fixed */
- totmat[1][0] = cob->matrix[1][0];
- totmat[1][1] = cob->matrix[1][1];
- totmat[1][2] = cob->matrix[1][2];
- normalize_v3(totmat[1]);
+ normalize_v3_v3(totmat[1], cob->matrix[1]);
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2441,9 +2404,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
break;
default:
{
- totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
- totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
- totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+ unit_m3(totmat);
}
break;
}
@@ -2460,10 +2421,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(totmat[0]);
/* the z axis is fixed */
- totmat[2][0] = cob->matrix[2][0];
- totmat[2][1] = cob->matrix[2][1];
- totmat[2][2] = cob->matrix[2][2];
- normalize_v3(totmat[2]);
+ normalize_v3_v3(totmat[2], cob->matrix[2]);
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2477,10 +2435,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(totmat[1]);
/* the z axis is fixed */
- totmat[2][0] = cob->matrix[2][0];
- totmat[2][1] = cob->matrix[2][1];
- totmat[2][2] = cob->matrix[2][2];
- normalize_v3(totmat[2]);
+ normalize_v3_v3(totmat[2], cob->matrix[2]);
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2495,10 +2450,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
negate_v3(totmat[0]);
/* the z axis is fixed */
- totmat[2][0] = cob->matrix[2][0];
- totmat[2][1] = cob->matrix[2][1];
- totmat[2][2] = cob->matrix[2][2];
- normalize_v3(totmat[2]);
+ normalize_v3_v3(totmat[2], cob->matrix[2]);
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2513,10 +2465,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
negate_v3(totmat[1]);
/* the z axis is fixed */
- totmat[2][0] = cob->matrix[2][0];
- totmat[2][1] = cob->matrix[2][1];
- totmat[2][2] = cob->matrix[2][2];
- normalize_v3(totmat[2]);
+ normalize_v3_v3(totmat[2], cob->matrix[2]);
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2524,9 +2473,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
break;
default:
{
- totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
- totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
- totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+ unit_m3(totmat);
}
break;
}
@@ -2534,19 +2481,13 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
break;
default:
{
- totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
- totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
- totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+ unit_m3(totmat);
}
break;
}
/* Block to keep matrix heading */
- tmpmat[0][0] = cob->matrix[0][0];tmpmat[0][1] = cob->matrix[0][1];tmpmat[0][2] = cob->matrix[0][2];
- tmpmat[1][0] = cob->matrix[1][0];tmpmat[1][1] = cob->matrix[1][1];tmpmat[1][2] = cob->matrix[1][2];
- tmpmat[2][0] = cob->matrix[2][0];tmpmat[2][1] = cob->matrix[2][1];tmpmat[2][2] = cob->matrix[2][2];
- normalize_v3(tmpmat[0]);
- normalize_v3(tmpmat[1]);
- normalize_v3(tmpmat[2]);
+ copy_m3_m4(tmpmat, cob->matrix);
+ normalize_m3(tmpmat);
invert_m3_m3(invmat, tmpmat);
mul_m3_m3m3(tmpmat, totmat, invmat);
totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
@@ -2559,9 +2500,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
totmat[1][0],totmat[1][1],totmat[1][2],
totmat[2][0],totmat[2][1],totmat[2][2]);
if (mdet==0) {
- totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
- totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
- totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+ unit_m3(totmat);
}
/* apply out transformaton to the object */
@@ -2689,7 +2628,7 @@ static void distlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
interp_v3_v3v3(dvec, ct->matrix[3], cob->matrix[3], sfac);
/* copy new vector onto owner */
- VECCOPY(cob->matrix[3], dvec);
+ copy_v3_v3(cob->matrix[3], dvec);
}
}
}
@@ -2772,16 +2711,10 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
mat4_to_size(size, cob->matrix);
/* store X orientation before destroying obmat */
- xx[0] = cob->matrix[0][0];
- xx[1] = cob->matrix[0][1];
- xx[2] = cob->matrix[0][2];
- normalize_v3(xx);
+ normalize_v3_v3(xx, cob->matrix[0]);
/* store Z orientation before destroying obmat */
- zz[0] = cob->matrix[2][0];
- zz[1] = cob->matrix[2][1];
- zz[2] = cob->matrix[2][2];
- normalize_v3(zz);
+ normalize_v3_v3(zz, cob->matrix[2]);
sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
vec[0] /= size[0];
@@ -2836,9 +2769,7 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(vec);
/* new Y aligns object target connection*/
- totmat[1][0] = -vec[0];
- totmat[1][1] = -vec[1];
- totmat[1][2] = -vec[2];
+ negate_v3_v3(totmat[1], vec);
switch (data->plane) {
case PLANE_X:
/* build new Z vector */
@@ -2847,16 +2778,11 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(orth);
/* new Z*/
- totmat[2][0] = orth[0];
- totmat[2][1] = orth[1];
- totmat[2][2] = orth[2];
+ copy_v3_v3(totmat[2], orth);
/* we decided to keep X plane*/
cross_v3_v3v3(xx, orth, vec);
- normalize_v3(xx);
- totmat[0][0] = xx[0];
- totmat[0][1] = xx[1];
- totmat[0][2] = xx[2];
+ normalize_v3_v3(totmat[0], xx);
break;
case PLANE_Z:
/* build new X vector */
@@ -2865,16 +2791,11 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
normalize_v3(orth);
/* new X */
- totmat[0][0] = -orth[0];
- totmat[0][1] = -orth[1];
- totmat[0][2] = -orth[2];
+ negate_v3_v3(totmat[0], orth);
/* we decided to keep Z */
cross_v3_v3v3(zz, orth, vec);
- normalize_v3(zz);
- totmat[2][0] = zz[0];
- totmat[2][1] = zz[1];
- totmat[2][2] = zz[2];
+ normalize_v3_v3(totmat[2], zz);
break;
} /* switch (data->plane) */
@@ -3006,10 +2927,10 @@ static void minmax_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
obmat[3][index] = tarmat[3][index] + data->offset;
if (data->flag & MINMAX_STICKY) {
if (data->flag & MINMAX_STUCK) {
- VECCOPY(obmat[3], data->cache);
+ copy_v3_v3(obmat[3], data->cache);
}
else {
- VECCOPY(data->cache, obmat[3]);
+ copy_v3_v3(data->cache, obmat[3]);
data->flag |= MINMAX_STUCK;
}
}
@@ -3019,7 +2940,7 @@ static void minmax_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
copy_m4_m4(cob->matrix, tmat);
}
else {
- VECCOPY(cob->matrix[3], obmat[3]);
+ copy_v3_v3(cob->matrix[3], obmat[3]);
}
}
else {
@@ -3174,7 +3095,7 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
copy_m4_m4(obmat, cob->matrix);
unit_m4(targetMatrix);
- VECCOPY(ownLoc, obmat[3]);
+ copy_v3_v3(ownLoc, obmat[3]);
INIT_MINMAX(curveMin, curveMax)
minmax_object(ct->tar, curveMin, curveMax);
@@ -3263,14 +3184,14 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
/* 3. position on curve */
if (where_on_path(ct->tar, curvetime, vec, dir, NULL, NULL, NULL) ) {
unit_m4(totmat);
- VECCOPY(totmat[3], vec);
+ copy_v3_v3(totmat[3], vec);
mul_serie_m4(targetMatrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
}
}
/* obtain final object position */
- VECCOPY(cob->matrix[3], targetMatrix[3]);
+ copy_v3_v3(cob->matrix[3], targetMatrix[3]);
}
}
@@ -3362,7 +3283,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
}
/* extract components of owner's matrix */
- VECCOPY(loc, cob->matrix[3]);
+ copy_v3_v3(loc, cob->matrix[3]);
mat4_to_eulO(eul, cob->rotOrder, cob->matrix);
mat4_to_size(size, cob->matrix);
@@ -3556,7 +3477,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
fail = TRUE;
break;
}
- VECCOPY(co, hit.co);
+ copy_v3_v3(co, hit.co);
break;
}
@@ -3572,7 +3493,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
/* co is in local object coordinates, change it to global and update target position */
mul_m4_v3(cob->matrix, co);
- VECCOPY(ct->matrix[3], co);
+ copy_v3_v3(ct->matrix[3], co);
}
}
}
@@ -3584,7 +3505,7 @@ static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
/* only evaluate if there is a target */
if (VALID_CONS_TARGET(ct))
{
- VECCOPY(cob->matrix[3], ct->matrix[3]);
+ copy_v3_v3(cob->matrix[3], ct->matrix[3]);
}
}
@@ -3668,23 +3589,23 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
* - the normalisation step at the end should take care of any unwanted scaling
* left over in the 3x3 matrix we used
*/
- VECCOPY(obvec, track_dir_vecs[data->trackflag]);
+ copy_v3_v3(obvec, track_dir_vecs[data->trackflag]);
mul_mat3_m4_v3(cob->matrix, obvec);
if (normalize_v3(obvec) == 0.0f) {
/* exceptional case - just use the track vector as appropriate */
- VECCOPY(obvec, track_dir_vecs[data->trackflag]);
+ copy_v3_v3(obvec, track_dir_vecs[data->trackflag]);
}
/* find the (unit) direction vector going from the owner to the target */
- VECCOPY(obloc, cob->matrix[3]);
+ copy_v3_v3(obloc, cob->matrix[3]);
sub_v3_v3v3(tarvec, ct->matrix[3], obloc);
if (normalize_v3(tarvec) == 0.0f) {
/* the target is sitting on the owner, so just make them use the same direction vectors */
// FIXME: or would it be better to use the pure direction vector?
- VECCOPY(tarvec, obvec);
- //VECCOPY(tarvec, track_dir_vecs[data->trackflag]);
+ copy_v3_v3(tarvec, obvec);
+ //copy_v3_v3(tarvec, track_dir_vecs[data->trackflag]);
}
/* determine the axis-angle rotation, which represents the smallest possible rotation
@@ -3712,7 +3633,7 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
mul_m4_m3m4(tmat, rmat, cob->matrix); // m1, m3, m2
copy_m4_m4(cob->matrix, tmat);
- VECCOPY(cob->matrix[3], obloc);
+ copy_v3_v3(cob->matrix[3], obloc);
}
}
@@ -3907,7 +3828,7 @@ static void pivotcon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
}
else {
/* directly use the 'offset' specified as an absolute position instead */
- VECCOPY(pivot, data->offset);
+ copy_v3_v3(pivot, data->offset);
}
}