Game Development Reference
In-Depth Information
-9-
Quaternion-Based Constraints
Claude Lacoursiere
9.1
Introduction
The content in the present chapter will help us define rotational constraints be-
tween rigid bodies that are never unstable and that always return to the correct
configuration. This means, in particular, that a hinge joint defined the way I ex-
plain below will never stabilize in an antiparallel configuration, no matter how
much abuse it is subjected to. There is also a true constant velocity joint that
we can use to replace our Hooke joints. This is in fact more useful since it truly
transmits the rotational motion faithfully. There is a lot of mathematics involved,
but the final results are easy to implement. If you get lost or impatient, just look
at the pictures and jump to the last few paragraphs of each section.
9.2 Notation and Definitions
In what follows, I will write about indicator functions c ( x )—indicator for short—
such that a geometric constraint is satisfied when c ( x )=0and violated other-
wise. Here, x is the generalized coordinate vector that contains information about
the positions and orientations of all bodies. Indicators are then vector functions
of a vector argument because we often consider multiple indicators to be a single
object. We need two scalar indicators to define a hinge, for instance. When I say
constraint, I mean a hinge joint.
When I write y ( x ) , I mean quantity y in body x . Subscripts are reserved
for components of vectors. Quaternions are written as q , and the components
are written q =[ q s ,q 1 ,q 2 ,q 3 ] T and in block form as q =[ q s , q v ] T . Here, q s
stands for the scalar part. The complex conjugates are written as q . Vectors are
written as x ,and most matrices are written with bold upper-case letters, such as A .
But I also use certain special parametric matrices that are written as
G
( q ),
E
( q ),
Q
( q ),and
P
( q ), which are defined from a quaternion q
H
in Section 9.5. I
write
P
for projection operators. The vectors are always columns unless explicitly