Implementing Flocking

flock0

Step 1: Create a class to represent the boids and their motion.

This class has position, velocity, & acceleration vectors, and updates the position and velocity on each frame.

The boid class is primarily going to serve as the intelligence of the creatures. We need to have some way to use the data from this in our 3D scene. I've chosen to make the boid class a type of dms::Object, so that it can be inserted into a libdms scene graph. The class will create & update a transformation, but will have no geometry - the geometry is taken care of by attaching some other object to the boid. This way the intelligence is independent of what the creatures look like.

flock0.cpp
boid0.h
boid0.cpp