From 7cb20d841da16d0bffb63154403267500e9941f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Nov 2020 11:25:27 +1100 Subject: Cleanup: follow our code style for float literals --- source/blender/blenkernel/intern/boids.c | 2 +- source/blender/blenkernel/intern/colortools.c | 6 +- source/blender/blenkernel/intern/dynamicpaint.c | 6 +- source/blender/blenkernel/intern/effect.c | 4 +- source/blender/blenkernel/intern/fluid.c | 6 +- source/blender/blenkernel/intern/object_dupli.c | 2 +- source/blender/blenkernel/intern/particle.c | 53 +++--- source/blender/blenkernel/intern/particle_child.c | 56 +++---- .../blenkernel/intern/particle_distribute.c | 18 +-- source/blender/blenkernel/intern/particle_system.c | 178 +++++++++++---------- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenkernel/intern/softbody.c | 6 +- 12 files changed, 171 insertions(+), 168 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 78ce70a8448..96bf9fbe8d2 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -899,7 +899,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, for (coll = bbd->sim->colliders->first; coll; coll = coll->next) { col.current = coll->ob; col.md = coll->collmd; - col.fac1 = col.fac2 = 0.f; + col.fac1 = col.fac2 = 0.0f; if (col.md && col.md->bvhtree) { BLI_bvhtree_ray_cast_ex(col.md->bvhtree, diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 34e8e8bc6fb..8723cd13e35 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1257,7 +1257,7 @@ void BKE_curvemapping_blend_read(BlendDataReader *reader, CurveMapping *cumap) /* ***************** Histogram **************** */ -#define INV_255 (1.f / 255.f) +#define INV_255 (1.0f / 255.0f) BLI_INLINE int get_bin_float(float f) { @@ -1570,8 +1570,8 @@ void BKE_scopes_update(Scopes *scopes, return; } - if (scopes->hist.ymax == 0.f) { - scopes->hist.ymax = 1.f; + if (scopes->hist.ymax == 0.0f) { + scopes->hist.ymax = 1.0f; } /* hmmmm */ diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index fef4b49de7e..c842ed3aa22 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -123,7 +123,7 @@ static int neighStraightY[8] = {0, 1, 0, -1, 1, 1, -1, -1}; /* paint effect default movement per frame in global units */ #define EFF_MOVEMENT_PER_FRAME 0.05f /* initial wave time factor */ -#define WAVE_TIME_FAC (1.0f / 24.f) +#define WAVE_TIME_FAC (1.0f / 24.0f) #define CANVAS_REL_SIZE 5.0f /* drying limits */ #define MIN_WETNESS 0.001f @@ -762,7 +762,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) sub_v3_v3v3(dim, grid->grid_bounds.max, grid->grid_bounds.min); copy_v3_v3(td, dim); copy_v3_v3(bData->dim, dim); - min_dim = max_fff(td[0], td[1], td[2]) / 1000.f; + min_dim = max_fff(td[0], td[1], td[2]) / 1000.0f; /* deactivate zero axises */ for (i = 0; i < 3; i++) { @@ -5116,7 +5116,7 @@ static void dynamic_paint_prepare_effect_cb(void *__restrict userdata, madd_v3_v3fl(forc, scene->physics_settings.gravity, surface->effector_weights->global_gravity * surface->effector_weights->weight[0] / - 10.f); + 10.0f); } /* add surface point velocity and acceleration if enabled */ diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index f51683ea351..f9d3fff1cec 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -699,8 +699,8 @@ int get_effector_data(EffectorCache *eff, copy_v3_v3(efd->loc, state.co); /* rather than use the velocity use rotated x-axis (defaults to velocity) */ - efd->nor[0] = 1.f; - efd->nor[1] = efd->nor[2] = 0.f; + efd->nor[0] = 1.0f; + efd->nor[1] = efd->nor[2] = 0.0f; mul_qt_v3(state.rot, efd->nor); if (real_velocity) { diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index af4b98e1c8d..f5bbccb2618 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1993,7 +1993,7 @@ static void sample_mesh(FluidFlowSettings *ffs, /* Convert xyz velocities flow settings from world to grid space. */ float convert_vel[3]; copy_v3_v3(convert_vel, ffs->vel_coord); - float time_mult = 1.0 / (25.f * DT_DEFAULT); + float time_mult = 1.0 / (25.0f * DT_DEFAULT); float size_mult = MAX3(base_res[0], base_res[1], base_res[2]) / MAX3(global_size[0], global_size[1], global_size[2]); mul_v3_v3fl(convert_vel, ffs->vel_coord, size_mult * time_mult); @@ -3293,7 +3293,7 @@ static Mesh *create_liquid_geometry(FluidDomainSettings *fds, Mesh *orgmesh, Obj /* If needed, vertex velocities will be read too. */ bool use_speedvectors = fds->flags & FLUID_DOMAIN_USE_SPEED_VECTORS; FluidDomainVertexVelocity *velarray = NULL; - float time_mult = 25.f * DT_DEFAULT; + float time_mult = 25.0f * DT_DEFAULT; if (use_speedvectors) { if (fds->mesh_velocities) { @@ -4430,7 +4430,7 @@ float BKE_fluid_get_velocity_at(struct Object *ob, float position[3], float velo if (fmd && (fmd->type & MOD_FLUID_TYPE_DOMAIN) && fmd->domain && fmd->domain->fluid) { FluidDomainSettings *fds = fmd->domain; - float time_mult = 25.f * DT_DEFAULT; + float time_mult = 25.0f * DT_DEFAULT; float size_mult = MAX3(fds->global_size[0], fds->global_size[1], fds->global_size[2]) / MAX3(fds->base_res[0], fds->base_res[1], fds->base_res[2]); float vel_mag; diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 39d6ee2700c..a1b01bce6c9 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -1392,7 +1392,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem mat4_to_size(original_size, obmat); size_to_mat4(size_mat, original_size); - xvec[0] = -1.f; + xvec[0] = -1.0f; xvec[1] = xvec[2] = 0; vec_to_quat(q, xvec, ob->trackflag, ob->upflag); quat_to_mat4(obmat, q); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 91cb7f81da2..108a43981a5 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1198,7 +1198,7 @@ static float interpolate_particle_value( value += w[3] * v4; } - CLAMP(value, 0.f, 1.f); + CLAMP(value, 0.0f, 1.0f); return value; } @@ -1427,7 +1427,7 @@ static void do_particle_interpolation(ParticleSystem *psys, PTCacheEditPoint *point = pind->epoint; ParticleKey keys[4]; int point_vel = (point && point->keys->vel); - float real_t, dfra, keytime, invdt = 1.f; + float real_t, dfra, keytime, invdt = 1.0f; /* billboards wont fill in all of these, so start cleared */ memset(keys, 0, sizeof(keys)); @@ -1597,7 +1597,7 @@ static void do_particle_interpolation(ParticleSystem *psys, /* Convert velocity to time-step size. */ if (pind->keyed || pind->cache || point_vel) { - invdt = dfra * 0.04f * (psys ? psys->part->timetweak : 1.f); + invdt = dfra * 0.04f * (psys ? psys->part->timetweak : 1.0f); mul_v3_fl(keys[1].vel, invdt); mul_v3_fl(keys[2].vel, invdt); interp_qt_qtqt(result->rot, keys[1].rot, keys[2].rot, keytime); @@ -1616,7 +1616,7 @@ static void do_particle_interpolation(ParticleSystem *psys, /* the velocity needs to be converted back from cubic interpolation */ if (pind->keyed || pind->cache || point_vel) { - mul_v3_fl(result->vel, 1.f / invdt); + mul_v3_fl(result->vel, 1.0f / invdt); } } @@ -2481,7 +2481,7 @@ int do_guides(Depsgraph *depsgraph, pd->kink_freq, pd->kink_shape, pd->kink_amp, - 0.f, + 0.0f, pd->kink, pd->kink_axis, 0, @@ -2831,12 +2831,12 @@ static void psys_thread_create_path(ParticleTask *task, if (ctx->between) { ParticleData *pa = psys->particles + cpa->pa[0]; int w, needupdate; - float foffset, wsum = 0.f; + float foffset, wsum = 0.0f; float co[3]; float p_min = part->parting_min; float p_max = part->parting_max; /* Virtual parents don't work nicely with parting. */ - float p_fac = part->parents > 0.f ? 0.f : part->parting_fac; + float p_fac = part->parents > 0.0f ? 0.0f : part->parting_fac; if (ctx->editupdate) { needupdate = 0; @@ -2864,15 +2864,15 @@ static void psys_thread_create_path(ParticleTask *task, } else { key[w] = pcache[0]; - weight[w] = 0.f; + weight[w] = 0.0f; } } /* modify weights to create parting */ - if (p_fac > 0.f) { + if (p_fac > 0.0f) { const ParticleCacheKey *key_0_last = pcache_key_segment_endpoint_safe(key[0]); for (w = 0; w < 4; w++) { - if (w && (weight[w] > 0.f)) { + if (w && (weight[w] > 0.0f)) { const ParticleCacheKey *key_w_last = pcache_key_segment_endpoint_safe(key[w]); float d; if (part->flag & PART_CHILD_LONG_HAIR) { @@ -2881,7 +2881,7 @@ static void psys_thread_create_path(ParticleTask *task, float d1 = len_v3v3(key[0]->co, key[w]->co); float d2 = len_v3v3(key_0_last->co, key_w_last->co); - d = d1 > 0.f ? d2 / d1 - 1.f : 10000.f; + d = d1 > 0.0f ? d2 / d1 - 1.0f : 10000.0f; } else { float v1[3], v2[3]; @@ -2897,13 +2897,13 @@ static void psys_thread_create_path(ParticleTask *task, d = (d - p_min) / (p_max - p_min); } else { - d = (d - p_min) <= 0.f ? 0.f : 1.f; + d = (d - p_min) <= 0.0f ? 0.0f : 1.0f; } - CLAMP(d, 0.f, 1.f); + CLAMP(d, 0.0f, 1.0f); - if (d > 0.f) { - weight[w] *= (1.f - d); + if (d > 0.0f) { + weight[w] *= (1.0f - d); } } wsum += weight[w]; @@ -3340,7 +3340,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re LOOP_PARTICLES { if (!psys->totchild) { - psys_get_texture(sim, pa, &ptex, PAMAP_LENGTH, 0.f); + psys_get_texture(sim, pa, &ptex, PAMAP_LENGTH, 0.0f); pa_length = ptex.length * (1.0f - part->randlength * psys_frand(psys, psys->seed + p)); if (vg_length) { pa_length *= psys_particle_value_from_verts(psmd->mesh_final, part->from, pa, vg_length); @@ -4273,9 +4273,9 @@ static void get_cpa_texture(Mesh *mesh, break; case TEXCO_PARTICLE: /* texture coordinates in range [-1, 1] */ - texvec[0] = 2.f * (cfra - par->time) / (par->dietime - par->time) - 1.f; - texvec[1] = 0.f; - texvec[2] = 0.f; + texvec[0] = 2.0f * (cfra - par->time) / (par->dietime - par->time) - 1.0f; + texvec[1] = 0.0f; + texvec[2] = 0.0f; break; } @@ -4383,14 +4383,15 @@ void psys_get_texture( break; case TEXCO_PARTICLE: /* texture coordinates in range [-1, 1] */ - texvec[0] = 2.f * (cfra - pa->time) / (pa->dietime - pa->time) - 1.f; + texvec[0] = 2.0f * (cfra - pa->time) / (pa->dietime - pa->time) - 1.0f; if (sim->psys->totpart > 0) { - texvec[1] = 2.f * (float)(pa - sim->psys->particles) / (float)sim->psys->totpart - 1.f; + texvec[1] = 2.0f * (float)(pa - sim->psys->particles) / (float)sim->psys->totpart - + 1.0f; } else { texvec[1] = 0.0f; } - texvec[2] = 0.f; + texvec[2] = 0.0f; break; } @@ -4935,8 +4936,8 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta else { float dfra, frs_sec = sim->scene->r.frs_sec; /* let's interpolate to try to be as accurate as possible */ - if (pa->state.time + 2.f >= state->time && pa->prev_state.time - 2.f <= state->time) { - if (pa->prev_state.time >= pa->state.time || pa->prev_state.time < 0.f) { + if (pa->state.time + 2.0f >= state->time && pa->prev_state.time - 2.0f <= state->time) { + if (pa->prev_state.time >= pa->state.time || pa->prev_state.time < 0.0f) { /* prev_state is wrong so let's not use it, * this can happen at frames 1, 0 or particle birth. */ dfra = state->time - pa->state.time; @@ -4963,13 +4964,13 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta psys_interpolate_particle(-1, keys, keytime, state, 1); /* convert back to real velocity */ - mul_v3_fl(state->vel, 1.f / (dfra * timestep)); + mul_v3_fl(state->vel, 1.0f / (dfra * timestep)); interp_v3_v3v3(state->ave, keys[1].ave, keys[2].ave, keytime); interp_qt_qtqt(state->rot, keys[1].rot, keys[2].rot, keytime); } } - else if (pa->state.time + 1.f >= state->time && pa->state.time - 1.f <= state->time) { + else if (pa->state.time + 1.0f >= state->time && pa->state.time - 1.0f <= state->time) { /* linear interpolation using only pa->state */ dfra = state->time - pa->state.time; diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c index 31332cd6d98..98a55c3de95 100644 --- a/source/blender/blenkernel/intern/particle_child.c +++ b/source/blender/blenkernel/intern/particle_child.c @@ -88,7 +88,7 @@ static void do_kink_spiral_deform(ParticleKey *state, { float result[3]; - CLAMP(time, 0.f, 1.f); + CLAMP(time, 0.0f, 1.0f); copy_v3_v3(result, state->co); @@ -426,21 +426,21 @@ void do_kink(ParticleKey *state, float obmat[4][4], int smooth_start) { - float kink[3] = {1.f, 0.f, 0.f}, par_vec[3], q1[4] = {1.f, 0.f, 0.f, 0.f}; - float t, dt = 1.f, result[3]; + float kink[3] = {1.0f, 0.0f, 0.0f}, par_vec[3], q1[4] = {1.0f, 0.0f, 0.0f, 0.0f}; + float t, dt = 1.0f, result[3]; if (ELEM(type, PART_KINK_NO, PART_KINK_SPIRAL)) { return; } - CLAMP(time, 0.f, 1.f); + CLAMP(time, 0.0f, 1.0f); if (shape != 0.0f && !ELEM(type, PART_KINK_BRAID)) { if (shape < 0.0f) { - time = (float)pow(time, 1.f + shape); + time = (float)pow(time, 1.0f + shape); } else { - time = (float)pow(time, 1.f / (1.f - shape)); + time = (float)pow(time, 1.0f / (1.0f - shape)); } } @@ -449,14 +449,14 @@ void do_kink(ParticleKey *state, if (smooth_start) { dt = fabsf(t); /* smooth the beginning of kink */ - CLAMP(dt, 0.f, (float)M_PI); - dt = sinf(dt / 2.f); + CLAMP(dt, 0.0f, (float)M_PI); + dt = sinf(dt / 2.0f); } if (!ELEM(type, PART_KINK_RADIAL)) { float temp[3]; - kink[axis] = 1.f; + kink[axis] = 1.0f; if (obmat) { mul_mat3_m4_v3(obmat, kink); @@ -487,7 +487,7 @@ void do_kink(ParticleKey *state, break; } case PART_KINK_RADIAL: { - if (flat > 0.f) { + if (flat > 0.0f) { float proj[3]; /* flatten along strand */ project_v3_v3v3(proj, par_vec, par_vel); @@ -500,7 +500,7 @@ void do_kink(ParticleKey *state, case PART_KINK_WAVE: { madd_v3_v3fl(result, kink, amplitude * sinf(t)); - if (flat > 0.f) { + if (flat > 0.0f) { float proj[3]; /* flatten along wave */ project_v3_v3v3(proj, par_vec, kink); @@ -513,8 +513,8 @@ void do_kink(ParticleKey *state, break; } case PART_KINK_BRAID: { - float y_vec[3] = {0.f, 1.f, 0.f}; - float z_vec[3] = {0.f, 0.f, 1.f}; + float y_vec[3] = {0.0f, 1.0f, 0.0f}; + float z_vec[3] = {0.0f, 0.0f, 1.0f}; float vec_one[3], state_co[3]; float inp_y, inp_z, length; @@ -533,21 +533,21 @@ void do_kink(ParticleKey *state, copy_v3_v3(state_co, y_vec); mul_v3_fl(y_vec, amplitude * cosf(t)); - mul_v3_fl(z_vec, amplitude / 2.f * sinf(2.f * t)); + mul_v3_fl(z_vec, amplitude / 2.0f * sinf(2.0f * t)); } else if (inp_z > 0.0f) { - mul_v3_v3fl(state_co, z_vec, sinf((float)M_PI / 3.f)); + mul_v3_v3fl(state_co, z_vec, sinf((float)M_PI / 3.0f)); madd_v3_v3fl(state_co, y_vec, -0.5f); - mul_v3_fl(y_vec, -amplitude * cosf(t + (float)M_PI / 3.f)); - mul_v3_fl(z_vec, amplitude / 2.f * cosf(2.f * t + (float)M_PI / 6.f)); + mul_v3_fl(y_vec, -amplitude * cosf(t + (float)M_PI / 3.0f)); + mul_v3_fl(z_vec, amplitude / 2.0f * cosf(2.0f * t + (float)M_PI / 6.0f)); } else { - mul_v3_v3fl(state_co, z_vec, -sinf((float)M_PI / 3.f)); + mul_v3_v3fl(state_co, z_vec, -sinf((float)M_PI / 3.0f)); madd_v3_v3fl(state_co, y_vec, -0.5f); - mul_v3_fl(y_vec, amplitude * -sinf(t + (float)M_PI / 6.f)); - mul_v3_fl(z_vec, amplitude / 2.f * -sinf(2.f * t + (float)M_PI / 3.f)); + mul_v3_fl(y_vec, amplitude * -sinf(t + (float)M_PI / 6.0f)); + mul_v3_fl(z_vec, amplitude / 2.0f * -sinf(2.0f * t + (float)M_PI / 3.0f)); } mul_v3_fl(state_co, amplitude); @@ -555,13 +555,13 @@ void do_kink(ParticleKey *state, sub_v3_v3v3(par_vec, state->co, state_co); length = normalize_v3(par_vec); - mul_v3_fl(par_vec, MIN2(length, amplitude / 2.f)); + mul_v3_fl(par_vec, MIN2(length, amplitude / 2.0f)); add_v3_v3v3(state_co, par_co, y_vec); add_v3_v3(state_co, z_vec); add_v3_v3(state_co, par_vec); - shape = 2.f * (float)M_PI * (1.f + shape); + shape = 2.0f * (float)M_PI * (1.0f + shape); if (t < shape) { shape = t / shape; @@ -576,7 +576,7 @@ void do_kink(ParticleKey *state, } /* blend the start of the kink */ - if (dt < 1.f) { + if (dt < 1.0f) { interp_v3_v3v3(state->co, state->co, result, dt); } else { @@ -881,8 +881,8 @@ void do_child_modifiers(const ParticleChildModifierContext *modifier_ctx, part->clump_noise_size, clumpcurve); - if (kink_freq != 0.f) { - kink_amp *= (1.f - kink_amp_clump * clump); + if (kink_freq != 0.0f) { + kink_amp *= (1.0f - kink_amp_clump * clump); do_kink(state, modifier_ctx->par_co, @@ -904,17 +904,17 @@ void do_child_modifiers(const ParticleChildModifierContext *modifier_ctx, do_rough_curve(modifier_ctx->orco, mat, t, rough1, part->rough1_size, roughcurve, state); } else { - if (rough1 > 0.f) { + if (rough1 > 0.0f) { do_rough(modifier_ctx->orco, mat, t, rough1, part->rough1_size, 0.0, state); } - if (rough2 > 0.f) { + if (rough2 > 0.0f) { float vec[3]; psys_frand_vec(sim->psys, i + 27, vec); do_rough(vec, mat, t, rough2, part->rough2_size, part->rough2_thres, state); } - if (rough_end > 0.f) { + if (rough_end > 0.0f) { float vec[3]; psys_frand_vec(sim->psys, i + 27, vec); do_rough_end(vec, mat, t, rough_end, part->rough_end_shape, state); diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c index d5999196b60..194593be4ff 100644 --- a/source/blender/blenkernel/intern/particle_distribute.c +++ b/source/blender/blenkernel/intern/particle_distribute.c @@ -150,9 +150,9 @@ static void distribute_grid(Mesh *mesh, ParticleSystem *psys) size[2] = MAX2(size[2], 1); /* no full offset for flat/thin objects */ - min[0] += d < delta[0] ? d / 2.f : delta[0] / 2.f; - min[1] += d < delta[1] ? d / 2.f : delta[1] / 2.f; - min[2] += d < delta[2] ? d / 2.f : delta[2] / 2.f; + min[0] += d < delta[0] ? d / 2.0f : delta[0] / 2.0f; + min[1] += d < delta[1] ? d / 2.0f : delta[1] / 2.0f; + min[2] += d < delta[2] ? d / 2.0f : delta[2] / 2.0f; for (i = 0, p = 0, pa = psys->particles; i < res; i++) { for (j = 0; j < res; j++) { @@ -220,7 +220,7 @@ static void distribute_grid(Mesh *mesh, ParticleSystem *psys) pa = psys->particles + a1 * a1mul + a2 * a2mul; copy_v3_v3(co1, pa->fuv); - co1[a] -= d < delta[a] ? d / 2.f : delta[a] / 2.f; + co1[a] -= d < delta[a] ? d / 2.0f : delta[a] / 2.0f; copy_v3_v3(co2, co1); co2[a] += delta[a] + 0.001f * d; co1[a] -= 0.001f * d; @@ -295,12 +295,12 @@ static void distribute_grid(Mesh *mesh, ParticleSystem *psys) for (j = 0; j < res; j++) { for (k = 0; k < res; k++, p++, pa++) { if (j % 2) { - pa->fuv[0] += d / 2.f; + pa->fuv[0] += d / 2.0f; } if (k % 2) { - pa->fuv[0] += d / 2.f; - pa->fuv[1] += d / 2.f; + pa->fuv[0] += d / 2.0f; + pa->fuv[1] += d / 2.0f; } } } @@ -318,7 +318,7 @@ static void distribute_grid(Mesh *mesh, ParticleSystem *psys) } } - if (psys->part->grid_rand > 0.f) { + if (psys->part->grid_rand > 0.0f) { float rfac = d * psys->part->grid_rand; for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) { if (pa->flag & PARS_UNEXIST) { @@ -1052,7 +1052,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, /* Calculate weights from face areas */ if ((part->flag & PART_EDISTR || children) && from != PART_FROM_VERT) { MVert *v1, *v2, *v3, *v4; - float totarea = 0.f, co1[3], co2[3], co3[3], co4[3]; + float totarea = 0.0f, co1[3], co2[3], co3[3], co4[3]; float(*orcodata)[3]; orcodata = CustomData_get_layer(&mesh->vdata, CD_ORCO); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 060a9b4d794..545f677e10a 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -574,7 +574,7 @@ static void init_particle_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleSettings *part = psys->part; ParticleTexture ptex; - psys_get_texture(sim, pa, &ptex, PAMAP_INIT, 0.f); + psys_get_texture(sim, pa, &ptex, PAMAP_INIT, 0.0f); switch (part->type) { case PART_EMITTER: @@ -587,7 +587,7 @@ static void init_particle_texture(ParticleSimulationData *sim, ParticleData *pa, if (ptex.exist < psys_frand(psys, p + 125)) { pa->flag |= PARS_UNEXIST; } - pa->time = 0.f; + pa->time = 0.0f; break; } } @@ -697,28 +697,28 @@ static void get_angular_velocity_vector(short avemode, ParticleKey *state, float case PART_AVE_HORIZONTAL: { float zvec[3]; zvec[0] = zvec[1] = 0; - zvec[2] = 1.f; + zvec[2] = 1.0f; cross_v3_v3v3(vec, state->vel, zvec); break; } case PART_AVE_VERTICAL: { float zvec[3], temp[3]; zvec[0] = zvec[1] = 0; - zvec[2] = 1.f; + zvec[2] = 1.0f; cross_v3_v3v3(temp, state->vel, zvec); cross_v3_v3v3(vec, temp, state->vel); break; } case PART_AVE_GLOBAL_X: - vec[0] = 1.f; + vec[0] = 1.0f; vec[1] = vec[2] = 0; break; case PART_AVE_GLOBAL_Y: - vec[1] = 1.f; + vec[1] = 1.0f; vec[0] = vec[2] = 0; break; case PART_AVE_GLOBAL_Z: - vec[2] = 1.f; + vec[2] = 1.0f; vec[0] = vec[1] = 0; break; } @@ -864,36 +864,36 @@ void psys_get_birth_coords( /* -velocity from: */ /* *reactions */ - if (dtime > 0.f) { + if (dtime > 0.0f) { sub_v3_v3v3(vel, pa->state.vel, pa->prev_state.vel); } /* *emitter velocity */ - if (dtime != 0.f && part->obfac != 0.f) { + if (dtime != 0.0f && part->obfac != 0.0f) { sub_v3_v3v3(vel, loc, state->co); mul_v3_fl(vel, part->obfac / dtime); } /* *emitter normal */ - if (part->normfac != 0.f) { + if (part->normfac != 0.0f) { madd_v3_v3fl(vel, nor, part->normfac); } /* *emitter tangent */ - if (sim->psmd && part->tanfac != 0.f) { + if (sim->psmd && part->tanfac != 0.0f) { madd_v3_v3fl(vel, vtan, part->tanfac); } /* *emitter object orientation */ - if (part->ob_vel[0] != 0.f) { + if (part->ob_vel[0] != 0.0f) { normalize_v3_v3(vec, ob->obmat[0]); madd_v3_v3fl(vel, vec, part->ob_vel[0]); } - if (part->ob_vel[1] != 0.f) { + if (part->ob_vel[1] != 0.0f) { normalize_v3_v3(vec, ob->obmat[1]); madd_v3_v3fl(vel, vec, part->ob_vel[1]); } - if (part->ob_vel[2] != 0.f) { + if (part->ob_vel[2] != 0.0f) { normalize_v3_v3(vec, ob->obmat[2]); madd_v3_v3fl(vel, vec, part->ob_vel[2]); } @@ -902,12 +902,12 @@ void psys_get_birth_coords( /* TODO */ /* *random */ - if (part->randfac != 0.f) { + if (part->randfac != 0.0f) { madd_v3_v3fl(vel, r_vel, part->randfac); } /* *particle */ - if (part->partfac != 0.f) { + if (part->partfac != 0.0f) { madd_v3_v3fl(vel, p_vel, part->partfac); } @@ -1077,7 +1077,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, part = psys->part; /* get precise emitter matrix if particle is born */ - if (part->type != PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) { + if (part->type != PART_HAIR && dtime > 0.0f && pa->time < cfra && pa->time >= sim->psys->cfra) { evaluate_emitter_anim(sim->depsgraph, sim->scene, sim->ob, pa->time); psys->flag |= PSYS_OB_ANIM_RESTORE; @@ -1427,7 +1427,7 @@ static void integrate_particle( copy_v3_v3(oldpos, pa->state.co); /* Verlet integration behaves strangely with moving emitters, so do first step with euler. */ - if (pa->prev_state.time < 0.f && integrator == PART_INT_VERLET) { + if (pa->prev_state.time < 0.0f && integrator == PART_INT_VERLET) { integrator = PART_INT_EULER; } @@ -1450,7 +1450,7 @@ static void integrate_particle( copy_particle_key(states + i, &pa->state, 1); } - states->time = 0.f; + states->time = 0.0f; for (i = 0; i < steps; i++) { zero_v3(force); @@ -1611,9 +1611,9 @@ static void sph_springs_modify(ParticleSystem *psys, float dtime) float yield_ratio = fluid->yield_ratio; float plasticity = fluid->plasticity_constant; /* scale things according to dtime */ - float timefix = 25.f * dtime; + float timefix = 25.0f * dtime; - if ((fluid->flag & SPH_VISCOELASTIC_SPRINGS) == 0 || fluid->spring_k == 0.f) { + if ((fluid->flag & SPH_VISCOELASTIC_SPRINGS) == 0 || fluid->spring_k == 0.0f) { return; } @@ -1636,7 +1636,7 @@ static void sph_springs_modify(ParticleSystem *psys, float dtime) spring->rest_length -= plasticity * (Lij - d - rij) * timefix; } - h = 4.f * pa1->size; + h = 4.0f * pa1->size; if (spring->rest_length > h) { spring->delete_flag = 1; @@ -1743,7 +1743,7 @@ static void sph_density_accum_cb(void *userdata, int index, const float co[3], f pfr->tot_neighbors++; dist = sqrtf(squared_dist); - q = (1.f - dist / pfr->h) * pfr->massfac; + q = (1.0f - dist / pfr->h) * pfr->massfac; if (pfr->use_size) { q *= npa->size; @@ -1799,7 +1799,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa float visc = fluid->viscosity_omega; float stiff_visc = fluid->viscosity_beta * - (fluid->flag & SPH_FAC_VISCOSITY ? fluid->viscosity_omega : 1.f); + (fluid->flag & SPH_FAC_VISCOSITY ? fluid->viscosity_omega : 1.0f); float inv_mass = 1.0f / sphdata->mass; float spring_constant = fluid->spring_k; @@ -1809,13 +1809,13 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa (fluid->flag & SPH_FAC_RADIUS ? 4.0f * pa->size : 1.0f); float h = interaction_radius * sphdata->hfac; /* 4.77 is an experimentally determined density factor */ - float rest_density = fluid->rest_density * (fluid->flag & SPH_FAC_DENSITY ? 4.77f : 1.f); + float rest_density = fluid->rest_density * (fluid->flag & SPH_FAC_DENSITY ? 4.77f : 1.0f); float rest_length = fluid->rest_length * - (fluid->flag & SPH_FAC_REST_LENGTH ? 2.588f * pa->size : 1.f); + (fluid->flag & SPH_FAC_REST_LENGTH ? 2.588f * pa->size : 1.0f); float stiffness = fluid->stiffness_k; float stiffness_near_fac = fluid->stiffness_knear * - (fluid->flag & SPH_FAC_REPULSION ? fluid->stiffness_k : 1.f); + (fluid->flag & SPH_FAC_REPULSION ? fluid->stiffness_k : 1.0f); ParticleData *npa; float vec[3]; @@ -1849,7 +1849,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa sub_v3_v3v3(vec, co, state->co); rij = normalize_v3(vec); - q = (1.f - rij / h) * pfn->psys->part->mass * inv_mass; + q = (1.0f - rij / h) * pfn->psys->part->mass * inv_mass; if (pfn->psys->part->flag & PART_SIZEMASS) { q *= npa->size; @@ -1861,20 +1861,20 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa madd_v3_v3fl(force, vec, -(pressure + near_pressure * q) * q); /* Viscosity */ - if (visc > 0.f || stiff_visc > 0.f) { + if (visc > 0.0f || stiff_visc > 0.0f) { sub_v3_v3v3(dv, vel, state->vel); u = dot_v3v3(vec, dv); - if (u < 0.f && visc > 0.f) { + if (u < 0.0f && visc > 0.0f) { madd_v3_v3fl(force, vec, 0.5f * q * visc * u); } - if (u > 0.f && stiff_visc > 0.f) { + if (u > 0.0f && stiff_visc > 0.0f) { madd_v3_v3fl(force, vec, 0.5f * q * stiff_visc * u); } } - if (spring_constant > 0.f) { + if (spring_constant > 0.0f) { /* Viscoelastic spring force */ if (pfn->psys == psys[0] && fluid->flag & SPH_VISCOELASTIC_SPRINGS && springhash) { /* BLI_edgehash_lookup appears to be thread-safe. - z0r */ @@ -1883,8 +1883,9 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa if (spring_index) { spring = psys[0]->fluid_springs + spring_index - 1; - madd_v3_v3fl( - force, vec, -10.f * spring_constant * (1.f - rij / h) * (spring->rest_length - rij)); + madd_v3_v3fl(force, + vec, + -10.0f * spring_constant * (1.0f - rij / h) * (spring->rest_length - rij)); } else if (fluid->spring_frames == 0 || (pa->prev_state.time - pa->time) <= fluid->spring_frames) { @@ -1898,13 +1899,14 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa } } else { /* PART_SPRING_HOOKES - Hooke's spring force */ - madd_v3_v3fl(force, vec, -10.f * spring_constant * (1.f - rij / h) * (rest_length - rij)); + madd_v3_v3fl( + force, vec, -10.0f * spring_constant * (1.0f - rij / h) * (rest_length - rij)); } } } /* Artificial buoyancy force in negative gravity direction */ - if (fluid->buoyancy > 0.f && gravity) { + if (fluid->buoyancy > 0.0f && gravity) { madd_v3_v3fl(force, gravity, fluid->buoyancy * (density - rest_density)); } @@ -1922,7 +1924,7 @@ static void sphclassical_density_accum_cb(void *userdata, SPHRangeData *pfr = (SPHRangeData *)userdata; ParticleData *npa = pfr->npsys->particles + index; float q; - float qfac = 21.0f / (256.f * (float)M_PI); + float qfac = 21.0f / (256.0f * (float)M_PI); float rij, rij_h; float vec[3]; @@ -2079,7 +2081,7 @@ static void sphclassical_force_cb(void *sphdata_v, } /* Artificial buoyancy force in negative gravity direction */ - if (fluid->buoyancy > 0.f && gravity) { + if (fluid->buoyancy > 0.0f && gravity) { madd_v3_v3fl(force, gravity, fluid->buoyancy * (pa->sphdensity - rest_density)); } @@ -2199,7 +2201,7 @@ static void sph_integrate(ParticleSimulationData *sim, { ParticleSettings *part = sim->psys->part; // float timestep = psys_get_timestep(sim); // UNUSED - float pa_mass = part->mass * (part->flag & PART_SIZEMASS ? pa->size : 1.f); + float pa_mass = part->mass * (part->flag & PART_SIZEMASS ? pa->size : 1.0f); float dtime = dfra * psys_get_timestep(sim); // int steps = 1; // UNUSED float effector_acceleration[3]; @@ -2211,7 +2213,7 @@ static void sph_integrate(ParticleSimulationData *sim, /* restore previous state and treat gravity & effectors as external acceleration*/ sub_v3_v3v3(effector_acceleration, pa->state.vel, pa->prev_state.vel); - mul_v3_fl(effector_acceleration, 1.f / dtime); + mul_v3_fl(effector_acceleration, 1.0f / dtime); copy_particle_key(&pa->state, &pa->prev_state, 0); @@ -2300,8 +2302,8 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa integrate_particle(part, pa, dtime, gravity, basic_force_cb, &efdata); /* damp affects final velocity */ - if (part->dampfac != 0.f) { - mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp * 25.f * dtime); + if (part->dampfac != 0.0f) { + mul_v3_fl(pa->state.vel, 1.0f - part->dampfac * efdata.ptex.damp * 25.0f * dtime); } // copy_v3_v3(pa->state.ave, states->ave); @@ -2406,7 +2408,7 @@ static float nr_signed_distance_to_plane(float *p, d = dot_v3v3(p0, nor); if (pce->inv_nor == -1) { - if (d < 0.f) { + if (d < 0.0f) { pce->inv_nor = 1; } else { @@ -2452,7 +2454,7 @@ static void collision_interpolate_element(ParticleCollisionElement *pce, /* fac is the starting factor for current collision iteration */ /* The col->fac's are factors for the particle subframe step start * and end during collision modifier step. */ - float f = fac + t * (1.f - fac); + float f = fac + t * (1.0f - fac); float mul = col->fac1 + f * (col->fac2 - col->fac1); if (pce->tot > 0) { madd_v3_v3v3fl(pce->x0, pce->x[0], pce->v[0], mul); @@ -2485,8 +2487,8 @@ static void collision_point_velocity(ParticleCollisionElement *pce) static float collision_point_distance_with_normal( float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *nor) { - if (fac >= 0.f) { - collision_interpolate_element(pce, 0.f, fac, col); + if (fac >= 0.0f) { + collision_interpolate_element(pce, 0.0f, fac, col); } switch (pce->tot) { @@ -2504,14 +2506,14 @@ static float collision_point_distance_with_normal( return normalize_v3(nor); } case 3: - return nr_signed_distance_to_plane(p, 0.f, pce, nor); + return nr_signed_distance_to_plane(p, 0.0f, pce, nor); } return 0; } static void collision_point_on_surface( const float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *co) { - collision_interpolate_element(pce, 0.f, fac, col); + collision_interpolate_element(pce, 0.0f, fac, col); switch (pce->tot) { case 1: { @@ -2575,11 +2577,11 @@ static float collision_newton_rhapson(ParticleCollision *col, } /* start from the beginning */ - t0 = 0.f; + t0 = 0.0f; collision_interpolate_element(pce, t0, col->f, col); d0 = distance_func(col->co1, radius, pce, n); t1 = dt_init; - d1 = 0.f; + d1 = 0.0f; for (iter = 0; iter < 10; iter++) { //, itersum++) { /* get current location */ @@ -2589,11 +2591,11 @@ static float collision_newton_rhapson(ParticleCollision *col, d1 = distance_func(pce->p, radius, pce, n); /* particle already inside face, so report collision */ - if (iter == 0 && d0 < 0.f && d0 > -radius) { + if (iter == 0 && d0 < 0.0f && d0 > -radius) { copy_v3_v3(pce->p, col->co1); copy_v3_v3(pce->nor, n); pce->inside = 1; - return 0.f; + return 0.0f; } /* Zero gradient (no movement relative to element). Can't step from @@ -2602,15 +2604,15 @@ static float collision_newton_rhapson(ParticleCollision *col, /* If first iteration, try from other end where the gradient may be * greater. Note: code duplicated below. */ if (iter == 0) { - t0 = 1.f; + t0 = 1.0f; collision_interpolate_element(pce, t0, col->f, col); d0 = distance_func(col->co2, radius, pce, n); t1 = 1.0f - dt_init; - d1 = 0.f; + d1 = 0.0f; continue; } - return -1.f; + return -1.0f; } dd = (t1 - t0) / (d1 - d0); @@ -2622,30 +2624,30 @@ static float collision_newton_rhapson(ParticleCollision *col, /* Particle moving away from plane could also mean a strangely rotating * face, so check from end. Note: code duplicated above. */ - if (iter == 0 && t1 < 0.f) { - t0 = 1.f; + if (iter == 0 && t1 < 0.0f) { + t0 = 1.0f; collision_interpolate_element(pce, t0, col->f, col); d0 = distance_func(col->co2, radius, pce, n); t1 = 1.0f - dt_init; - d1 = 0.f; + d1 = 0.0f; continue; } - if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.f)) { - return -1.f; + if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.0f)) { + return -1.0f; } if (d1 <= COLLISION_ZERO && d1 >= -COLLISION_ZERO) { - if (t1 >= -COLLISION_ZERO && t1 <= 1.f) { + if (t1 >= -COLLISION_ZERO && t1 <= 1.0f) { if (distance_func == nr_signed_distance_to_plane) { copy_v3_v3(pce->nor, n); } - CLAMP(t1, 0.f, 1.f); + CLAMP(t1, 0.0f, 1.0f); return t1; } - return -1.f; + return -1.0f; } } return -1.0; @@ -2663,7 +2665,7 @@ static int collision_sphere_to_tri(ParticleCollision *col, ct = collision_newton_rhapson(col, radius, pce, nr_signed_distance_to_plane); - if (ct >= 0.f && ct < *t && (result->inside == 0 || pce->inside == 1)) { + if (ct >= 0.0f && ct < *t && (result->inside == 0 || pce->inside == 1)) { float e1[3], e2[3], p0[3]; float e1e1, e1e2, e1p0, e2e2, e2p0, inv; @@ -2678,11 +2680,11 @@ static int collision_sphere_to_tri(ParticleCollision *col, e2e2 = dot_v3v3(e2, e2); e2p0 = dot_v3v3(e2, p0); - inv = 1.f / (e1e1 * e2e2 - e1e2 * e1e2); + inv = 1.0f / (e1e1 * e2e2 - e1e2 * e1e2); u = (e2e2 * e1p0 - e1e2 * e2p0) * inv; v = (e1e1 * e2p0 - e1e2 * e1p0) * inv; - if (u >= 0.f && u <= 1.f && v >= 0.f && u + v <= 1.f) { + if (u >= 0.0f && u <= 1.0f && v >= 0.0f && u + v <= 1.0f) { *result = *pce; /* normal already calculated in pce */ @@ -2718,14 +2720,14 @@ static int collision_sphere_to_edges(ParticleCollision *col, ct = collision_newton_rhapson(col, radius, cur, nr_distance_to_edge); - if (ct >= 0.f && ct < *t) { + if (ct >= 0.0f && ct < *t) { float u, e[3], vec[3]; sub_v3_v3v3(e, cur->x1, cur->x0); sub_v3_v3v3(vec, cur->p, cur->x0); u = dot_v3v3(vec, e) / dot_v3v3(e, e); - if (u < 0.f || u > 1.f) { + if (u < 0.0f || u > 1.0f) { break; } @@ -2763,7 +2765,7 @@ static int collision_sphere_to_verts(ParticleCollision *col, ct = collision_newton_rhapson(col, radius, cur, nr_distance_to_vert); - if (ct >= 0.f && ct < *t) { + if (ct >= 0.0f && ct < *t) { *result = *cur; sub_v3_v3v3(result->nor, cur->p, cur->x0); @@ -3019,7 +3021,7 @@ static int collision_response(ParticleSimulationData *sim, (vc_dot < 0.0f && v0_dot < 0.0f && vc_dot < v0_dot))) { mul_v3_v3fl(v0_nor, pce->nor, vc_dot); } - else if (v0_dot > 0.f) { + else if (v0_dot > 0.0f) { mul_v3_v3fl(v0_nor, pce->nor, vc_dot + v0_dot); } else { @@ -3045,25 +3047,25 @@ static int collision_response(ParticleSimulationData *sim, /* make sure particle stays on the right side of the surface */ if (!through) { - distance = collision_point_distance_with_normal(co, pce, -1.f, col, nor); + distance = collision_point_distance_with_normal(co, pce, -1.0f, col, nor); if (distance < col->radius + COLLISION_MIN_DISTANCE) { madd_v3_v3fl(co, nor, col->radius + COLLISION_MIN_DISTANCE - distance); } dot = dot_v3v3(nor, v0); - if (dot < 0.f) { + if (dot < 0.0f) { madd_v3_v3fl(v0, nor, -dot); } - distance = collision_point_distance_with_normal(pa->state.co, pce, 1.f, col, nor); + distance = collision_point_distance_with_normal(pa->state.co, pce, 1.0f, col, nor); if (distance < col->radius + COLLISION_MIN_DISTANCE) { madd_v3_v3fl(pa->state.co, nor, col->radius + COLLISION_MIN_DISTANCE - distance); } dot = dot_v3v3(nor, pa->state.vel); - if (dot < 0.f) { + if (dot < 0.0f) { madd_v3_v3fl(pa->state.vel, nor, -dot); } } @@ -3090,7 +3092,7 @@ static int collision_response(ParticleSimulationData *sim, static void collision_fail(ParticleData *pa, ParticleCollision *col) { /* final chance to prevent total failure, so stick to the surface and hope for the best */ - collision_point_on_surface(col->co1, &col->pce, 1.f, col, pa->state.co); + collision_point_on_surface(col->co1, &col->pce, 1.0f, col, pa->state.co); copy_v3_v3(pa->state.vel, col->pce.vel); mul_v3_fl(pa->state.vel, col->inv_timestep); @@ -3128,7 +3130,7 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa /* get acceleration (from gravity, forcefields etc. to be re-applied in collision response) */ sub_v3_v3v3(col.acc, pa->state.vel, pa->prev_state.vel); - mul_v3_fl(col.acc, 1.f / col.total_time); + mul_v3_fl(col.acc, 1.0f / col.total_time); /* set values for first iteration */ copy_v3_v3(col.co1, pa->prev_state.co); @@ -3925,7 +3927,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) if (ELEM(pa->alive, PARS_ALIVE, PARS_DYING) == 0 || (pa->flag & (PARS_UNEXIST | PARS_NO_DISP))) { - pa->state.time = -1.f; + pa->state.time = -1.0f; } } @@ -4410,7 +4412,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, zero_v3(pa->state.ave); unit_qt(pa->state.rot); - pa->time = 1.f; + pa->time = 1.0f; pa->dietime = sim->scene->r.efra + 1; pa->lifetime = sim->scene->r.efra; pa->alive = PARS_ALIVE; @@ -4590,8 +4592,8 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_ dt_frac = psys->dt_frac; for (t_frac = dt_frac; t_frac <= 1.0f; t_frac += dt_frac) { sim->courant_num = 0.0f; - dynamics_step(sim, cfra + dframe + t_frac - 1.f); - psys->cfra = cfra + dframe + t_frac - 1.f; + dynamics_step(sim, cfra + dframe + t_frac - 1.0f); + psys->cfra = cfra + dframe + t_frac - 1.0f; if (part->time_flag & PART_TIME_AUTOSF) { update_timestep(psys, sim); @@ -4692,17 +4694,17 @@ void BKE_particlesettings_fluid_default_settings(ParticleSettings *part) { SPHFluidSettings *fluid = part->fluid; - fluid->spring_k = 0.f; + fluid->spring_k = 0.0f; fluid->plasticity_constant = 0.1f; fluid->yield_ratio = 0.1f; - fluid->rest_length = 1.f; - fluid->viscosity_omega = 2.f; + fluid->rest_length = 1.0f; + fluid->viscosity_omega = 2.0f; fluid->viscosity_beta = 0.1f; - fluid->stiffness_k = 1.f; - fluid->stiffness_knear = 1.f; - fluid->rest_density = 1.f; - fluid->buoyancy = 0.f; - fluid->radius = 1.f; + fluid->stiffness_k = 1.0f; + fluid->stiffness_knear = 1.0f; + fluid->rest_density = 1.0f; + fluid->buoyancy = 0.0f; + fluid->radius = 1.0f; fluid->flag |= SPH_FAC_REPULSION | SPH_FAC_DENSITY | SPH_FAC_RADIUS | SPH_FAC_VISCOSITY | SPH_FAC_REST_LENGTH; } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 415250b184b..44de92de04a 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -462,7 +462,7 @@ static void ptcache_particle_interpolate(int index, psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, &pa->state, 1); interp_qt_qtqt(pa->state.rot, keys[1].rot, keys[2].rot, (cfra - cfra1) / dfra); - mul_v3_fl(pa->state.vel, 1.f / (dfra * timestep)); + mul_v3_fl(pa->state.vel, 1.0f / (dfra * timestep)); pa->state.time = cfra; } diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index bf61c27ee2f..c2fc245ce41 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1063,7 +1063,7 @@ static int sb_detect_face_pointCached(const float face_v1[3], GHash *hash; GHashIterator *ihash; float nv1[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3]; - float facedist, outerfacethickness, tune = 10.f; + float facedist, outerfacethickness, tune = 10.0f; int a, deflected = 0; aabbmin[0] = min_fff(face_v1[0], face_v2[0], face_v3[0]); @@ -2797,8 +2797,8 @@ static void reference_to_scratch(Object *ob) SoftBody *sb = ob->soft; ReferenceVert *rp; BodyPoint *bp; - float accu_pos[3] = {0.f, 0.f, 0.f}; - float accu_mass = 0.f; + float accu_pos[3] = {0.0f, 0.0f, 0.0f}; + float accu_mass = 0.0f; int a; sb->scratch->Ref.ivert = MEM_mallocN(sizeof(ReferenceVert) * sb->totpoint, "SB_Reference"); -- cgit v1.2.3