Change !BLI_ghashIterator_isDone to BLI_ghashIterator_notDone. It is
[blender.git] / source / blender / blenkernel / intern / softbody.c
index 63f0a29821f3b7c331b3701596af9f680dfe34df..01d4696de94dcbd4b81faec4decafe407b501534 100644 (file)
@@ -78,9 +78,8 @@ variables on the UI for now
 #include "BKE_DerivedMesh.h"
 #include "BKE_pointcache.h"
 #include "BKE_deform.h"
-#include "BKE_mesh.h" 
-//XXX #include  "BIF_editdeform.h"
-//XXX #include  "BIF_graphics.h"
+#include "BKE_mesh.h"
+
 #include  "PIL_time.h"
 // #include  "ONL_opennl.h" remove linking to ONL for now
 
@@ -144,13 +143,15 @@ typedef struct  SB_thread_context {
 } SB_thread_context;
 
 #define NLF_BUILD  1
-#define NLF_SOLVE  2
+#if 0
+#  define NLF_SOLVE  2
+#endif
 
 #define MID_PRESERVE 1
 
 #define SOFTGOALSNAP  0.999f
 /* if bp-> goal is above make it a *forced follow original* and skip all ODE stuff for this bp
- * removes *unnecessary* stiffnes from ODE system
+ * removes *unnecessary* stiffness from ODE system
  */
 #define HEUNWARNLIMIT 1 /* 500 would be fine i think for detecting severe *stiff* stuff */
 
@@ -1033,7 +1034,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), unsigned int U
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1096,12 +1097,12 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float
        float facedist, outerfacethickness, tune = 10.f;
        int a, deflected=0;
 
-       aabbmin[0] = MIN3(face_v1[0], face_v2[0], face_v3[0]);
-       aabbmin[1] = MIN3(face_v1[1], face_v2[1], face_v3[1]);
-       aabbmin[2] = MIN3(face_v1[2], face_v2[2], face_v3[2]);
-       aabbmax[0] = MAX3(face_v1[0], face_v2[0], face_v3[0]);
-       aabbmax[1] = MAX3(face_v1[1], face_v2[1], face_v3[1]);
-       aabbmax[2] = MAX3(face_v1[2], face_v2[2], face_v3[2]);
+       aabbmin[0] = min_fff(face_v1[0], face_v2[0], face_v3[0]);
+       aabbmin[1] = min_fff(face_v1[1], face_v2[1], face_v3[1]);
+       aabbmin[2] = min_fff(face_v1[2], face_v2[2], face_v3[2]);
+       aabbmax[0] = max_fff(face_v1[0], face_v2[0], face_v3[0]);
+       aabbmax[1] = max_fff(face_v1[1], face_v2[1], face_v3[1]);
+       aabbmax[2] = max_fff(face_v1[2], face_v2[2], face_v3[2]);
 
        /* calculate face normal once again SIGH */
        sub_v3_v3v3(edge1, face_v1, face_v2);
@@ -1112,7 +1113,7 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1169,7 +1170,7 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float
 
                                                                *damp=df*tune*ob->pd->pdef_sbdamp;
 
-                                                               df = 0.01f*exp(- 100.0f*df);
+                                                               df = 0.01f * expf(-100.0f * df);
                                                                Vec3PlusStVec(force, -df, d_nvect);
                                                                deflected = 3;
                                                        }
@@ -1195,16 +1196,16 @@ static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], fl
        float t, tune = 10.0f;
        int a, deflected=0;
 
