diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-27 21:22:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-27 21:22:04 +0400 |
commit | a73c3fe5c992777718431d5e5bb5f8a2c3b7a1bc (patch) | |
tree | 51ca1d7a06715f0dde24196157c915b12da334c0 /source/blender/editors/sculpt_paint/sculpt.c | |
parent | 9c8f1e2ef487483bc374feaed9ff709e07638623 (diff) |
subsurf, derived mesh and other misc files: floats were being implicitly promoted to doubles, adjust to use floats.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1428a9a9075..1d818818908 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -537,8 +537,8 @@ static float calc_overlap(StrokeCache *cache, const char symm, const char axis, //distsq = len_squared_v3v3(mirror, cache->traced_location); distsq = len_squared_v3v3(mirror, cache->true_location); - if (distsq <= 4*(cache->radius_squared)) - return (2*(cache->radius) - sqrt(distsq)) / (2*(cache->radius)); + if (distsq <= 4.0f*(cache->radius_squared)) + return (2.0f*(cache->radius) - sqrtf(distsq)) / (2.0f*(cache->radius)); else return 0; } @@ -731,12 +731,12 @@ static float tex_strength(SculptSession *ss, Brush *br, float *point, const floa /* it is probably worth optimizing for those cases where the texture is not rotated by skipping the calls to atan2, sqrtf, sin, and cos. */ - if (rotation > 0.001 || rotation < -0.001) { - const float angle = atan2(y, x) + rotation; + if (rotation > 0.001f || rotation < -0.001f) { + const float angle = atan2f(y, x) + rotation; const float flen = sqrtf(x*x + y*y); - x = flen * cos(angle); - y = flen * sin(angle); + x = flen * cosf(angle); + y = flen * sinf(angle); } x *= br->mtex.size[0]; @@ -798,7 +798,7 @@ static void sculpt_clip(Sculpt *sd, SculptSession *ss, float *co, const float va if(sd->flags & (SCULPT_LOCK_X << i)) continue; - if((ss->cache->flag & (CLIP_X << i)) && (fabs(co[i]) <= ss->cache->clip_tolerance[i])) + if((ss->cache->flag & (CLIP_X << i)) && (fabsf(co[i]) <= ss->cache->clip_tolerance[i])) co[i]= 0.0f; else co[i]= val[i]; @@ -3135,7 +3135,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, st (brush->flag & BRUSH_RANDOM_ROTATION) && !(brush->flag & BRUSH_RAKE)) { - cache->special_rotation = 2*M_PI*BLI_frand(); + cache->special_rotation = 2.0f*(float)M_PI*BLI_frand(); } } |