From ae573836483d6acc56761918336cb8d2b0486d08 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Sep 2018 18:28:27 +1000 Subject: Cleanup: comment blocks --- source/blender/blenkernel/BKE_constraint.h | 18 ++- source/blender/blenkernel/BKE_gpencil_modifier.h | 14 +- source/blender/blenkernel/BKE_shader_fx.h | 8 +- source/blender/blenkernel/intern/bvhutils.c | 4 +- source/blender/blenkernel/intern/cloth.c | 19 +-- source/blender/blenkernel/intern/dynamicpaint.c | 28 ++-- source/blender/blenkernel/intern/fcurve.c | 4 +- source/blender/blenkernel/intern/fmodifier.c | 2 +- source/blender/blenkernel/intern/gpencil.c | 16 +- .../blender/blenkernel/intern/gpencil_modifier.c | 2 +- source/blender/blenkernel/intern/object.c | 8 +- source/blender/blenkernel/intern/particle.c | 12 +- source/blender/blenkernel/intern/seqeffects.c | 8 +- source/blender/blenkernel/intern/sequencer.c | 24 +-- source/blender/blenkernel/intern/shader_fx.c | 2 +- source/blender/blenkernel/intern/smoke.c | 6 +- source/blender/blenkernel/intern/softbody.c | 162 ++++++++++----------- 17 files changed, 170 insertions(+), 167 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index 6f83dbcce59..cfc7d8e6065 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -68,16 +68,18 @@ typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, bo /* ....... */ -/* Constraint Type-Info (shorthand in code = cti): - * This struct provides function pointers for runtime, so that functions can be - * written more generally (with fewer/no special exceptions for various constraints). +/** + * Constraint Type-Info (shorthand in code = cti): + * This struct provides function pointers for runtime, so that functions can be + * written more generally (with fewer/no special exceptions for various constraints). * - * Callers of these functions must check that they actually point to something useful, - * as some constraints don't define some of these. + * Callers of these functions must check that they actually point to something useful, + * as some constraints don't define some of these. * - * Warning: it is not too advisable to reorder order of members of this struct, - * as you'll have to edit quite a few ($NUM_CONSTRAINT_TYPES) of these - * structs. + * Warning: + * it is not too advisable to reorder order of members of this struct, + * as you'll have to edit quite a few #NUM_CONSTRAINT_TYPES of these + * structs. */ typedef struct bConstraintTypeInfo { /* admin/ident */ diff --git a/source/blender/blenkernel/BKE_gpencil_modifier.h b/source/blender/blenkernel/BKE_gpencil_modifier.h index be27560bbf2..a5647f5ad0d 100644 --- a/source/blender/blenkernel/BKE_gpencil_modifier.h +++ b/source/blender/blenkernel/BKE_gpencil_modifier.h @@ -66,16 +66,16 @@ typedef enum { eGpencilModifierTypeFlag_SupportsEditmode = (1 << 1), /* For modifiers that support editmode this determines if the - * modifier should be enabled by default in editmode. This should - * only be used by modifiers that are relatively speedy and - * also generally used in editmode, otherwise let the user enable - * it by hand. - */ + * modifier should be enabled by default in editmode. This should + * only be used by modifiers that are relatively speedy and + * also generally used in editmode, otherwise let the user enable + * it by hand. + */ eGpencilModifierTypeFlag_EnableInEditmode = (1 << 2), /* For modifiers that require original data and so cannot - * be placed after any non-deformative modifier. - */ + * be placed after any non-deformative modifier. + */ eGpencilModifierTypeFlag_RequiresOriginalData = (1 << 3), /* max one per type */ diff --git a/source/blender/blenkernel/BKE_shader_fx.h b/source/blender/blenkernel/BKE_shader_fx.h index d2c8cfb457c..3306d8256e8 100644 --- a/source/blender/blenkernel/BKE_shader_fx.h +++ b/source/blender/blenkernel/BKE_shader_fx.h @@ -63,8 +63,8 @@ typedef enum { eShaderFxTypeFlag_SupportsEditmode = (1 << 0), /* For effects that support editmode this determines if the - * effect should be enabled by default in editmode. - */ + * effect should be enabled by default in editmode. + */ eShaderFxTypeFlag_EnableInEditmode = (1 << 2), /* max one per type */ @@ -95,8 +95,8 @@ typedef struct ShaderFxTypeInfo { ShaderFxTypeFlag flags; /* Copy instance data for this effect type. Should copy all user - * level settings to the target effect. - */ + * level settings to the target effect. + */ void(*copyData)(const struct ShaderFxData *fx, struct ShaderFxData *target); /* Initialize new instance data for this effect type, this function diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 19ac81b4bb7..bb3d468fd7b 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -1243,7 +1243,7 @@ BVHTree *bvhtree_from_mesh_get( int looptri_num = dm->getNumLoopTri(dm); /* this assert checks we have looptris, - * if not caller should use DM_ensure_looptri() */ + * if not caller should use DM_ensure_looptri() */ BLI_assert(!(looptri_num == 0 && dm->getNumPolys(dm) != 0)); tree = bvhtree_from_mesh_looptri_create_tree( @@ -1445,7 +1445,7 @@ BVHTree *BKE_bvhtree_from_mesh_get( if (data_cp.cached == false) { int looptri_num = BKE_mesh_runtime_looptri_len(mesh); /* this assert checks we have looptris, - * if not caller should use DM_ensure_looptri() */ + * if not caller should use DM_ensure_looptri() */ BLI_assert(!(looptri_num == 0 && mesh->totpoly != 0)); data_cp.tree = bvhtree_from_mesh_looptri_create_tree( diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index ce723d4a7f2..53894431fc3 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -570,11 +570,11 @@ void cloth_free_modifier(ClothModifierData *clmd ) if (cloth->edgeset) BLI_edgeset_free(cloth->edgeset); - - /* - if (clmd->clothObject->facemarks) - MEM_freeN(clmd->clothObject->facemarks); - */ +#if 0 + if (clmd->clothObject->facemarks) { + MEM_freeN(clmd->clothObject->facemarks); + } +#endif MEM_freeN ( cloth ); clmd->clothObject = NULL; } @@ -640,10 +640,11 @@ void cloth_free_modifier_extern(ClothModifierData *clmd ) BLI_edgeset_free(cloth->edgeset); - /* - if (clmd->clothObject->facemarks) - MEM_freeN(clmd->clothObject->facemarks); - */ +#if 0 + if (clmd->clothObject->facemarks) { + MEM_freeN(clmd->clothObject->facemarks); + } +#endif MEM_freeN ( cloth ); clmd->clothObject = NULL; } diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 4b61d35cac8..eadf6c5ea22 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -1347,7 +1347,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const b } /* also add number of vertices to temp_data - * to locate points on "mesh edge" */ + * to locate points on "mesh edge" */ for (i = 0; i < numOfPolys; i++) { for (int j = 0; j < mpoly[i].totloop; j++) { temp_data[mloop[mpoly[i].loopstart + j].v]++; @@ -1355,7 +1355,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const b } /* now check if total number of edges+faces for - * each vertex is even, if not -> vertex is on mesh edge */ + * each vertex is even, if not -> vertex is on mesh edge */ for (i = 0; i < sData->total_points; i++) { if ((temp_data[i] % 2) || (temp_data[i] < 4)) { ad->flags[i] |= ADJ_ON_MESH_EDGE; @@ -1389,7 +1389,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const b } else if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) { /* for image sequences, only allocate memory. - * bake initialization takes care of rest */ + * bake initialization takes care of rest */ } MEM_freeN(temp_data); @@ -1557,7 +1557,7 @@ static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface return; /* for vertex surface loop through tfaces and find uv color - * that provides highest alpha */ + * that provides highest alpha */ if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) { struct ImagePool *pool = BKE_image_pool_new(); @@ -2884,7 +2884,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo int cursor = 0; /* Create a temporary array of final indexes (before unassigned - * pixels have been dropped) */ + * pixels have been dropped) */ for (int i = 0; i < w * h; i++) { if (tempPoints[i].tri_index != -1) { final_index[i] = cursor; @@ -3349,9 +3349,9 @@ static void mesh_tris_spherecast_dp(void *userdata, int index, const BVHTreeRay } /* A modified callback to bvh tree nearest point. The tree must have been built using bvhtree_from_mesh_looptri. - * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. + * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. * - * To optimize brush detection speed this doesn't calculate hit normal. + * To optimize brush detection speed this doesn't calculate hit normal. */ static void mesh_tris_nearest_point_dp(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) { @@ -4005,7 +4005,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex( interp_weights_tri_v3(weights, mvert[v1].co, mvert[v2].co, mvert[v3].co, hitCoord); /* simple check based on brush surface velocity, - * todo: perhaps implement something that handles volume movement as well */ + * todo: perhaps implement something that handles volume movement as well. */ /* interpolate vertex speed vectors to get hit point velocity */ interp_v3_v3v3v3(brushPointVelocity, @@ -4717,7 +4717,7 @@ static void surface_determineForceTargetPoints( const float closest_dot = dot_v3v3(bNeighs[n_index].dir, bNeighs[closest_id[0]].dir); /* only accept neighbor at "other side" of the first one in relation to force dir - * so make sure angle between this and closest neigh is greater than first angle */ + * so make sure angle between this and closest neigh is greater than first angle. */ if (dir_dot > closest_d[1] && closest_dot < closest_d[0] && dir_dot > 0.0f) { closest_d[1] = dir_dot; closest_id[1] = n_index; @@ -4734,7 +4734,7 @@ static void surface_determineForceTargetPoints( float temp; /* project force vector on the plane determined by these two neighbor points - * and calculate relative force angle from it*/ + * and calculate relative force angle from it. */ cross_v3_v3v3(tangent, bNeighs[closest_id[0]].dir, bNeighs[closest_id[1]].dir); normalize_v3(tangent); force_intersect = dot_v3v3(force, tangent); @@ -4884,7 +4884,7 @@ static void dynamic_paint_prepare_effect_cb( /* if global gravity is enabled, add it too */ if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) /* also divide by 10 to about match default grav - * with default force strength (1.0) */ + * with default force strength (1.0). */ madd_v3_v3fl(forc, scene->physics_settings.gravity, surface->effector_weights->global_gravity * surface->effector_weights->weight[0] / 10.f); @@ -4946,7 +4946,7 @@ static int dynamicPaint_prepareEffectStep( } /* Get number of required steps using average point distance - * so that just a few ultra close pixels wont up substeps to max */ + * so that just a few ultra close pixels wont up substeps to max. */ /* adjust number of required substep by fastest active effect */ if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) @@ -5047,7 +5047,7 @@ static void dynamic_paint_effect_shrink_cb( totalAlpha += pPoint_prev->e_color[3]; /* Check if neighboring point has lower alpha, - * if so, decrease this point's alpha as well*/ + * if so, decrease this point's alpha as well. */ if (pPoint->color[3] <= 0.0f && pPoint->e_color[3] <= 0.0f && pPoint->wetness <= 0.0f) continue; @@ -5558,7 +5558,7 @@ static void dynamic_paint_surface_pre_step_cb( /* now calculate new alpha for dry layer that keeps final blended color unchanged */ pPoint->color[3] = (f_color[3] - pPoint->e_color[3]) / (1.0f - pPoint->e_color[3]); /* for each rgb component, calculate a new dry layer color that keeps the final blend color - * with these new alpha values. (wet layer color doesnt change)*/ + * with these new alpha values. (wet layer color doesnt change)*/ if (pPoint->color[3]) { for (i = 0; i < 3; i++) { pPoint->color[i] = (f_color[i] * f_color[3] - pPoint->e_color[i] * pPoint->e_color[3]) / diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 1e4c868a3db..bf516a6b739 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -2022,8 +2022,8 @@ float evaluate_driver(PathResolvedRNA *anim_rna, ChannelDriver *driver, ChannelD default: { /* special 'hack' - just use stored value - * This is currently used as the mechanism which allows animated settings to be able - * to be changed via the UI. + * This is currently used as the mechanism which allows animated settings to be able + * to be changed via the UI. */ break; } diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index b69bce088d2..5911d155278 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -273,7 +273,7 @@ static void fcm_fn_generator_new_data(void *mdata) } /* Unary 'normalized sine' function - * y = sin(PI + x) / (PI * x), + * y = sin(PI + x) / (PI * x), * except for x = 0 when y = 1. */ static double sinc(double x) diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 6d771148723..20c069fcbdb 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1265,8 +1265,8 @@ bool BKE_gpencil_smooth_stroke(bGPDstroke *gps, int i, float inf) } /* Only affect endpoints by a fraction of the normal strength, - * to prevent the stroke from shrinking too much - */ + * to prevent the stroke from shrinking too much + */ if ((i == 0) || (i == gps->totpoints - 1)) { inf *= 0.1f; } @@ -1332,8 +1332,8 @@ bool BKE_gpencil_smooth_stroke_strength(bGPDstroke *gps, int point_index, float ptc = &gps->points[after]; /* the optimal value is the corresponding to the interpolation of the strength - * at the distance of point b - */ + * at the distance of point b + */ const float fac = line_point_factor_v3(&ptb->x, &pta->x, &ptc->x); const float optimal = (1.0f - fac) * pta->strength + fac * ptc->strength; @@ -1366,8 +1366,8 @@ bool BKE_gpencil_smooth_stroke_thickness(bGPDstroke *gps, int point_index, float ptc = &gps->points[after]; /* the optimal value is the corresponding to the interpolation of the pressure - * at the distance of point b - */ + * at the distance of point b + */ float fac = line_point_factor_v3(&ptb->x, &pta->x, &ptc->x); float optimal = interpf(ptc->pressure, pta->pressure, fac); @@ -1400,8 +1400,8 @@ bool BKE_gpencil_smooth_stroke_uv(bGPDstroke *gps, int point_index, float influe ptc = &gps->points[after]; /* the optimal value is the corresponding to the interpolation of the pressure - * at the distance of point b - */ + * at the distance of point b + */ float fac = line_point_factor_v3(&ptb->x, &pta->x, &ptc->x); float optimal = interpf(ptc->uv_rot, pta->uv_rot, fac); diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index bff71f64871..cf5c58d5727 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -584,7 +584,7 @@ void BKE_gpencil_modifier_copyData_generic(const GpencilModifierData *md_src, Gp const GpencilModifierTypeInfo *mti = BKE_gpencil_modifierType_getInfo(md_src->type); /* md_dst may have alredy be fully initialized with some extra allocated data, - * we need to free it now to avoid memleak. */ + * we need to free it now to avoid memleak. */ if (mti->freeData) { mti->freeData(md_dst); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 37560cf84ae..03d0d9704dd 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2313,8 +2313,8 @@ void BKE_object_where_is_calc(Depsgraph *depsgraph, Scene *scene, Object *ob) * * It assumes the object parent is already in the depsgraph. * Otherwise, after changing ob->parent you need to call: - * DEG_relations_tag_update(bmain); - * BKE_scene_graph_update_tagged(depsgraph, bmain); + * - #DEG_relations_tag_update(bmain); + * - #BKE_scene_graph_update_tagged(depsgraph, bmain); */ void BKE_object_workob_calc_parent(Depsgraph *depsgraph, Scene *scene, Object *ob, Object *workob) { @@ -3934,7 +3934,7 @@ bool BKE_object_modifier_update_subframe( if (ob->track) no_update |= BKE_object_modifier_update_subframe(depsgraph, scene, ob->track, 0, recursion, frame, type); /* skip subframe if object is parented - * to vertex of a dynamic paint canvas */ + * to vertex of a dynamic paint canvas */ if (no_update && (ob->partype == PARVERT1 || ob->partype == PARVERT3)) return false; @@ -3963,7 +3963,7 @@ bool BKE_object_modifier_update_subframe( BKE_animsys_evaluate_animdata(depsgraph, scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM); if (update_mesh) { /* ignore cache clear during subframe updates - * to not mess up cache validity */ + * to not mess up cache validity */ object_cacheIgnoreClear(ob, 1); BKE_object_handle_update(depsgraph, scene, ob); object_cacheIgnoreClear(ob, 0); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index da5efe3eeb8..ef681c72676 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2193,12 +2193,12 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp /* * NOTE: Should in theory be the same as: - cpa_num = psys_particle_dm_face_lookup( - ctx->sim.psmd->dm_final, - ctx->sim.psmd->dm_deformed, - pa->num, pa->fuv, - NULL); - */ + * cpa_num = psys_particle_dm_face_lookup( + * ctx->sim.psmd->dm_final, + * ctx->sim.psmd->dm_deformed, + * pa->num, pa->fuv, + * NULL); + */ cpa_num = (ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND)) ? pa->num : pa->num_dmcache; diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 65d023fb6f2..5deaa5e4ce9 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1727,10 +1727,10 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f break; case DO_CLOCK_WIPE: /* - * temp1: angle of effect center in rads - * temp2: angle of line through (halfx, halfy) and (x, y) in rads - * temp3: angle of low side of blur - * temp4: angle of high side of blur + * temp1: angle of effect center in rads + * temp2: angle of line through (halfx, halfy) and (x, y) in rads + * temp3: angle of low side of blur + * temp4: angle of high side of blur */ output = 1.0f - facf0; widthf = wipe->edgeWidth * 2.0f * (float)M_PI; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index b5b4ec5cd41..936f13fe382 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2420,21 +2420,21 @@ void BKE_sequencer_color_balance_apply(StripColorBalance *cb, ImBuf *ibuf, float } /* - * input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE + * input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE * - * Do all the things you can't really do afterwards using sequence effects - * (read: before rescaling to render resolution has been done) + * Do all the things you can't really do afterwards using sequence effects + * (read: before rescaling to render resolution has been done) * - * Order is important! + * Order is important! * - * - Deinterlace - * - Crop and transform in image source coordinate space - * - Flip X + Flip Y (could be done afterwards, backward compatibility) - * - Promote image to float data (affects pipeline operations afterwards) - * - Color balance (is most efficient in the byte -> float - * (future: half -> float should also work fine!) - * case, if done on load, since we can use lookup tables) - * - Premultiply + * - Deinterlace + * - Crop and transform in image source coordinate space + * - Flip X + Flip Y (could be done afterwards, backward compatibility) + * - Promote image to float data (affects pipeline operations afterwards) + * - Color balance (is most efficient in the byte -> float + * (future: half -> float should also work fine!) + * case, if done on load, since we can use lookup tables) + * - Premultiply */ bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, Sequence *seq, float UNUSED(cfra)) diff --git a/source/blender/blenkernel/intern/shader_fx.c b/source/blender/blenkernel/intern/shader_fx.c index c028c2184fd..0bbac9b7a2a 100644 --- a/source/blender/blenkernel/intern/shader_fx.c +++ b/source/blender/blenkernel/intern/shader_fx.c @@ -166,7 +166,7 @@ void BKE_shaderfx_copyData_generic(const ShaderFxData *fx_src, ShaderFxData *fx_ const ShaderFxTypeInfo *fxi = BKE_shaderfxType_getInfo(fx_src->type); /* fx_dst may have alredy be fully initialized with some extra allocated data, - * we need to free it now to avoid memleak. */ + * we need to free it now to avoid memleak. */ if (fxi->freeData) { fxi->freeData(fx_dst); } diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index c9b10e36ed1..e9832d723e4 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1514,7 +1514,7 @@ static void sample_derivedmesh( velocity_map[index * 3 + 1] += hit_normal[1] * sfs->vel_normal * 0.25f; velocity_map[index * 3 + 2] += hit_normal[2] * sfs->vel_normal * 0.25f; /* TODO: for fire emitted from mesh surface we can use - * Vf = Vs + (Ps/Pf - 1)*S to model gaseous expansion from solid to fuel */ + * Vf = Vs + (Ps/Pf - 1)*S to model gaseous expansion from solid to fuel */ } /* apply object velocity */ if (has_velocity && sfs->vel_multi) { @@ -2711,7 +2711,7 @@ static DerivedMesh *createDomainGeometry(SmokeDomainSettings *sds, Object *ob) ml[0].v = 1; ml[1].v = 0; ml[2].v = 4; ml[3].v = 5; /* calculate required shift to match domain's global position - * it was originally simulated at (if object moves without smoke step) */ + * it was originally simulated at (if object moves without smoke step) */ invert_m4_m4(ob->imat, ob->obmat); mul_m4_v3(ob->obmat, ob_loc); mul_m4_v3(sds->obmat, ob_cache_loc); @@ -3067,7 +3067,7 @@ static void smoke_calc_transparency(SmokeDomainSettings *sds, ViewLayer *view_la } /* get smoke velocity and density at given coordinates - * returns fluid density or -1.0f if outside domain*/ + * returns fluid density or -1.0f if outside domain. */ float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]) { SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke); diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 3ab55b3705a..1f5cefd47d7 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -30,24 +30,22 @@ */ -/* -****** -variables on the UI for now - - float mediafrict; friction to env - float nodemass; softbody mass of *vertex* - float grav; softbody amount of gravitaion to apply - - float goalspring; softbody goal springs - float goalfrict; softbody goal springs friction - float mingoal; quick limits for goal - float maxgoal; - - float inspring; softbody inner springs - float infrict; softbody inner springs friction - -***** -*/ +/** + * variables on the UI for now + *
+ * float mediafrict;  friction to env
+ * float nodemass;	  softbody mass of *vertex*
+ * float grav;        softbody amount of gravitaion to apply
+ *
+ * float goalspring;  softbody goal springs
+ * float goalfrict;   softbody goal springs friction
+ * float mingoal;     quick limits for goal
+ * float maxgoal;
+ *
+ * float inspring;	  softbody inner springs
+ * float infrict;     softbody inner springs friction
+ * 
+ */ #include @@ -256,16 +254,16 @@ static float _final_mass(Object *ob, BodyPoint *bp) /*+++ collider caching and dicing +++*/ -/******************** -for each target object/face the axis aligned bounding box (AABB) is stored -faces parallel to global axes -so only simple "value" in [min, max] ckecks are used -float operations still -*/ +/* + * for each target object/face the axis aligned bounding box (AABB) is stored + * faces parallel to global axes + * so only simple "value" in [min, max] ckecks are used + * float operations still + */ /* just an ID here to reduce the prob for killing objects -** ob->sumohandle points to we should not kill :) -*/ + * ob->sumohandle points to we should not kill :) + */ static const int CCD_SAVETY = 190561; typedef struct ccdf_minmax { @@ -732,8 +730,8 @@ static void add_bp_springlist(BodyPoint *bp, int springID) } /* do this once when sb is build -it is O(N^2) so scanning for springs every iteration is too expensive -*/ + * it is O(N^2) so scanning for springs every iteration is too expensive + */ static void build_bps_springlist(Object *ob) { SoftBody *sb= ob->soft; /* is supposed to be there */ @@ -925,29 +923,29 @@ static void free_softbody_intern(SoftBody *sb) /* ************ dynamics ********** */ /* the most general (micro physics correct) way to do collision -** (only needs the current particle position) -** -** it actually checks if the particle intrudes a short range force field generated -** by the faces of the target object and returns a force to drive the particel out -** the strenght of the field grows exponetially if the particle is on the 'wrong' side of the face -** 'wrong' side : projection to the face normal is negative (all referred to a vertex in the face) -** -** flaw of this: 'fast' particles as well as 'fast' colliding faces -** give a 'tunnel' effect such that the particle passes through the force field -** without ever 'seeing' it -** this is fully compliant to heisenberg: h >= fuzzy(location) * fuzzy(time) -** besides our h is way larger than in QM because forces propagate way slower here -** we have to deal with fuzzy(time) in the range of 1/25 seconds (typical frame rate) -** yup collision targets are not known here any better -** and 1/25 second is looong compared to real collision events -** Q: why not use 'simple' collision here like bouncing back a particle -** --> reverting is velocity on the face normal -** A: because our particles are not alone here -** and need to tell their neighbors exactly what happens via spring forces -** unless sbObjectStep( .. ) is called on sub frame timing level -** BTW that also questions the use of a 'implicit' solvers on softbodies -** since that would only valid for 'slow' moving collision targets and dito particles -*/ + * (only needs the current particle position) + * + * it actually checks if the particle intrudes a short range force field generated + * by the faces of the target object and returns a force to drive the particel out + * the strenght of the field grows exponetially if the particle is on the 'wrong' side of the face + * 'wrong' side : projection to the face normal is negative (all referred to a vertex in the face) + * + * flaw of this: 'fast' particles as well as 'fast' colliding faces + * give a 'tunnel' effect such that the particle passes through the force field + * without ever 'seeing' it + * this is fully compliant to heisenberg: h >= fuzzy(location) * fuzzy(time) + * besides our h is way larger than in QM because forces propagate way slower here + * we have to deal with fuzzy(time) in the range of 1/25 seconds (typical frame rate) + * yup collision targets are not known here any better + * and 1/25 second is looong compared to real collision events + * Q: why not use 'simple' collision here like bouncing back a particle + * --> reverting is velocity on the face normal + * A: because our particles are not alone here + * and need to tell their neighbors exactly what happens via spring forces + * unless sbObjectStep( .. ) is called on sub frame timing level + * BTW that also questions the use of a 'implicit' solvers on softbodies + * since that would only valid for 'slow' moving collision targets and dito particles + */ /* +++ dependency information functions*/ @@ -1704,11 +1702,11 @@ static int sb_detect_vertex_collisionCached( if (mprevvert) { /* grab the average speed of the collider vertices - before we spoil nvX - humm could be done once a SB steps but then we' need to store that too - since the AABB reduced propabitlty to get here drasticallly - it might be a nice tradeof CPU <--> memory - */ + * before we spoil nvX + * humm could be done once a SB steps but then we' need to store that too + * since the AABB reduced propabitlty to get here drasticallly + * it might be a nice tradeof CPU <--> memory + */ sub_v3_v3v3(vv1, nv1, mprevvert[vt->tri[0]].co); sub_v3_v3v3(vv2, nv2, mprevvert[vt->tri[1]].co); sub_v3_v3v3(vv3, nv3, mprevvert[vt->tri[2]].co); @@ -1809,7 +1807,8 @@ static int sb_deflect_face(Object *ob, float *actpos, float *facenormal, float * return(deflected); } -/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it +/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it */ +#if 0 static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len, float factor) { float m, delta_ij; @@ -1845,7 +1844,8 @@ static void dfdv_goal(int ia, int ic, float factor) int i; for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, ic+i, factor); } -*/ +#endif /* if 0 */ + static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float UNUSED(forcetime)) { SoftBody *sb= ob->soft; /* is supposed to be there */ @@ -2248,7 +2248,7 @@ static void softbody_calc_forces(struct Depsgraph *depsgraph, Scene *scene, Obje /* rule we never alter free variables :bp->vec bp->pos in here ! * this will ruin adaptive stepsize AKA heun! (BM) - */ + */ SoftBody *sb= ob->soft; /* is supposed to be there */ BodyPoint *bp; /* BodyPoint *bproot; */ /* UNUSED */ @@ -2417,16 +2417,16 @@ static void softbody_calc_forces(struct Depsgraph *depsgraph, Scene *scene, Obje if (sb_deflect_face(ob, bp->pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) { if (intrusion < 0.0f) { if (G.debug_value & 0x01) { // 17 we did check for bit 0x10 before - /*fixing bug [17428] this forces adaptive step size to tiny steps - in some situations .. keeping G.debug_value==17 option for old files 'needing' the bug - */ - /*bjornmose: uugh.. what an evil hack - violation of the 'don't touch bp->pos in here' rule - but works nice, like this--> - we predict the solution being out of the collider - in heun step No1 and leave the heun step No2 adapt to it - so we kind of introduced a implicit solver for this case - */ + /* fixing bug [17428] this forces adaptive step size to tiny steps + * in some situations .. keeping G.debug_value==17 option for old files 'needing' the bug + */ + /* bjornmose: uugh.. what an evil hack + * violation of the 'don't touch bp->pos in here' rule + * but works nice, like this--> + * we predict the solution being out of the collider + * in heun step No1 and leave the heun step No2 adapt to it + * so we kind of introduced a implicit solver for this case + */ madd_v3_v3fl(bp->pos, facenormal, -intrusion); } else { @@ -2498,10 +2498,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* old one with homogeneous masses */ /* claim a minimum mass for vertex */ - /* - if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass; - else timeovermass = forcetime/0.009999f; - */ +#if 0 + if (sb->nodemass > 0.009999f) timeovermass = forcetime / sb->nodemass; + else timeovermass = forcetime / 0.009999f; +#endif for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { /* now we have individual masses */ @@ -2697,11 +2697,11 @@ static void softbody_swap_state(Object *ob, float *ppos, float *pvel) /* care for bodypoints taken out of the 'ordinary' solver step -** because they are screwed to goal by bolts -** they just need to move along with the goal in time -** we need to adjust them on sub frame timing in solver -** so now when frame is done .. put 'em to the position at the end of frame -*/ + * because they are screwed to goal by bolts + * they just need to move along with the goal in time + * we need to adjust them on sub frame timing in solver + * so now when frame is done .. put 'em to the position at the end of frame + */ static void softbody_apply_goalsnap(Object *ob) { SoftBody *sb= ob->soft; /* is supposed to be there */ @@ -2766,9 +2766,9 @@ static void interpolate_exciter(Object *ob, int timescale, int time) /* ************ convertors ********** */ -/* for each object type we need; - - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry -*/ +/* for each object type we need; + * - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry + */ /* Resetting a Mesh SB object's springs */ /* Spring length are caculted from'raw' mesh vertices that are NOT altered by modifier stack. */ -- cgit v1.2.3