Game Development Reference
We n o w h a v e a Quaternion class that contains all the functionality we need for the
rest of the engine. As with vectors and matrices, there are a lot of other operations
we could add—more conversions, other mathematical operators. If you are using an
existing quaternion library, it might have other functions defined, but since we will
not need them, I will avoid giving implementations that we won't use.
We have come a long way in this chapter, and if you weren't familiar with matrices and
quaternions before, then this has been a big step. We've now met all the mathematics
we need to see us through to our final physics engine.
In this chapter I've hinted at the way some of this mathematics is used in the
engine. Chapter 10 starts to rebuild our engine to support full 3D rigid bodies, with