The geometry module is a collection of generic geometric objects. Also, classes that are required by more than one other module. This is done to avoid dependency problems.
A Three_Vector
represents a vector in three-dimensions. Some
supported operations are
[]
+
and -
*
and /
*
dot()
and cross()
methods
project()
method
abs()
method
Matrix multiplication is done with a Three_Matrix
.
A Three_Matrix
represents 3x3 matrix. It's suitable for
representing a three-dimensional rotation matrix or inertia tensor.
Some suported operations are
[]
+
and -
*
and /
*
*
An inertia tensor is a matrix that describes a rigid body's responce
to torques. The Inertia_Tensor
generates the tensor from the
locations of masses on a body. The masses and positions are specified
using the add()
method. The inertia()
method returns
the moment of inertia for a force applied at a particular point on the
body.
A Two_Point
describes a point in a plane. It is a struct
with two data members, x
and y
. A constructor is provided
for initializing the members. No vector operations are supported, and
some of the supported operations are undefined for vectors. That's why
this class is called Two_Point
and not Two_Vector
. The
supported operations are scalar and member-wise addition, subtraction,
multiplication, and division. For the scalar versions, the operation is
performed on each member.
Spline
is the only user of Two_Point
. Perhaps it should
be defined in Spline
's header so that there's less temptation to
use Two_Point
inappropriately.
Spline
is a class for a parametric cubic spline interpolation
between points. A vector of Two_Point
s through which the curve
passes and angle of the curve at the first and last points are passed to
the constructor.
Spline
s are used to make smooth road elevation changes and banking
transitions.
A Surface
describes the friction, rolling resistance, restitution
and texture image of a surface such as pavement, grass or gravel.
The Texture Image
class provides a convenient way of reading a
*.ppm image file from the disk and for getting information about
the image.
The header file Conversions.h contains a few functions for performing frequently-used unit conversions. Currently, there are conversions for radians and degress, radians per second and revolutions per minute, and meters per second and kilometers per hour.