diff trunk/chipmunkd/cpSpaceStep.d @ 23:4ceef5833c8c

updated to chipmunk 5.3.3
author Extrawurst
date Fri, 10 Dec 2010 02:10:27 +0100
parents c03a41d47b60
children 80058cee1a77
line wrap: on
line diff
--- a/trunk/chipmunkd/cpSpaceStep.d	Thu Dec 09 22:25:04 2010 +0100
+++ b/trunk/chipmunkd/cpSpaceStep.d	Fri Dec 10 02:10:27 2010 +0100
@@ -214,8 +214,8 @@
 contactSetFilter(cpArbiter *arb, cpSpace *space)
 {
 	if(space.sleepTimeThreshold != INFINITY){
-		cpBody *a = arb.private_a._body;
-		cpBody *b = arb.private_b._body;
+		cpBody *a = arb.a._body;
+		cpBody *b = arb.b._body;
 		
 		// both bodies are either static or sleeping
 		cpBool sleepingNow =
@@ -275,8 +275,6 @@
 	cpArray *bodies = space.bodies;
 	cpArray *constraints = space.constraints;
 	
-	space.locked = cpTrue;
-	
 	// Empty the arbiter list.
 	space.arbiters.num = 0;
 
@@ -289,12 +287,16 @@
 	// Pre-cache BBoxes and shape data.
 	cpSpaceHashEach(space.activeShapes, cast(cpSpaceHashIterator)&updateBBCache, null);
 	
+	space.locked = cpTrue;
+	
 	// Collide!
 	cpSpacePushFreshContactBuffer(space);
 	if(space.staticShapes.handleSet.entries)
 		cpSpaceHashEach(space.activeShapes, cast(cpSpaceHashIterator)&active2staticIter, space);
 	cpSpaceHashQueryRehash(space.activeShapes, cast(cpSpaceHashQueryFunc)&queryFunc, space);
 	
+	space.locked = cpFalse;
+	
 	// If body sleeping is enabled, do that now.
 	if(space.sleepTimeThreshold != INFINITY){
 		cpSpaceProcessComponents(space, dt);
@@ -349,7 +351,7 @@
 		}
 	}
 	
-	space.locked = cpFalse;
+	space.locked = cpTrue;
 	
 	// run the post solve callbacks
 	for(int i=0; i<arbiters.num; i++){
@@ -361,6 +363,8 @@
 		arb.state = cpArbiterState.cpArbiterStateNormal;
 	}
 	
+	space.locked = cpFalse;
+	
 	// Run the post step callbacks
 	// Loop because post step callbacks may create more post step callbacks
 	while(space.postStepCallbacks){