Rotating level around a ball's center

marcovtwout

29-09-2009 13:59:28

Hi all,

I have been experimenting with Ogre and OgreNewt.
I am trying to create a Super Monkey Ball like game design.
Here's a quick demo video of the above game: http://www.youtube.com/watch?v=FpZcHphby7E

I created a basic scene with a platform and a ball.
The platform is a simple box set as a TreeCollision object. Using WSAD I can tilt the platform 20 degrees in four directions.
The ball is a simple Ellipsoid/Sphere with mass and standard gravity added.


What I am trying to accomplish: The pivot point of the platform, is supposed to be the center of the ball. This is nessesary so the ball behaves exactly the same, wherever it is on the platform. Imagine if the ball is on the far right, and the platform would rotate left, the platform would launch the ball upwards.

Is there an easy way to change the pivot point of the Body I am trying to rotate? I currently use setPositionOrientation() to change the level body (which updates the levelnode and visual platform). Any inputs are appreciated :)