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); }
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); } }
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); } }
void cBody::UpdatePosition( cpFloat dt ) { cpBodyUpdatePosition( mBody, dt ); }
static VALUE rb_cpBodyUpdatePosition(VALUE self, VALUE dt) { cpBodyUpdatePosition(BODY(self), NUM2DBL(dt)); return self; }
void Body::updatePosition(cpFloat dt) { cpBodyUpdatePosition(body,dt); }