A physics joint connects one physics object to another (or to a fixed point in space), constraining how it can move.
For instance, a door might swing on its hinges. In a physics simulation, the hinges would be represented by a joint with a single degree of freedom (DOF): rotation around the axis of the hinges.
Or the door might slide along a track. In that case, the track would be represented by a joint that’s free only to translate along the axis of the track.
Or you might have a robot arm mounted on a ball-and-socket: it can freely turn and twist to any imaginable orientation, but can’t leave its socket. (This requires 3 degrees of freedom.)
A 6-DOF joint is a very flexible joint with 3 rotation DOFs and 3 translation DOFs. It can rotate or slide on any axis. This makes it useful for simulating other kinds of joints.
- To simulate a swinging door, you’d lock all 3 translation DOFs and all but one of the rotation DOFs.
- To simulate a sliding door, you’d lock all 3 rotation DOFs and all but one of the translation DOFs.
- To simulate a ball-and-socket, you’d disable all 3 of the translation DOFs.
In addition to locking DOFs, Bullet’s 6-DOF joints also implement limits, springs, motors, and servos for each DOF:
- Using a limit, you can keep a door from sliding/swinging past certain points.
- Using a spring, you can make a door automatically return to the closed position when you release it.
- Using a motor, you can control the rate at which a door opens and closes.
- Using a servo, you can make a robot arm turn smoothly from one orientation to another.