Game Development Reference
beyond our scope here, and I think we can manage better with good logic code to
catch the problem cases.
The theory below is an overkill, but the results are easy to implement and not
much more expensive computationally than the standard dot product versions.
Three constraints are analyzed in detail, namely, the lock joint, the hinge joint,
and the homokinetic joint. This last one is also known as the constant velocity
joint, CV for short. It is much like the Hooke or universal joint but without the
problems. The Hooke joint is easy to define as a bistable constraint in dot prod-
uct form. It seems that it is not possible to define a monostable version without
introducing a third body that is hinged to the other two. If we look at a good
diagram and animations of the Hooke joint [Wikipedia 10b], we will see clearly
why a third body is needed. But more to the point, the CV joint is the one we see
in our front traction cars, since otherwise, the wheels would not move at constant
rotational velocity. Curiously, though it is an engineering puzzle to construct a
CV joint [Wikipedia 10a] that is not fragile, it is dead easy to define the geome-
try using quaternions. A homokinetic joint can be constructed using two hinges,
and this makes the analysis much more complicated [Masarati and Morandini 08]
than the quaternion definition given below.
These three rotational joints are used in combination with positional con-
straints to produce all other joints, namely, the “real” hinge, the prismatic of the
sliding joint that requires the full lock constraint, the cylindrical joint that requires
the hinge constraint, etc. A robust Hooke joint can also be built out of three bodies
using two hinges.
In what follows, I will first explain the indicators themselves by looking at
special quaternions and the geometry of the resulting kinematics. Then, I will
explain how to construct the Jacobians for these.
9.4 Constraint Definitions
It is enough to consider just one quaternion q describing the orientation of one
rigid body with respect to the inertial frame to start with. This is because, in the
end, the quaternion used in the constraint will be the relative rotation going from
body 1 to body 2. That will simplify things and save our time. Also note that in
this first stage, I assume that both our hinge and CV axes are aligned along z in
each body. Generalizations are provided below.
The quaternion that corresponds to no rotation at all is just the unit quater-
q s =1 , q v T =[0 , 0 , 0] T .