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:
authorBastien Montagne <montagne29@wanadoo.fr>2012-10-25 14:14:35 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-10-25 14:14:35 +0400
commit0632da082975d5b8d321abf7183757f484e6fb8a (patch)
treefd8427c512c3c5fa68330ebab7c5622d6422225d /source/blender/blenkernel/intern/constraint.c
parent53d4685c953430f19fe5c75102b9e2868dd738a0 (diff)
Cleanup: remove old, commented code for constraints' space conversion for bones.
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index aef9ad633f7..887a322d91d 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -221,51 +221,6 @@ void constraints_clear_evalob(bConstraintOb *cob)
/* -------------- Space-Conversion API -------------- */
-#if 0 /* XXX Old code, does the same as one in armature.c, will remove it later. */
-static void constraint_pchan_diff_mat(bPoseChannel *pchan, float diff_mat[4][4])
-{
- if (pchan->parent) {
- float offs_bone[4][4];
-
- /* construct offs_bone the same way it is done in armature.c */
- copy_m4_m3(offs_bone, pchan->bone->bone_mat);
- copy_v3_v3(offs_bone[3], pchan->bone->head);
- offs_bone[3][1] += pchan->bone->parent->length;
-
- if (pchan->bone->flag & BONE_HINGE) {
- /* pose_mat = par_pose-space_location * chan_mat */
- float tmat[4][4];
-
- /* the rotation of the parent restposition */
- copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
-
- /* the location of actual parent transform */
- copy_v3_v3(tmat[3], offs_bone[3]);
- zero_v3(offs_bone[3]);
- mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
-
- mult_m4_m4m4(diff_mat, tmat, offs_bone);
- }
- else {
- /* pose_mat = par_pose_mat * bone_mat * chan_mat */
- if (pchan->bone->flag & BONE_NO_SCALE) {
- float tmat[4][4];
- copy_m4_m4(tmat, pchan->parent->pose_mat);
- normalize_m4(tmat);
- mult_m4_m4m4(diff_mat, tmat, offs_bone);
- }
- else {
- mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone);
- }
- }
- }
- else {
- /* pose_mat = chan_mat * arm_mat */
- copy_m4_m4(diff_mat, pchan->bone->arm_mat);
- }
-}
-#endif
-
/* This function is responsible for the correct transformations/conversions
* of a matrix from one space to another for constraint evaluation.
* For now, this is only implemented for Objects and PoseChannels.
@@ -307,18 +262,6 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
else if (to == CONSTRAINT_SPACE_LOCAL) {
if (pchan->bone) {
BKE_armature_mat_pose_to_bone(pchan, mat, mat);
-#if 0 /* XXX Old code, will remove it later. */
- constraint_pchan_diff_mat(pchan, diff_mat);
-
- invert_m4_m4(imat, diff_mat);
- mult_m4_m4m4(mat, imat, mat);
-
- /* override with local location */
- if ((pchan->parent) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
- BKE_armature_mat_pose_to_bone_ex(ob, pchan, pchan->pose_mat, tempmat);
- copy_v3_v3(mat[3], tempmat[3]);
- }
-#endif
}
}
/* pose to local with parent */
@@ -336,11 +279,6 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
if (pchan->bone) {
/* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
BKE_armature_mat_bone_to_pose(pchan, mat, mat);
-#if 0
- constraint_pchan_diff_mat(pchan, diff_mat);
-
- mult_m4_m4m4(mat, diff_mat, mat);
-#endif
}
/* use pose-space as stepping stone for other spaces */