anyKode Marilou

Create a joint between two rigid bodies.

Joints are used to bring to rigid bodies together with varying degrees of movement. In this example, we use the joint called Hinge (1 axis), which will connect an "arm" to a "base". 



Creating a Hinge joint entity and connecting it to the rigid body:
Here we use work carried out in Marilou tutorials 1 & 2.
The base is composed of two boxes assembled as a solid body.
The arm is a simple box, as well as a solid body.
If we run the simulator at this point, the arm would fall to the ground, as it is not yet connected to anything.
Let's start be creating the joint between these two solid bodies. 
Creating a jointed entity

  • In the Add panel, select the Link tab
  • Click on Hinge to activate creation mode.
  • Move the cursor over the perspective view (the cursor changes to red, indicating that creation mode is activated).
  • Left-click in the view at the spot where you would like to begin creating the solid body.
  • Holding the mouse button down, move the cursor to set the entity's size, then release the button (the size is only for visual purposes and does not have any effect on simulation).


At this point the joint is laying on the ground and is not connected.

Switch to selection mode to continue. 

  • Select the joint and display its properties.
  • Click on the "..." button to select the 2 rigid bodies to connect.



  • A straight line between the joint and the rigid bodies is displayed.


Rotation of the body /body_arm with respect to the base (/body_socle) takes place around the joint’s axis.
Now we need to move the joint so that it is closer to the green box's axis.

You may now run the simulator, and the arm will pivot around the joint's axis.
Please notice that the arm "goes through" the green box. In order to allow collision detection between two dynamic objects connected by a joint, activate the Collides with connected body(s) options for the two rigid bodies used in the example. 
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
What do you think about this topic? Send feedback!