Editing joints



See here for a video explaining this topic: YouTube

To edit joint you must first be in joint edit mode (shortcut key 'J').

Adding joints to the scene
Joints need two bodies to connect, so you cannot add them to the scene on their own. To add a joint you must first select the two bodies it should connect.

The order in which the bodies are selected will determine which will be 'body A' and 'body B' of the joint. The body selected first will become 'body A'. You can add joints when more than two bodies are selected, but the program will choose the body for 'body B' at random, so it's best to make sure you only have two bodies selected.

Once you have the two bodies selected, joints are added to them by using the action menu. To bring up the action menu you can either hit the Spacebar, or select the action under Scene in the main menu.

In most cases the new joint will be added using the cursor position as a reference point. Each joint type can have quite different settings and options so for more information see the topics below. R.U.B.E supports the following joint types.


Joint display
Joint types can be distiguished by their nub markers.

You can tell which is body A and body B by the color of the dashed lines connecting the body nub to the joint anchor position. Green for body A and blue for body B.

Most joints also display a red dashed line to show how dis-jointed the anchors currently are, in other words how far they are from the position that the physics engine will force them into when the simulation runs. Here is the result of running one step of the situation above - you can see that the joint anchors have been pulled together along the red dashed line.

Some joint types have more markings displayed, please see the specific joint type topics for more information.


Changing the bodies a joint connects
The bodies a joint connects can be changed by selecting the joint and then clicking the button in the Body A or Body B rows in the properties panel. This will enter a temporary mode where you should then select which body should be connected to.

The two bodies a joint connects must be different. If you select the same body for both bodies, a popup dialog will ask you if you want to swap the bodies.

You can also swap the body A and body B of a joint by selecting 'Joint'->'Switch bodyA/bodyB' from the action menu.


Manipulating joints
Joint anchor positions can be translated, rotated and scaled in a similar way to other items. The main difference is that one joint has two joint anchors. Initially the manipulation will start with the joint anchor for bodyA, and you can switch between joint anchors while manipulating them by hitting the same key that started the manipulation.

For example to begin translating joint anchors you would hit 'T', and this would begin translation of the joint anchor for body A. Hitting 'T' again would switch to translation of the joint anchor for body B.

Some joints have further options for manipulation. Distance and rope joints have an additional state for translation which sets the length of the joint. Prismatic and wheel joints have an additional state for setting the axis direction of the joint. These states can be cycled through by hitting the 'T' or 'R' keys, respectively.


Duplicating joints
Joints can be duplicated with the keyboard shortcut Shift+D. This will create a duplicate of all selected joints and then enters the translation control mode - because in most cases you will want to move the newly created joint anchors to another location.

Please note that even if you cancel the translation by hitting Escape, the new joints have already been created. A common pitfall when duplicating joints and then cancelling the translation, is that the new joints will be in exactly the same position as the original ones, and it's easy to forget that they are there. If you want to cancel the duplication completely you will need to undo once after cancelling the translation.


Copying and pasting joints
A selection of joints cannot be copied and pasted to an arbitrary selection of bodies. You can copy and paste the bodies they connect which will cause the joints to be copied as well, or you can duplicate the joints and then change the bodies they connect as mentioned above.


Deleting joints
Joints can be deleted by selecting them and pressing the Delete key.