Game Development Reference
In-Depth Information
Constraints. The third and final main type of object within a rigid body
simulator is a constraint. Constraints are used to enforce relationships be-
tween pairs of rigid bodies, or between a rigid body and the world. Appli-
cations can create two types of user constraints: joints and motors. A third
type of constraint is the contact constraint, which is involved in collision
response.
User constraints are the “regular” kind of constraints that are specified
by the application in order to maintain some desired relationship. The
more common and easily understood type of constraint maintains a spatial
relationship between two parts and is known as a joint. Some examples
of the types of joints that come built-in to most physics engines are the
following.
A ball-and-socket joint constrains two objects such that a shared point
maintains a fixed position relative to each set of body axes. Alterna-
tively, you can think of one object having a ball at a fixed location
in its body space, and the other as having a socket in its body space,
and the constraint attempts to force those points to be coincident.
A hinge joint is a ball-and-socket joint with an additional constraint
that two axes, one connected to the ball and the other to the socket,
must be collinear. Thus the two objects can rotate about the shared
axis like a hinge. Additionally, limits may be set on the hinge rotation
angle.
A slider joint or prismatic joint operates on two axes that are fixed
relative to the body space of the two objects, constraining them to be
collinear. The objects may only slide back and forth along this axis,
or perhaps twist along it. Limits may be applied to the range of the
translation.
A universal joint is similar to a ball and socket joint, but allows for
limits to be specified on the angles of rotation. The angular limits
are Euler angles (think heading and pitch), resulting in a rectangular
range of motion. Limits on the twisting (“bank”) can also be enforced.
A conical joint is similar to a universal joint, but the rotation limits
are conical rather than rectangular.
As an example, in a human skeleton, each “bone” may be simulated as a
separate rigid body, with constraints used to attach each bone to its parent.
Hinge joints might be used at the knees, with limits set up to prevent the
Search WWH ::




Custom Search