static void
update(cpSpace *space, double dt)
{
	cpSpaceStep(space, dt);
	
	// Update the static body spin so that it looks like it's rotating.
	cpBodyUpdatePosition(planetBody, dt);
}
Beispiel #2
0
static void
update(int ticks)
{
	int steps = 3;
	cpFloat dt = 1.0f/60.0f/(cpFloat)steps;
	
	for(int i=0; i<steps; i++){
		cpSpaceStep(space, dt);
		
		// Manually update the position of the box body so that the box rotates.
		// Normally Chipmunk calls this and cpBodyUpdateVelocity() for you,
		// but we wanted to control the angular velocity explicitly.
		cpBodyUpdatePosition(rogueBoxBody, dt);
	}
}
Beispiel #3
0
static void
update(int ticks)
{
	int steps = 3;
	cpFloat dt = 1.0f/60.0f/(cpFloat)steps;
	
	for(int i=0; i<steps; i++){
		cpSpaceStep(space, dt);
		
		// Manually update the position of the static shape so that
		// the box rotates.
		cpBodyUpdatePosition(staticBody, dt);
		
		// Because the box was added as a static shape and we moved it
		// we need to manually rehash the static spatial hash.
		cpSpaceRehashStatic(space);
	}
}
Beispiel #4
0
void cBody::UpdatePosition( cpFloat dt ) {
	cpBodyUpdatePosition( mBody, dt );
}
Beispiel #5
0
static VALUE
rb_cpBodyUpdatePosition(VALUE self, VALUE dt) {
  cpBodyUpdatePosition(BODY(self), NUM2DBL(dt));
  return self;
}
Beispiel #6
0
void Body::updatePosition(cpFloat dt)
{
		cpBodyUpdatePosition(body,dt);
}