diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 08:28:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 08:30:39 +0300 |
commit | 7d2d2ffa76647871836f779f013c99e474228f3d (patch) | |
tree | c44bd244955fde84571d1405ebf29df6b143ddf0 /source/blender/blenkernel/intern | |
parent | 8ebc6be43ddf5a4c28b848c62d09f9435dd1bffe (diff) |
Cleanup: spelling
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 29 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 18 |
2 files changed, 25 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 2344ebfa81b..81c7c700cc2 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1301,7 +1301,7 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata, } } - /* Get distance to mesh surface from both within and outside grid (mantaflow phi grid) */ + /* Get distance to mesh surface from both within and outside grid (mantaflow phi grid). */ if (data->distances_map) { update_mesh_distances(index, data->distances_map, @@ -1310,8 +1310,8 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata, data->mes->surface_distance, data->mes->flags & FLUID_FLOW_USE_PLANE_INIT); - /* Ensure that num objects are also counted inside object. But dont count twice (see object - * inc for nearest point) */ + /* Ensure that num objects are also counted inside object. + * But don't count twice (see object inc for nearest point). */ if (data->distances_map[index] < 0 && !has_inc_obj) { data->num_objects[index]++; } @@ -1579,7 +1579,7 @@ static void update_obstacles(Depsgraph *depsgraph, scene->r.subframe); # endif /* TODO (sebbas): Using BKE_scene_frame_get(scene) instead of new DEG_get_ctime(depsgraph) as - * subframes dont work with the latter yet. */ + * subframes don't work with the latter yet. */ BKE_object_modifier_update_subframe( depsgraph, scene, coll_ob, true, 5, BKE_scene_frame_get(scene), eModifierType_Fluid); @@ -2125,8 +2125,8 @@ static void emit_from_particles(Object *flow_ob, else if (valid_particles > 0) { // FLUID_FLOW_USE_PART_SIZE int min[3], max[3], res[3]; const float hr = 1.0f / ((float)hires_multiplier); - /* slightly adjust high res antialias smoothness based on number of divisions - * to allow smaller details but yet not differing too much from the low res size */ + /* Slightly adjust high res anti-alias smoothness based on number of divisions + * to allow smaller details but yet not differing too much from the low res size. */ const float hr_smooth = smooth * powf(hr, 1.0f / 3.0f); /* setup loop bounds */ @@ -2201,8 +2201,8 @@ static void update_mesh_distances(int index, return; } - /* First pass: Raycasts in 26 directions (6 main axis + 12 quadrant diagonals (2D) + 8 octant - * diagonals (3D)). */ + /* First pass: Ray-casts in 26 directions + * (6 main axis + 12 quadrant diagonals (2D) + 8 octant diagonals (3D)). */ float ray_dirs[26][3] = { {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, 0.0f}, {0.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f, 0.0f}, {1.0f, -1.0f, 0.0f}, @@ -2257,7 +2257,7 @@ static void update_mesh_distances(int index, /* Update global distance array but ensure that older entries are not overridden. */ mesh_distances[index] = MIN2(mesh_distances[index], min_dist); - /* Second pass: Use nearest neighbour search on mesh surface. */ + /* Second pass: Use nearest neighbor search on mesh surface. */ BVHTreeNearest nearest = {0}; nearest.index = -1; nearest.dist_sq = 5; @@ -2285,7 +2285,7 @@ static void update_mesh_distances(int index, min_dist = (-1.0f) * fabsf(min_dist); } - /* Update distance value with more accurate one from this nearest neighbour search. + /* Update distance value with more accurate one from this nearest neighbor search. * Skip if new value would be outside and current value has inside value already. */ if (!(min_dist > 0 && mesh_distances[index] <= 0)) { mesh_distances[index] = min_dist; @@ -3055,8 +3055,8 @@ BLI_INLINE void apply_inflow_fields(FluidFlowSettings *mfs, if (heat && heat_in) { if (emission_value > 0.0f) { heat_in[index] = ADD_IF_LOWER(heat[index], mfs->temperature); - /* Scale inflow by dt/framelength. This is to ensure that adaptive steps don't apply too much - * emission. */ + /* Scale inflow by dt/frame-length. + * This is to ensure that adaptive steps don't apply too much emission. */ } else { heat_in[index] = heat[index]; @@ -3112,8 +3112,7 @@ BLI_INLINE void apply_inflow_fields(FluidFlowSettings *mfs, /* set fire reaction coordinate */ if (fuel && fuel_in) { - /* instead of using 1.0 for all new fuel add slight falloff - * to reduce flow blockiness */ + /* Instead of using 1.0 for all new fuel add slight falloff to reduce flow blocky-ness. */ float value = 1.0f - pow2f(1.0f - emission_value); if (fuel[index] > FLT_EPSILON && value > react[index]) { @@ -3327,7 +3326,7 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, /* Update frame time, this is considering current subframe fraction * BLI_mutex_lock() called in manta_step(), so safe to update subframe here * TODO (sebbas): Using BKE_scene_frame_get(scene) instead of new DEG_get_ctime(depsgraph) - * as subframes dont work with the latter yet */ + * as subframes don't work with the latter yet */ BKE_object_modifier_update_subframe( depsgraph, scene, flowobj, true, 5, BKE_scene_frame_get(scene), eModifierType_Fluid); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index d4a61c83911..41ca44fbcd9 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4288,8 +4288,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, printf("system type is %d and particle type is %d\n", part->type, flagActivePart); # endif - /* Type of particle must matche current particle system type (only important for snd - * particles). */ + /* Type of particle must match current particle system type + * (only important for snd particles). */ if ((flagActivePart & PARTICLE_TYPE_SPRAY) && (part->type & PART_FLUID_SPRAY) == 0) { continue; } @@ -4306,7 +4306,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, /* Debugging: Print type of particle system and current particles. */ printf("system type is %d and particle type is %d\n", part->type, flagActivePart); # endif - /* Particle system has allocated tottypeparts particles - so break early before exceeded. + /* Particle system has allocated 'tottypepart' particles - so break early before exceeded. */ if (activeParts >= tottypepart) { break; @@ -4330,7 +4330,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, madd_v3fl_v3fl_v3fl_v3i(max, mds->p0, cell_size_scaled, mds->res_max); sub_v3_v3v3(size, max, min); - /* Biggest dimension will be used for upscaling. */ + /* Biggest dimension will be used for up-scaling. */ max_size = MAX3(size[0] / (float)upres, size[1] / (float)upres, size[2] / (float)upres); /* Set particle position. */ @@ -4418,12 +4418,16 @@ static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNU return totpart - oldtotpart; } -/* Calculates the next state for all particles of the system - * In particles code most fra-ending are frames, time-ending are fra*timestep (seconds) +/** + * Calculates the next state for all particles of the system. + * In particles code most 'cfra - ending' are frames, + * 'time - ending' are 'cfra * timestep' (seconds). + * * 1. Emit particles * 2. Check cache (if used) and return if frame is cached * 3. Do dynamics - * 4. Save to cache */ + * 4. Save to cache + */ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_render_params) { ParticleSystem *psys = sim->psys; |