Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-09-02 11:51:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-02 11:51:31 +0300
commit0ddf3e110ef0f1f69ef785db867e581f813ee9a7 (patch)
tree4afbadc141cd4072a4ea0bb11205acee72cd6dc6 /source/blender/blenkernel
parent8a3b548cb2b2c7a05a4d0a1c613f788d38a04e85 (diff)
Cleanup: comment blocks
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_constraint.h18
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c2
-rw-r--r--source/blender/blenkernel/intern/cloth.c19
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c28
-rw-r--r--source/blender/blenkernel/intern/fcurve.c4
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c2
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c12
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c8
-rw-r--r--source/blender/blenkernel/intern/sequencer.c24
-rw-r--r--source/blender/blenkernel/intern/smoke.c6
-rw-r--r--source/blender/blenkernel/intern/softbody.c162
12 files changed, 145 insertions, 142 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 5e7a3f4af72..293ac30f0f9 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -66,16 +66,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/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index e48c6ff38d2..151d697d891 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -1097,7 +1097,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(
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 26f998b3cb4..4597eb9b114 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -553,11 +553,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;
}
@@ -620,10 +620,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 ab5fe1d45f5..ed4ee1f8b17 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1373,7 +1373,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]++;
@@ -1381,7 +1381,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;
@@ -1415,7 +1415,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);
@@ -1583,7 +1583,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();
@@ -2908,7 +2908,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;
@@ -3458,9 +3458,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)
{
@@ -4119,7 +4119,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,
@@ -4858,7 +4858,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;
@@ -4875,7 +4875,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);
@@ -5025,7 +5025,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);
@@ -5087,7 +5087,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)
@@ -5188,7 +5188,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;
@@ -5699,7 +5699,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 95e4d2c92ae..6ee6d877b9c 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -2021,8 +2021,8 @@ float evaluate_driver(PathResolvedRNA *anim_rna, ChannelDriver *driver, const fl
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/object.c b/source/blender/blenkernel/intern/object.c
index 0cf2993133c..9f635966ee7 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -3647,7 +3647,7 @@ bool BKE_object_modifier_update_subframe(
if (ob->track) no_update |= BKE_object_modifier_update_subframe(bmain, eval_ctx, 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;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 50706a05dc0..b43c5376af4 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2309,12 +2309,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 e3fc494584c..1a0e3958dc0 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 7e4069305f6..0768fba3e0b 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -2410,21 +2410,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/smoke.c b/source/blender/blenkernel/intern/smoke.c
index c1a085a3b15..12bc40e62a0 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1513,7 +1513,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) {
@@ -2713,7 +2713,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);
@@ -3069,7 +3069,7 @@ static void smoke_calc_transparency(SmokeDomainSettings *sds, Scene *scene)
}
/* 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 47e567aaca1..93039bdace6 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
+ * <pre>
+ * 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
+ * </pre>
+ */
#include <math.h>
@@ -250,16 +248,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 {
@@ -757,8 +755,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 */
@@ -950,29 +948,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*/
@@ -1747,11 +1745,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);
@@ -1852,7 +1850,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;
@@ -1888,7 +1887,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 */
@@ -2292,7 +2292,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* 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 */
@@ -2462,16 +2462,16 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
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 {
@@ -2543,10 +2543,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 */
@@ -2742,11 +2742,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 */
@@ -2811,9 +2811,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. */