-       aabbmin[0] = MIN3(face_v1[0], face_v2[0], face_v3[0]);
-       aabbmin[1] = MIN3(face_v1[1], face_v2[1], face_v3[1]);
-       aabbmin[2] = MIN3(face_v1[2], face_v2[2], face_v3[2]);
-       aabbmax[0] = MAX3(face_v1[0], face_v2[0], face_v3[0]);
-       aabbmax[1] = MAX3(face_v1[1], face_v2[1], face_v3[1]);
-       aabbmax[2] = MAX3(face_v1[2], face_v2[2], face_v3[2]);
+       aabbmin[0] = min_fff(face_v1[0], face_v2[0], face_v3[0]);
+       aabbmin[1] = min_fff(face_v1[1], face_v2[1], face_v3[1]);
+       aabbmin[2] = min_fff(face_v1[2], face_v2[2], face_v3[2]);
+       aabbmax[0] = max_fff(face_v1[0], face_v2[0], face_v3[0]);
+       aabbmax[1] = max_fff(face_v1[1], face_v2[1], face_v3[1]);
+       aabbmax[2] = max_fff(face_v1[2], face_v2[2], face_v3[2]);
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1432,7 +1433,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3], float edge_v2[3], fl
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1597,7 +1598,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
                                        /*see if we have wind*/
                                        if (do_effector) {
                                                EffectedPoint epoint;
-                                               float speed[3]={0.0f, 0.0f, 0.0f};
+                                               float speed[3] = {0.0f, 0.0f, 0.0f};
                                                float pos[3];
                                                mid_v3_v3v3(pos, sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos);
                                                mid_v3_v3v3(vel, sb->bpoint[bs->v1].vec, sb->bpoint[bs->v2].vec);
@@ -1718,15 +1719,15 @@ static int choose_winner(float*w, float* pos, float*a, float*b, float*c, float*c
 {
        float mindist, cp;
        int winner =1;
-       mindist = ABS(dot_v3v3(pos, a));
+       mindist = fabsf(dot_v3v3(pos, a));
 
-       cp = ABS(dot_v3v3(pos, b));
+       cp = fabsf(dot_v3v3(pos, b));
        if ( mindist < cp ) {
                mindist = cp;
                winner =2;
        }
 
-       cp = ABS(dot_v3v3(pos, c));
+       cp = fabsf(dot_v3v3(pos, c));
        if (mindist < cp ) {
                mindist = cp;
                winner =3;
@@ -1748,8 +1749,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
        Object *ob= NULL;
        GHash *hash;
        GHashIterator *ihash;
-       float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3]={0.0, 0.0, 0.0},
-             vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
+       float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3] = {0.0, 0.0, 0.0},
+             vv1[3], vv2[3], vv3[3], vv4[3], coledge[3] = {0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
              outerforceaccu[3], innerforceaccu[3],
              facedist, /* n_mag, */ /* UNUSED */ force_mag_norm, minx, miny, minz, maxx, maxy, maxz,
              innerfacethickness = -0.5f, outerfacethickness = 0.2f,
@@ -1762,7 +1763,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
        outerforceaccu[0]=outerforceaccu[1]=outerforceaccu[2]=0.0f;
        innerforceaccu[0]=innerforceaccu[1]=innerforceaccu[2]=0.0f;
 /* go */
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1942,7 +1943,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        }
 
                                                }
-                                               if ((deflected < 2)&& (G.rt != 444)) { /* we did not hit a face until now */
+                                               if ((deflected < 2)&& (G.debug_value != 444)) { /* we did not hit a face until now */
                                                        /* see if 'outer' hits an edge */
                                                        float dist;
 
@@ -1956,7 +1957,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        }
 
                                                        closest_to_line_segment_v3(ve, opco, nv2, nv3);
-                                                        sub_v3_v3v3(ve, opco, ve);
+                                                       sub_v3_v3v3(ve, opco, ve);
                                                        dist = normalize_v3(ve);
                                                        if ((dist < outerfacethickness)&&(dist < mindistedge )) {
                                                                copy_v3_v3(coledge, ve);
@@ -1965,7 +1966,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        }
 
                                                        closest_to_line_segment_v3(ve, opco, nv3, nv1);
-                                                        sub_v3_v3v3(ve, opco, ve);
+                                                       sub_v3_v3v3(ve, opco, ve);
                                                        dist = normalize_v3(ve);
                                                        if ((dist < outerfacethickness)&&(dist < mindistedge )) {
                                                                copy_v3_v3(coledge, ve);
@@ -2208,7 +2209,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
        bp = &sb->bpoint[ifirst];
        for (bb=number_of_points_here; bb>0; bb--, bp++) {
                /* clear forces  accumulator */
-               bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
+               bp->force[0] = bp->force[1] = bp->force[2] = 0.0;
                /* naive ball self collision */
                /* needs to be done if goal snaps or not */
                if (do_selfcollision) {
@@ -2292,7 +2293,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                        /* done goal stuff */
 
                        /* gravitation */
-                       if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
+                       if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
                                float gravity[3];
                                copy_v3_v3(gravity, scene->physics_settings.gravity);
                                mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob, bp)*sb->effector_weights->global_gravity); /* individual mass of node here */
@@ -2303,8 +2304,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                        if (do_effector) {
                                EffectedPoint epoint;
                                float kd;
-                               float force[3]= {0.0f, 0.0f, 0.0f};
-                               float speed[3]= {0.0f, 0.0f, 0.0f};
+                               float force[3] = {0.0f, 0.0f, 0.0f};
+                               float speed[3] = {0.0f, 0.0f, 0.0f};
                                float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
                                pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint);
                                pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
@@ -2494,7 +2495,7 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
 static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, float timenow, int nl_flags)
 {
        /* redirection to the new threaded Version */
-       if (!(G.rt & 0x10)) { // 16
+       if (!(G.debug_value & 0x10)) { // 16
                softbody_calc_forcesEx(scene, ob, forcetime, timenow, nl_flags);
                return;
        }
@@ -2505,7 +2506,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                /*backward compatibility note:
                fixing bug [17428] which forces adaptive step size to tiny steps
                in some situations
-               .. keeping G.rt==17 0x11 option for old files 'needing' the bug*/
+               .. keeping G.debug_value==17 0x11 option for old files 'needing' the bug*/
 
                /* rule we never alter free variables :bp->vec bp->pos in here !
                * this will ruin adaptive stepsize AKA heun! (BM)
@@ -2556,7 +2557,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
 
                for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
                        /* clear forces  accumulator */
-                       bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
+                       bp->force[0] = bp->force[1] = bp->force[2] = 0.0;
                        if (nl_flags & NLF_BUILD) {
                                //int ia =3*(sb->totpoint-a);
                                //int op =3*sb->totpoint;
@@ -2711,8 +2712,8 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                                /* particle field & vortex */
                                if (do_effector) {
                                        EffectedPoint epoint;
-                                       float force[3]= {0.0f, 0.0f, 0.0f};
-                                       float speed[3]= {0.0f, 0.0f, 0.0f};
+                                       float force[3] = {0.0f, 0.0f, 0.0f};
+                                       float speed[3] = {0.0f, 0.0f, 0.0f};
                                        float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
                                        pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint);
                                        pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
@@ -2757,9 +2758,9 @@ 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 ((!nl_flags)&&(intrusion < 0.0f)) {
-                                                       if (G.rt & 0x01) { // 17 we did check for bit 0x10 before
+                                                       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.rt==17 option for old files 'needing' the bug
+                                                               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
@@ -2838,7 +2839,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                        nlEnd(NL_MATRIX);
                        nlEnd(NL_SYSTEM);
 
-                       if ((G.rt == 32) && (nl_flags & NLF_BUILD)) {
+                       if ((G.debug_value == 32) && (nl_flags & NLF_BUILD)) {
                                printf("####MEE#####\n");
                                nlPrintMatrix();
                        }
@@ -2850,7 +2851,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                                float f;
                                int index =0;
                                /* for debug purpose .. anyhow cropping B vector looks like working */
-                               if (G.rt ==32)
+                               if (G.debug_value ==32)
                                        for (a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
                                                f=nlGetVariable(0, index);
                                                printf("(%f ", f);index++;
@@ -2904,7 +2905,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
        /* or heun ~ 2nd order runge-kutta steps, mode 1, 2 */
        SoftBody *sb= ob->soft; /* is supposed to be there */
        BodyPoint *bp;
-       float dx[3]={0}, dv[3], aabbmin[3], aabbmax[3], cm[3]={0.0f, 0.0f, 0.0f};
+       float dx[3] = {0}, dv[3], aabbmin[3], aabbmax[3], cm[3] = {0.0f, 0.0f, 0.0f};
        float timeovermass/*, freezeloc=0.00001f, freezeforce=0.00000000001f*/;
        float maxerrpos= 0.0f, maxerrvel = 0.0f;
        int a, fuzzy=0;
@@ -2914,7 +2915,7 @@ 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 homogenous masses  */
+       /* old one with homogeneous masses  */
        /* claim a minimum mass for vertex */
        /*
        if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass;
@@ -3193,7 +3194,7 @@ static void interpolate_exciter(Object *ob, int timescale, int time)
        - xxxx_to_softbody(Object *ob)      : a full (new) copy, creates SB geometry
 */
 
-static void get_scalar_from_vertexgroup(Object *ob, int vertID, short groupindex, float *target)
+static void get_scalar_from_vertexgroup(Object *ob, int vertID, int groupindex, float *target)
 /* result 0 on success, else indicates error number
 -- kind of *inverse* result defintion,
 -- but this way we can signal error condition to caller
@@ -3296,8 +3297,8 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
                if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) { /* even this is a deprecated evil hack */
                   /* I'd like to have it  .. if (sb->namedVG_Goal[0]) */
 
-                       get_scalar_from_vertexgroup(ob, a, (short) (sb->vertgroup-1), &bp->goal);
-                       /* do this always, regardless successfull read from vertex group */
+                       get_scalar_from_vertexgroup(ob, a, sb->vertgroup - 1, &bp->goal);
+                       /* do this always, regardless successful read from vertex group */
                        /* this is where '2.5 every thing is animatable' goes wrong in the first place jow_go_for2_5 */
                        /* 1st coding action to take : move this to frame level */
                        /* reads: leave the bp->goal as it was read from vertex group / or default .. we will need it at per frame call */
@@ -3310,15 +3311,15 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
                        if (ob->softflag & OB_SB_GOAL) {bp->goal = sb->defgoal;}
                }
 
-               /* to proove the concept
+               /* to proof the concept
                 * this enables per vertex *mass painting*
                 */
 
                if (sb->namedVG_Mass[0]) {
-                       int grp= defgroup_name_index (ob, sb->namedVG_Mass);
-                       /* printf("VGN  %s %d\n", sb->namedVG_Mass, grp); */
-                       if (grp > -1) {
-                               get_scalar_from_vertexgroup(ob, a, (short) (grp), &bp->mass);
+                       int defgrp_index = defgroup_name_index (ob, sb->namedVG_Mass);
+                       /* printf("VGN  %s %d\n", sb->namedVG_Mass, defgrp_index); */
+                       if (defgrp_index != -1) {
+                               get_scalar_from_vertexgroup(ob, a, defgrp_index, &bp->mass);
                                /* 2.5  bp->mass = bp->mass * sb->nodemass; */
                                /* printf("bp->mass  %f\n", bp->mass); */
 
@@ -3328,10 +3329,10 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
                bp->springweight = 1.0f;
 
                if (sb->namedVG_Spring_K[0]) {
-                       int grp= defgroup_name_index (ob, sb->namedVG_Spring_K);
-                       //printf("VGN  %s %d\n", sb->namedVG_Spring_K, grp);
-                       if (grp > -1) {
-                               get_scalar_from_vertexgroup(ob, a, (short) (grp), &bp->springweight);
+                       int defgrp_index = defgroup_name_index (ob, sb->namedVG_Spring_K);
+                       //printf("VGN  %s %d\n", sb->namedVG_Spring_K, defgrp_index);
+                       if (defgrp_index  != -1) {
+                               get_scalar_from_vertexgroup(ob, a, defgrp_index , &bp->springweight);
                                //printf("bp->springweight  %f\n", bp->springweight);
 
                        }
@@ -3799,7 +3800,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
                /* vertexCos came from local world, go global */
                mul_m4_v3(ob->obmat, bp->origE);
                /* just to be save give bp->origT a defined value
-                * will be calulated in interpolate_exciter()*/
+                * will be calculated in interpolate_exciter() */
                copy_v3_v3(bp->origT, bp->origE);
        }
 }
@@ -3811,7 +3812,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
  * that is:
  * a precise position vector denoting the motion of the center of mass
  * give a rotation/scale matrix using averaging method, that's why estimate and not calculate
- * see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
+ * see: this is kind of reverse engineering: having to states of a point cloud and recover what happend
  * our advantage here we know the identity of the vertex
  * there are others methods giving other results.
  * lloc, lrot, lscale are allowed to be NULL, just in case you don't need it.
@@ -3864,7 +3865,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
                copy_v3_v3(bp->origS, bp->pos);
                copy_v3_v3(bp->origE, bp->pos);
                copy_v3_v3(bp->origT, bp->pos);
-               bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f;
+               bp->vec[0] = bp->vec[1] = bp->vec[2] = 0.0f;
 
                /* the bp->prev*'s are for rolling back from a canceled try to propagate in time
                 * adaptive step size algo in a nutshell:
@@ -3924,7 +3925,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
 
        sst=PIL_check_seconds_timer();
        /* Integration back in time is possible in theory, but pretty useless here.
-        * So we refuse to do so. Since we do not know anything about 'outside' canges
+        * So we refuse to do so. Since we do not know anything about 'outside' changes
         * especially colliders we refuse to go more than 10 frames.
         */
        if (dtime < 0 || dtime > 10.5f) return;
@@ -4007,8 +4008,8 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
                        }
                        loops++;
                        if (sb->solverflags & SBSO_MONITOR ) {
-                               sct=PIL_check_seconds_timer();
-                               if (sct-sst > 0.5f) printf("%3.0f%% \r", 100.0f*timedone/dtime);
+                               sct = PIL_check_seconds_timer();
+                               if (sct - sst > 0.5) printf("%3.0f%% \r", 100.0f * timedone / dtime);
                        }
                        /* ask for user break */
                        if (SB_localInterruptCallBack && SB_localInterruptCallBack()) break;
@@ -4044,7 +4045,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
 
        if (sb->solverflags & SBSO_MONITOR ) {
                sct=PIL_check_seconds_timer();
-               if ((sct-sst > 0.5f) || (G.debug & G_DEBUG)) printf(" solver time %f sec %s\n", sct-sst, ob->id.name);
+               if ((sct - sst > 0.5) || (G.debug & G_DEBUG)) printf(" solver time %f sec %s\n", sct-sst, ob->id.name);
        }
 }
 
@@ -4107,18 +4108,6 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
                softbody_reset(ob, sb, vertexCos, numVerts);
        }
 
-       /* continue physics special case */
-       if (BKE_ptcache_get_continue_physics()) {
-               BKE_ptcache_invalidate(cache);
-               /* do simulation */
-               dtime = timescale;
-               softbody_update_positions(ob, sb, vertexCos, numVerts);
-               softbody_step(scene, ob, sb, dtime);
-               softbody_to_object(ob, vertexCos, numVerts, 0);
-               sb->last_frame = framenr;
-               return;
-       }
-
        /* still no points? go away */
        if (sb->totpoint==0) {
                return;