diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-08 02:28:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-08 02:37:43 +0300 |
commit | 91a155833e59275089641b63ae9271672ac17713 (patch) | |
tree | 8057253d80b84de168b96f45ae5e5063d6e8f0fa /source/blender/blenkernel/intern | |
parent | 3d2ff33c261593d5211456500e8a212fb6a2ce82 (diff) |
Cleanup: comments causing bad clang-format output
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 33 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 39 |
2 files changed, 48 insertions, 24 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 42b187ec57f..8ce43049265 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1144,7 +1144,8 @@ static void copy_object_pose(Object *obn, const Object *ob, const int flag) { bPoseChannel *chan; - /* note: need to clear obn->pose pointer first, so that BKE_pose_copy_data works (otherwise there's a crash) */ + /* note: need to clear obn->pose pointer first, + * so that BKE_pose_copy_data works (otherwise there's a crash) */ obn->pose = NULL; BKE_pose_copy_data_ex(&obn->pose, ob->pose, flag, true); /* true = copy constraints */ @@ -1626,7 +1627,8 @@ void BKE_object_make_proxy(Main *bmain, Object *ob, Object *target, Object *cob) ob->mat = MEM_dupallocN(target->mat); ob->matbits = MEM_dupallocN(target->matbits); for (i = 0; i < target->totcol; i++) { - /* don't need to run test_object_materials since we know this object is new and not used elsewhere */ + /* don't need to run test_object_materials + * since we know this object is new and not used elsewhere */ id_us_plus((ID *)ob->mat[i]); } } @@ -2788,15 +2790,24 @@ void BKE_scene_foreach_display_point( /* copied from DNA_object_types.h */ typedef struct ObTfmBack { float loc[3], dloc[3], orig[3]; - float size[3], dscale[3]; /* scale and delta scale */ - float rot[3], drot[3]; /* euler rotation */ - float quat[4], dquat[4]; /* quaternion rotation */ - float rotAxis[3], drotAxis[3]; /* axis angle rotation - axis part */ - float rotAngle, drotAngle; /* axis angle rotation - angle part */ - float obmat[4][4]; /* final worldspace matrix with constraints & animsys applied */ - float parentinv[4][4]; /* inverse result of parent, so that object doesn't 'stick' to parent */ - float constinv[4][4]; /* inverse result of constraints. doesn't include effect of parent or object local transform */ - float imat[4][4]; /* inverse matrix of 'obmat' for during render, temporally: ipokeys of transform */ + /** scale and delta scale. */ + float size[3], dscale[3]; + /** euler rotation. */ + float rot[3], drot[3]; + /** quaternion rotation. */ + float quat[4], dquat[4]; + /** axis angle rotation - axis part. */ + float rotAxis[3], drotAxis[3]; + /** axis angle rotation - angle part. */ + float rotAngle, drotAngle; + /** final worldspace matrix with constraints & animsys applied. */ + float obmat[4][4]; + /** inverse result of parent, so that object doesn't 'stick' to parent. */ + float parentinv[4][4]; + /** inverse result of constraints. doesn't include effect of parent or object local transform. */ + float constinv[4][4]; + /** inverse matrix of 'obmat' for during render, temporally: ipokeys of transform. */ + float imat[4][4]; } ObTfmBack; void *BKE_object_tfm_backup(Object *ob) diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 8d09215c564..86d2ceddced 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1688,7 +1688,8 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa /* 4.0 seems to be a pretty good value */ float interaction_radius = fluid->radius * (fluid->flag & SPH_FAC_RADIUS ? 4.0f * pa->size : 1.0f); float h = interaction_radius * sphdata->hfac; - float rest_density = fluid->rest_density * (fluid->flag & SPH_FAC_DENSITY ? 4.77f : 1.f); /* 4.77 is an experimentally determined density factor */ + /* 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_length = fluid->rest_length * (fluid->flag & SPH_FAC_REST_LENGTH ? 2.588f * pa->size : 1.f); float stiffness = fluid->stiffness_k; @@ -2657,12 +2658,18 @@ static int collision_response(ParticleSimulationData *sim, ParticleData *pa, Par ParticleCollisionElement *pce = &col->pce; PartDeflect *pd = col->hit->pd; RNG *rng = sim->rng; - float co[3]; /* point of collision */ - float x = hit->dist/col->original_ray_length; /* location factor of collision between this iteration */ - float f = col->f + x * (1.0f - col->f); /* time factor of collision between timestep */ - float dt1 = (f - col->f) * col->total_time; /* time since previous collision (in seconds) */ - float dt2 = (1.0f - f) * col->total_time; /* time left after collision (in seconds) */ - int through = (BLI_rng_get_float(rng) < pd->pdef_perm) ? 1 : 0; /* did particle pass through the collision surface? */ + /* point of collision */ + float co[3]; + /* location factor of collision between this iteration */ + float x = hit->dist/col->original_ray_length; + /* time factor of collision between timestep */ + float f = col->f + x * (1.0f - col->f); + /* time since previous collision (in seconds) */ + float dt1 = (f - col->f) * col->total_time; + /* time left after collision (in seconds) */ + float dt2 = (1.0f - f) * col->total_time; + /* did particle pass through the collision surface? */ + int through = (BLI_rng_get_float(rng) < pd->pdef_perm) ? 1 : 0; /* calculate exact collision location */ interp_v3_v3v3(co, col->co1, col->co2, x); @@ -2682,10 +2689,14 @@ static int collision_response(ParticleSimulationData *sim, ParticleData *pa, Par } /* figure out velocity and other data after collision */ else { - float v0[3]; /* velocity directly before collision to be modified into velocity directly after collision */ - float v0_nor[3];/* normal component of v0 */ - float v0_tan[3];/* tangential component of v0 */ - float vc_tan[3];/* tangential component of collision surface velocity */ + /* velocity directly before collision to be modified into velocity directly after collision */ + float v0[3]; + /* normal component of v0 */ + float v0_nor[3]; + /* tangential component of v0 */ + float v0_tan[3]; + /* tangential component of collision surface velocity */ + float vc_tan[3]; float v0_dot, vc_dot; float damp = pd->pdef_damp + pd->pdef_rdamp * 2 * (BLI_rng_get_float(rng) - 0.5f); float frict = pd->pdef_frict + pd->pdef_rfrict * 2 * (BLI_rng_get_float(rng) - 0.5f); @@ -2728,7 +2739,8 @@ static int collision_response(ParticleSimulationData *sim, ParticleData *pa, Par madd_v3_v3fl(v1_tan, vr_tan, -0.4); mul_v3_fl(v1_tan, 1.0f/1.4f); /* 1/(1+0.4) */ - /* rolling friction is around 0.01 of sliding friction (could be made a parameter) */ + /* rolling friction is around 0.01 of sliding friction + * (could be made a parameter) */ mul_v3_fl(v1_tan, 1.0f - 0.01f * frict); /* surface_velocity is opposite to cm velocity */ @@ -3185,7 +3197,8 @@ static void do_hair_dynamics(ParticleSimulationData *sim) } } - realloc_roots = false; /* whether hair root info array has to be reallocated */ + /* whether hair root info array has to be reallocated */ + realloc_roots = false; if (psys->hair_in_mesh) { Mesh *mesh = psys->hair_in_mesh; if (totpoint != mesh->totvert || totedge != mesh->totedge) { |