Next: , Previous: The Geometry Library, Up: Code Reference


3.10 The Track Library

A Track is a collection of straight and curved pieces of road. These pieces are described by classes derived from Road_Segment. Currently, we have a straight segment class (Straight_Road), and a circle arc segment class (Arc_Road). The track is assembled so that there are no corners where two segments join.

If you look at the code you'll find a class for a segment that smoothly curves through a set of given points (Spline_Road). This class has been commented out because I don't know how to do the transformation from world coordinates to track coordinates for a spline.

The elevation and banking at any number of points on a segment can be specified. The specified points are interpolated with a cubic spline so that the transitions are smooth.

     Track o---Road_Segment
                ^     ^
               /       \
     Straight_Road    Arc_Road