Joints
In three dimensions, an object has six degrees of freedom. Three degrees of freedom come from translation and an additional three come from orientation. A constraint takes away one or more degrees of freedom. A joint is a type of constraint that limits the degrees of freedom between two objects. There are several common types of joints:
- Distance Joint: This keeps bodies a set distance apart
- Ball Joint: This limits translation to the pivot of two objects
- Hinge Joint: This allows for rotation around a single axis
- Slider Joint: This limits rotation and translation to a single axis
- Fixed Joint: This does not allow movement
- Motor Joint: This produces some kind of force
Several simple joints can be combined to create more complex joints. We can use joints to model hinges for doors, ragdolls that represent characters, or to simply stick objects to each other.
Getting ready
In this section, we will implement the simplest joint type there is—the Distance Joint. This joint will keep two particles...