You can use a rigid joint to constrain two bodies as if they were fastened together.
An example of a rigid joint is two beams fastened to one another.