Using constraints to limit movement of objects
Until now, we've seen some basic physics in action. We've seen how the various shapes respond to gravity, friction, and restitution and how they affect collisions. Physijs also provides advanced constructs that allow you to limit the movement of your objects. In Physijs, these objects are called constraints. The following table gives an overview of the constraints that are available in Physijs:
Constraint |
Description |
---|---|
|
This allows you to fix the position of one object to the position of another object. If one object moves, the other will move with it, keeping the distance and orientation between them the same. |
|
|
|
This constraint, as the name implies, allows you to limit the movement of an object to a single axis, for instance, a sliding door. |
|
With... |