// class declaration for a class of flocking objects (boids) // based on Craig Reynolds work from the 80's // Date: 23 October 2008 // Author: Don Allison #ifndef _BOIDS_H #define _BOIDS_H static const double rad = 0.2; // radius within which to interact with other boids class boids { public: boids(); ~boids(); void setx(double); void sety(double); double getnextx(void); double getnexty(void); void draw(void); void nextPosition(void); private: double x, y; // current x, y coordinates of boid double newx, newy; // next x, y coordinates of boid double cmx, cmy; // center of flock mass double vx, vy; // velocities double time,ntime; // old time and next step time }; #endif