Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed a bug where the physics simulation was only stepped once.

  • Loading branch information...
commit d6584380dc931d9d16c21a0b60ba229e0704d668 1 parent 171c59d
@termhn termhn authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 Bullet Wrapping/Wrapper/CC3PhysicsWorld.mm
View
5 Bullet Wrapping/Wrapper/CC3PhysicsWorld.mm
@@ -29,6 +29,7 @@
#import "CC3PhysicsWorld.h"
#import "CC3PhysicsObject3D.h"
#import "CC3MotionState.h"
+#import "cocos2d.h"
@implementation CC3PhysicsWorld
@@ -45,6 +46,7 @@ - (id) init {
solver = new btSequentialImpulseConstraintSolver();
dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);
[self setDiscreteDynamicsWorld:dynamicsWorld];
+ [[CCScheduler sharedScheduler] scheduleSelector:@selector(updateGlobalTransformation) forTarget:self interval:0 paused:NO];
}
return self;
@@ -100,7 +102,7 @@ - (void) removeAllChildren
[_physicsObjects removeAllObjects];
}
-- (void) udpateGlobalTransformation:(CC3GLMatrix *)parentTransformation
+- (void) udpateGlobalTransformation
{
// Get time since last step
NSDate * currentTime = [[NSDate alloc] init];
@@ -149,3 +151,4 @@ - (CC3PhysicsObject3D *) createPhysicsObject:(CC3Node *)node shape:(btCollisionS
}
@end
+
Please sign in to comment.
Something went wrong with that request. Please try again.