Page 1 of 1
HOWTO: rotate connected bodies around joint in editor
Posted: Tue Feb 18, 2014 10:11 pm
by fisher
Because if I'm not mistaken, bodies only rotate around cursor.
When I selected joint, I'd like to rotate all connected bodies around this joint - as I can playing with it in player view, but want to make the same change in editor. In other words: set bodies initial position with mouse and joints connections working in edit mode. Is it possible?
Re: HOWTO: rotate connected bodies around joint in editor
Posted: Wed Feb 19, 2014 2:57 am
by iforce2d
I don't quite understand... is it not possible to put the cursor at the location you want to rotate around?
Re: HOWTO: rotate connected bodies around joint in editor
Posted: Sat Feb 22, 2014 10:40 am
by fisher
In other words, I think not about rotating selected object about cursor, but about modifying all bodies connected with joints, like on images below:

- force2d.png (18.88 KiB) Viewed 17588 times

- force2d1.png (18.32 KiB) Viewed 17588 times
Designated body stays in place, other bodies can be manipulated.
Re: HOWTO: rotate connected bodies around joint in editor
Posted: Sat Feb 22, 2014 11:50 am
by iforce2d
So you mean, you want to have the physics simulation running inside the editor view, for just a sub-set of the bodies? This is planned to be added sometime in the future, but when and exactly how it will be implemented I'm not sure right now.
The best you can do now is to rotate step by step, placing the joint position at the cursor each step. So for example in the case you pictured, you would start with the bottom two bodies selected, and place the cursor at the position of the upper joint - you can do that with shortcut C,S ('cursor to selection'). After rotating both lower bodies together, you would then deselect the middle one and move the cursor to the position of the lower joint, and rotate the bottom body by itself. It's handy to have two views open, one in joint mode and one in body mode.
Alternatively, if the bottom body will be pinned in place when the scene runs, you can just move the bottom body to the position it should be in, and run the physics simulation for a few steps to let the middle body relax to the central position. That's assuming you are able to run a few steps after loading the scene of course.
Let me know if I'm not understanding what you mean.