Next: , Previous: Units, Up: Top


3 Code Reference

The code is devided into four modules that reside in four namespaces, Vamos_Geometry, Vamos_Body, Vamos_Track and Vamos_World. Each namespace contains the code for a library. These libraries are libvamos-geometry, libvamos-body, libvamos-track, and libvamos-world. The geometry library has classes for vectors, matrices and curves. The body library has a class for a rigid body and classes for a car and its parts. It also has other classes that are needed by more than one of the other libraries. The track library has the classes needed for building a track. The world library handles a rigid body's interaction with the track.

The geometry library is used by both the body and world libraries. The body library is used by the world library. The dependency graph looks like this:

                libvamos-geometry
               /        |        \
             o          |          o
     libvamos-track     |      libvamos-body
             \          o         /
               o libvamos-world o

where

     libA o-- libB

means that library libA depends on library libB. That is, classes in libA include headers from libB. Also a program that links libA must also link libB.

If you only need the services of the geometry library, then you only have one library to link. If you use the body library, then you need to link the geometry library as well. If you use the world library, then you need to link all four. When linking multiple libraries you may need to make sure that libvamos-geometry is linked first, followed by libvamos-body, and then libvamos-world. If you get errors from the linker about undefined references to functions defined in one of these libraries, then you may have to adjust the link order.

Care was taken to avoid a dependency of libvamos-track on libvamos-body and vice versa. This allows cars and tracks to tested independently.