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:
authorJacques Lucke <mail@jlucke.com>2018-10-18 16:43:06 +0300
committerJacques Lucke <mail@jlucke.com>2018-10-18 16:43:06 +0300
commit41216d5ad4c722e2ad9f15c968af454fc7566d5e (patch)
treef68fe3e1dd32a2d651b6678a1783e165ce2e70c8 /source/blender/blenkernel/intern/softbody.c
parentcfdd902d2d5d560262d1218861ad1a4469c5259f (diff)
Cleanup: Remove more #if 0 blocks
Continuation of https://developer.blender.org/D3802 Reviewers: brecht Differential Revision: https://developer.blender.org/D3808
Diffstat (limited to 'source/blender/blenkernel/intern/softbody.c')
-rw-r--r--source/blender/blenkernel/intern/softbody.c146
1 files changed, 1 insertions, 145 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index e3bd6f9860f..e4ea839770a 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -972,9 +972,6 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), struct Object
GHashIterator *ihash;
float aabbmin[3], aabbmax[3];
int deflected=0;
-#if 0
- int a;
-#endif
if ((sb == NULL) || (sb->scratch ==NULL)) return 0;
copy_v3_v3(aabbmin, sb->scratch->aabbmin);
@@ -1807,45 +1804,6 @@ 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 */
-#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;
- int i, j;
- if (L < len) {
- for (i=0;i<3;i++) {
- for (j=0;j<3;j++) {
- delta_ij = (i==j ? (1.0f): (0.0f));
- m=factor*(dir[i]*dir[j] + (1-L/len)*(delta_ij - dir[i]*dir[j]));
- EIG_linear_solver_matrix_add(ia+i, op+ic+j, m);
- }
- }
- }
- else {
- for (i=0;i<3;i++) {
- for (j=0;j<3;j++) {
- m=factor*dir[i]*dir[j];
- EIG_linear_solver_matrix_add(ia+i, op+ic+j, m);
- }
- }
- }
-}
-
-
-static void dfdx_goal(int ia, int ic, int op, float factor)
-{
- int i;
- for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, op+ic+i, factor);
-}
-
-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 */
@@ -1853,25 +1811,15 @@ static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, floa
float dir[3], dvel[3];
float distance, forcefactor, kd, absvel, projvel, kw;
-#if 0 /* UNUSED */
- int ia, ic;
-#endif
+
/* prepare depending on which side of the spring we are on */
if (bpi == bs->v1) {
bp1 = &sb->bpoint[bs->v1];
bp2 = &sb->bpoint[bs->v2];
-#if 0 /* UNUSED */
- ia =3*bs->v1;
- ic =3*bs->v2;
-#endif
}
else if (bpi == bs->v2) {
bp1 = &sb->bpoint[bs->v2];
bp2 = &sb->bpoint[bs->v1];
-#if 0 /* UNUSED */
- ia =3*bs->v2;
- ic =3*bs->v1;
-#endif
}
else {
/* TODO make this debug option */
@@ -2496,13 +2444,6 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f;
aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f;
- /* old one with homogeneous masses */
- /* claim a minimum mass for vertex */
-#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 */
/* claim a minimum mass for vertex */
@@ -2547,16 +2488,6 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* x(t + dt) = x(t) + v(t~) * dt */
mul_v3_fl(dx, forcetime);
- /* the freezer coming sooner or later */
-#if 0
- if ((dot_v3v3(dx, dx)<freezeloc )&&(dot_v3v3(bp->force, bp->force)<freezeforce )) {
- bp->frozen /=2;
- }
- else {
- bp->frozen = min_ff(bp->frozen*1.05f, 1.0f);
- }
- mul_v3_fl(dx, bp->frozen);
-#endif
/* again some nasty if's to have heun in here too */
if (mode ==1) {
copy_v3_v3(bp->prevpos, bp->pos);
@@ -2621,81 +2552,6 @@ static void softbody_restore_prev_step(Object *ob)
}
}
-#if 0
-static void softbody_store_step(Object *ob)
-{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
- BodyPoint *bp;
- int a;
-
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- copy_v3_v3(bp->prevvec, bp->vec);
- copy_v3_v3(bp->prevpos, bp->pos);
- }
-}
-
-
-/* used by predictors and correctors */
-static void softbody_store_state(Object *ob, float *ppos, float *pvel)
-{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
- BodyPoint *bp;
- int a;
- float *pp=ppos, *pv=pvel;
-
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-
- copy_v3_v3(pv, bp->vec);
- pv+=3;
-
- copy_v3_v3(pp, bp->pos);
- pp+=3;
- }
-}
-
-/* used by predictors and correctors */
-static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
-{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
- BodyPoint *bp;
- int a;
- float *pp=ppos, *pv=pvel;
-
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-
- copy_v3_v3(bp->vec, pv);
- pv+=3;
-
- copy_v3_v3(bp->pos, pp);
- pp+=3;
- }
-}
-
-/* used by predictors and correctors */
-static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
-{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
- BodyPoint *bp;
- int a;
- float *pp=ppos, *pv=pvel;
- float temp[3];
-
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-
- copy_v3_v3(temp, bp->vec);
- copy_v3_v3(bp->vec, pv);
- copy_v3_v3(pv, temp);
- pv+=3;
-
- copy_v3_v3(temp, bp->pos);
- copy_v3_v3(bp->pos, pp);
- copy_v3_v3(pp, temp);
- pp+=3;
- }
-}
-#endif
-
-
/* 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