How to write this method definition in cocos2d-x.

Hello all,

I have read the cocosd-iphone tutorials at
http://www.raywenderlich.com/2010/02/19/intro-to-box2d-with-cocos2d-tutorial-bouncing-balls/
Here is a method that I have trouble converting into c++.

  • (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {

// Landscape left values
b2Vec2 gravity(acceleration.y * 15, acceleration.x *15);
_world
>SetGravity(gravity);

}

Please help.