HOWTO: rotate connected bodies around joint in editor

General discussion about the R.U.B.E editor
Post Reply
fisher
Posts: 6
Joined: Sat Feb 15, 2014 9:31 pm

HOWTO: rotate connected bodies around joint in editor

Post 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?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: HOWTO: rotate connected bodies around joint in editor

Post by iforce2d »

I don't quite understand... is it not possible to put the cursor at the location you want to rotate around?
fisher
Posts: 6
Joined: Sat Feb 15, 2014 9:31 pm

Re: HOWTO: rotate connected bodies around joint in editor

Post 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
force2d.png (18.88 KiB) Viewed 8532 times
force2d1.png
force2d1.png (18.32 KiB) Viewed 8532 times
Designated body stays in place, other bodies can be manipulated.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: HOWTO: rotate connected bodies around joint in editor

Post 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.
Post Reply