This project has moved and is read-only. For the latest updates, please go here.

Body's rotation center

Jul 20, 2008 at 6:38 PM


I'm experimenting with Farseer for some time and I think it is great. I'm still missing a feature here. I'd like to move the rotation center of the Body. I have a camera looking at a quite big and complex (lots of Geoms) static Body (this is my game world). What I want to achieve is to make the object rotate around the camera. The camera can move so I need to move the rotation center.

I've tried to move the Body's center to the camera's position, and move the Geoms to the opposite direction, but the Geoms are not movable. Does anyone have any idea how to work around this problem?

Thank you.

Jul 28, 2008 at 5:32 PM
Why are you trying to move static bodies?  If you want this spinning body to smack other objects as it spins, it shouldn't be static.  If this is just to make the view rotate, then you should be making the changes when drawing the objects to the screen, without moving the physics objects.  Just change the change the direction of gravity if you want things to appear to fall "down" when the view is rotated.

Am I on the right track?
Jul 29, 2008 at 8:33 AM

Oh you are right. The basic idea around the game I'm building is to guide some objects through a maze, where you can rotate the maze. Now I'm separated the maze into lots of bodies and rotating those, but your solution of rotating the gravity is way mutch better. I only need to point the camera to the object and rotate it, so the gravity should always look down.

Thank you, I'm going to try this one.