Page 1 of 1

Rotating space

Posted: Thu Nov 15, 2012 12:39 pm
by Zaxuhe
Is there any simple way to rotate all the objects on a space around a given point? thank you!

Re: Rotating space

Posted: Thu Nov 15, 2012 1:08 pm
by slembcke
If you just want the static parts to rotate and all the shapes are attached to a shared static body you could update the static body manually (position and velocity) each frame and then call cpSpaceReindexStatic(). If the static parts are never static ever, you should just use a rogue body instead. Depending on how many static things you have in your space, this could be really expensive though.

If you want to rotate *everything* in the space including all the dynamic objects, then you might as well just rotate the graphics instead. Nothing really would have moved, so just rotating the viewport/camera/whatever would be equivalent and much easier.