== Copy Rotation Constraint - Peach (Cessen) Request ==

Copy Rotation constraint now has ability for the owner's rotation to be added on top of the copied rotation (i.e. an 'offset' like for the Copy Location constraint).
This commit is contained in:
2007-10-30 11:18:50 +00:00
parent b617c191aa
commit 0fb83a87b9
2 changed files with 24 additions and 12 deletions

View File

@@ -1695,25 +1695,34 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
Mat4ToEul(ct->matrix, eul);
Mat4ToEul(cob->matrix, obeul);
if ((data->flag & ROTLIKE_X)==0) {
if ((data->flag & ROTLIKE_X)==0)
eul[0] = obeul[0];
else {
if (data->flag & ROTLIKE_OFFSET)
euler_rot(eul, obeul[0], 'x');
if (data->flag & ROTLIKE_X_INVERT)
eul[0] *= -1;
}
else if (data->flag & ROTLIKE_X_INVERT) {
eul[0] *= -1;
}
if ((data->flag & ROTLIKE_Y)==0) {
if ((data->flag & ROTLIKE_Y)==0)
eul[1] = obeul[1];
}
else if (data->flag & ROTLIKE_Y_INVERT) {
eul[1] *= -1;
else {
if (data->flag & ROTLIKE_OFFSET)
euler_rot(eul, obeul[1], 'y');
if (data->flag & ROTLIKE_Y_INVERT)
eul[1] *= -1;
}
if ((data->flag & ROTLIKE_Z)==0) {
if ((data->flag & ROTLIKE_Z)==0)
eul[2] = obeul[2];
}
else if (data->flag & ROTLIKE_Z_INVERT) {
eul[2] *= -1;
else {
if (data->flag & ROTLIKE_OFFSET)
euler_rot(eul, obeul[2], 'z');
if (data->flag & ROTLIKE_Z_INVERT)
eul[2] *= -1;
}
compatible_eul(eul, obeul);