diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_child.c | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 2 |
6 files changed, 17 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 7d04ab7778f..31695b05352 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2206,7 +2206,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o float range = bulge_max - 1.0f; float scale = (range > 0.0f) ? 1.0f / range : 0.0f; - float soft = 1.0f + range * atanf((bulge - 1.0f) * scale) / (0.5f * M_PI); + float soft = 1.0f + range * atanf((bulge - 1.0f) * scale) / (float)M_PI_2; bulge = interpf(soft, hard, ikData->bulge_smooth); } @@ -2218,7 +2218,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o float range = 1.0f - bulge_min; float scale = (range > 0.0f) ? 1.0f / range : 0.0f; - float soft = 1.0f - range * atanf((1.0f - bulge) * scale) / (0.5f * M_PI); + float soft = 1.0f - range * atanf((1.0f - bulge) * scale) / (float)M_PI_2; bulge = interpf(soft, hard, ikData->bulge_smooth); } diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index f591fe857f8..668b78a08d4 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2715,7 +2715,7 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t float range = bulge_max - 1.0f; float scale = (range > 0.0f) ? 1.0f / range : 0.0f; - float soft = 1.0f + range * atanf((bulge - 1.0f) * scale) / (0.5f * M_PI); + float soft = 1.0f + range * atanf((bulge - 1.0f) * scale) / (float)M_PI_2; bulge = interpf(soft, hard, data->bulge_smooth); } @@ -2727,7 +2727,7 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t float range = 1.0f - bulge_min; float scale = (range > 0.0f) ? 1.0f / range : 0.0f; - float soft = 1.0f - range * atanf((1.0f - bulge) * scale) / (0.5f * M_PI); + float soft = 1.0f - range * atanf((1.0f - bulge) * scale) / (float)M_PI_2; bulge = interpf(soft, hard, data->bulge_smooth); } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 51330f27fea..e88a8ecde8e 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1742,7 +1742,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, /* half a circle */ fp = dl->verts; - dangle = (0.5 * M_PI / (dnr - 1)); + dangle = ((float)M_PI_2 / (dnr - 1)); angle = -(nr - 1) * dangle; for (a = 0; a < nr; a++) { @@ -1801,7 +1801,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, /* half a circle */ fp = dl->verts; angle = 0.0; - dangle = (0.5 * M_PI / (dnr - 1)); + dangle = ((float)M_PI_2 / (dnr - 1)); for (a = 0; a < nr; a++) { fp[0] = 0.0; @@ -1943,7 +1943,7 @@ static void calc_bevel_sin_cos(float x1, float y1, float x2, float y2, t02 = x1 * x2 + y1 * y2; if (fabsf(t02) >= 1.0f) - t02 = 0.5 * M_PI; + t02 = M_PI_2; else t02 = (saacos(t02)) / 2.0f; @@ -2476,7 +2476,7 @@ static void make_bevel_list_2D(BevList *bl) /* first */ bevp = bl->bevpoints; - angle = atan2f(bevp->dir[0], bevp->dir[1]) - (float)(M_PI / 2.0f); + angle = atan2f(bevp->dir[0], bevp->dir[1]) - (float)M_PI_2; bevp->sina = sinf(angle); bevp->cosa = cosf(angle); vec_to_quat(bevp->quat, bevp->dir, 5, 1); @@ -2484,7 +2484,7 @@ static void make_bevel_list_2D(BevList *bl) /* last */ bevp = bl->bevpoints; bevp += (bl->nr - 1); - angle = atan2f(bevp->dir[0], bevp->dir[1]) - (float)(M_PI / 2.0f); + angle = atan2f(bevp->dir[0], bevp->dir[1]) - (float)M_PI_2; bevp->sina = sinf(angle); bevp->cosa = cosf(angle); vec_to_quat(bevp->quat, bevp->dir, 5, 1); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index b5004b94517..b817b72f180 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -4059,8 +4059,8 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa normalize_v3(nor); /* make sure that we get a proper side vector */ - if (fabsf(dot_v3v3(nor, vec)) > 0.999999) { - if (fabsf(dot_v3v3(nor, xvec)) > 0.999999) { + if (fabsf(dot_v3v3(nor, vec)) > 0.999999f) { + if (fabsf(dot_v3v3(nor, xvec)) > 0.999999f) { nor[0] = 0.0f; nor[1] = 1.0f; nor[2] = 0.0f; diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c index df03f39f62a..24fba604d1e 100644 --- a/source/blender/blenkernel/intern/particle_child.c +++ b/source/blender/blenkernel/intern/particle_child.c @@ -138,14 +138,15 @@ static void do_kink_spiral_deform(ParticleKey *state, const float dir[3], const * and goes up to the Golden Spiral for 1.0 * http://en.wikipedia.org/wiki/Golden_spiral */ - const float b = shape * (1.0f + sqrtf(5.0f)) / M_PI * 0.25f; + const float b = shape * (1.0f + sqrtf(5.0f)) / (float)M_PI * 0.25f; /* angle of the spiral against the curve (rotated opposite to make a smooth transition) */ - const float start_angle = (b != 0.0f ? atanf(1.0f / b) : -M_PI*0.5f) + (b > 0.0f ? -M_PI*0.5f : M_PI*0.5f); + const float start_angle = ((b != 0.0f) ? atanf(1.0f / b) : + (float)-M_PI_2) + (b > 0.0f ? -(float)M_PI_2 : (float)M_PI_2); float spiral_axis[3], rot[3][3]; float vec[3]; - float theta = freq * time * 2.0f*M_PI; + float theta = freq * time * 2.0f * (float)M_PI; float radius = amplitude * expf(b * theta); /* a bit more intuitive than using negative frequency for this */ @@ -269,7 +270,7 @@ static void do_kink_spiral(ParticleThreadContext *ctx, ParticleTexture *ptex, co normalize_v3(kink); if (kink_axis_random > 0.0f) { - float a = kink_axis_random * (psys_frand(ctx->sim.psys, 7112 + seed) * 2.0f - 1.0f) * M_PI; + float a = kink_axis_random * (psys_frand(ctx->sim.psys, 7112 + seed) * 2.0f - 1.0f) * (float)M_PI; float rot[3][3]; axis_angle_normalized_to_mat3(rot, dir, a); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index c7d7ae10ba8..6c4cbcf9316 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -760,7 +760,7 @@ void default_mtex(MTex *mtex) mtex->fieldfac = 1.0f; mtex->normapspace = MTEX_NSPACE_TANGENT; mtex->brush_map_mode = MTEX_MAP_MODE_TILED; - mtex->random_angle = 2.0f * M_PI; + mtex->random_angle = 2.0f * (float)M_PI; mtex->brush_angle_mode = 0; } |