![Wink ;)](./images/smilies/icon_e_wink.gif)
Move selected Bodies to cursor position.
Move selected Bodies to cursor position.
See the title ![Wink ;)](./images/smilies/icon_e_wink.gif)
![Wink ;)](./images/smilies/icon_e_wink.gif)
- Attachments
-
- postoCursor.zip
- (644 Bytes) Downloaded 1234 times
Re: Move selected Bodies to cursor position.
aha... there is something in Blender a bit like this, I think it's called 'Selection to cursor', so it's the reverse of the 'Cursor to selection'.
I was thinking of adding it someday, but in Blender it moves the selection as a whole to the cursor. In RUBE the selection is the white cross shown when more than one item is selected. So 'Selection to cursor' would move all the bodies so that the white cross moves to the cursor, which I think is a bit more useful than clumping all selected bodies at the same place. The white cross is simply the average of the currently selected body positions. I will add this eventually, but if you feel like doing it don't let me stop you![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
I was thinking of adding it someday, but in Blender it moves the selection as a whole to the cursor. In RUBE the selection is the white cross shown when more than one item is selected. So 'Selection to cursor' would move all the bodies so that the white cross moves to the cursor, which I think is a bit more useful than clumping all selected bodies at the same place. The white cross is simply the average of the currently selected body positions. I will add this eventually, but if you feel like doing it don't let me stop you
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Re: Move selected Bodies to cursor position.
Align one axis. Use cursor position too, but adjust Y or X, and move selected bodies to horizontal or vertical line.
Code: Select all
vec2 pb = getCursor();
body[] sb = getSelectedBodies();
int n = sb.length;
for (int i = 0; i < n; i++) {
sb[i].setPos(pb.x, sb[i].pos.y);
}
Code: Select all
vec2 pb = getCursor();
body[] sb = getSelectedBodies();
int n = sb.length;
for (int i = 0; i < n; i++) {
sb[i].setPos(sb[i].pos.x, pb.y);
}