diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-28 21:06:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-28 21:06:15 +0400 |
commit | faf07c3e2b6cb180d1580b4160ff6534b4754b76 (patch) | |
tree | 536def1d8e175faa7ea152e36dfa63ecf750aa85 /source/blender/editors/transform/transform_constraints.c | |
parent | 859d22467d406d8be9269035e271bd9ad7c935b4 (diff) |
transform: floats were being implicitly promoted to doubles, adjust to use floats.
also use macros RAD2DEGF & DEG2RADF.
Diffstat (limited to 'source/blender/editors/transform/transform_constraints.c')
-rw-r--r-- | source/blender/editors/transform/transform_constraints.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 1e6fae7609e..0012334cf92 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -191,11 +191,11 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 if(in[0]==0.0f && in[1]==0.0f && in[2]==0.0f) return; - angle = fabs(angle_v3v3(axis, t->viewinv[2])); - if (angle > M_PI / 2) { - angle = M_PI - angle; + angle = fabsf(angle_v3v3(axis, t->viewinv[2])); + if (angle > (float)M_PI / 2.0f) { + angle = (float)M_PI - angle; } - angle = 180.0f * angle / M_PI; + angle = RAD2DEGF(angle); /* For when view is parallel to constraint... will cause NaNs otherwise So we take vertical motion in 3D space and apply it to the @@ -228,12 +228,12 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 /* give arbitrary large value if projection is impossible */ factor = dot_v3v3(axis, norm); - if (1 - fabs(factor) < 0.0002f) { + if (1.0f - fabsf(factor) < 0.0002f) { VECCOPY(out, axis); if (factor > 0) { - mul_v3_fl(out, 1000000000); + mul_v3_fl(out, 1000000000.0f); } else { - mul_v3_fl(out, -1000000000); + mul_v3_fl(out, -1000000000.0f); } } else { add_v3_v3v3(v2, t->con.center, axis); |