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:
authorJoshua Leung <aligorith@gmail.com>2007-10-30 14:18:50 +0300
committerJoshua Leung <aligorith@gmail.com>2007-10-30 14:18:50 +0300
commit0fb83a87b9e42c5216d5507a9ce19f53e2ae8095 (patch)
tree2a3c8d6956c29646c67d8d890cd3fd0d892f077f /source/blender/blenkernel/intern
parentb617c191aaa039a783b77769d0bd15d898adbd8c (diff)
== 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).
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/constraint.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index aceef7d628b..1e6f7e4d9e3 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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);