diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-04-16 11:33:54 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-04-16 11:33:54 +0400 |
commit | 6b2a65a3b6d75e5d599717ef8b48eff6275dbbdb (patch) | |
tree | 7062b09ac2ab891c3e3f66967e49c19efc7d00f9 /source/blender/blenkernel | |
parent | 190c18a62afc5c807cb15e673a474c8ad40efeac (diff) |
Bugfix #8948: Transformation constraint - destination rotation is in radians
Unfortunately, my previous fixes here to get gears working resulted in this problem. The flip side of that was that gears worked for quite a few cases.
Alas, it is not to be... The bug is now fixed, but gears no longer work any more. Sadly, there is not much I can do about this.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 6cd2147391e..29393d3e7a1 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3178,12 +3178,6 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * } } - /* convert radians<->degrees */ - if (data->to == 1) { - /* if output is rotation, convert to radians from degrees */ - for (i=0; i<3; i++) - sval[i] = sval[i] / 180 * M_PI; - } /* apply transforms */ switch (data->to) { @@ -3195,11 +3189,14 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * for (i=0; i<3; i++) { float tmin, tmax; - /* convert destination min/max ranges from degrees to radians */ - tmin= data->to_min[i] / M_PI * 180; - tmax= data->to_max[i] / M_PI * 180; + tmin= data->to_min[i]; + tmax= data->to_max[i]; + /* all values here should be in degrees */ eul[i]= tmin + (sval[data->map[i]] * (tmax - tmin)); + + /* now convert final value back to radians */ + eul[i] = eul[i] / 180 * M_PI; } break; default: /* location */ |