diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-07-29 15:15:37 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-07-29 15:15:37 +0400 |
commit | 6dcde0b5be6d87981fcdd27c924ec1c9e4965c96 (patch) | |
tree | f2bf5eee347605d887c3c83269ef80c49f80f07a /source/blender/blenkernel | |
parent | ddbd9182d41b89f7bec11400a1949759dcfcf3fe (diff) |
More Constraints Bugfixes:
* Transform Constraint should now work in more cases. Somehow the old code (for location case) wasn't working correctly.
* ChildOf Constraint applied on objects, should now get the right 'inverse'/'offset' matrix set. It now uses the same code that is used by Blender's parenting method to do so.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 2ab7bfb6049..55470d0117c 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2623,8 +2623,12 @@ static void evaluate_constraint (bConstraint *constraint, float ownermat[][4], f } break; default: /* location */ + /* get new location */ for (i=0; i<3; i++) - loc[i] += (data->to_min[i] + (sval[data->map[i]] * (data->to_max[i] - data->to_min[i]))); + loc[i]= (data->to_min[i] + (sval[data->map[i]] * (data->to_max[i] - data->to_min[i]))); + + /* add original location back on (so that it can still be moved) */ + VecAddf(loc, ownermat[3], loc); break; } |