[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30464] branches/soc-2010-aligorith-2/ source/blender/blenkernel/intern/rigidbody.c: Bullet SoC - Bugfixes

Joshua Leung aligorith at gmail.com
Sun Jul 18 13:12:23 CEST 2010


Revision: 30464
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30464
Author:   aligorith
Date:     2010-07-18 13:12:23 +0200 (Sun, 18 Jul 2010)

Log Message:
-----------
Bullet SoC - Bugfixes

* Changed the way the 'previous frame' is set when resetting the scene (i.e. when going back to start of sim to redo everything again). 

This fixes problems with the way that resetting a sim would actually end up stepping the sim once at the same time, resulting in the scene never getting truly reset, which was quite flaky.

Also, this seems to fix a crash that was preventing me from recording one of the videos I had planned...

* Added debug print to catch the situation where no geometry would get added to the collision shape, because none existed.
(Note: the previous commit also fixed performance issues with the 'Mesh' option. It turns out the overlooked prints there were causing the lags I was seeing ;)

Modified Paths:
--------------
    branches/soc-2010-aligorith-2/source/blender/blenkernel/intern/rigidbody.c

Modified: branches/soc-2010-aligorith-2/source/blender/blenkernel/intern/rigidbody.c
===================================================================
--- branches/soc-2010-aligorith-2/source/blender/blenkernel/intern/rigidbody.c	2010-07-18 10:58:41 UTC (rev 30463)
+++ branches/soc-2010-aligorith-2/source/blender/blenkernel/intern/rigidbody.c	2010-07-18 11:12:23 UTC (rev 30464)
@@ -219,6 +219,11 @@
 			}
 		}
 		
+		/* santiy checking - potential case when no data will be present */
+		if ((totvert == 0) || (totface == 0)) {
+			printf("WARNING: no geometry data converted for Mesh Collision Shape (ob = %s)\n", ob->id.name+2);
+		}
+		
 		/* construct collision shape */
 		shape = rbShapeNewTriMesh(mdata);
 		
@@ -637,14 +642,13 @@
 		//if (G.f & G_DEBUG)
 			printf("Need to reset sim\n");
 		
-		// XXX: reset flag could probably be removed...
 		rbw->recalc |= RBW_RECALC_RESET;
 		
 		/* if resetting, just rebuild everything, since that is guaranteed to make everything work */
 		rbw->recalc |= RBW_RECALC_REBUILD;
 		
-		/* set last time to start frame -1 so that timestep calculation will be correct */
-		rbw->ltime = rbw->sframe - 1;
+		/* set last time to start frame so that timestep calculation will be correct (nothing should change) */
+		rbw->ltime = rbw->sframe;
 	}
 	
 	/* if flag to rebuild physics worlds is set, we must clear and then rebuild all relevant links */





More information about the Bf-blender-cvs mailing list