Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef BOID_H
- #define BOID_H
- // Forward declarations:
- class Application;
- class Graphics;
- #include "Vector2D.h"
- #include "Boid.h"
- class Boid {
- private:
- Vector2D* lastPosition;
- Vector2D* position;
- Vector2D* velocity;
- unsigned int color;
- Application* owner;
- public:
- Boid(Application* argOwner, int argX, int argY);
- void update(void);
- void draw(Graphics* g);
- void setColor(unsigned int argColor) { color = argColor; }
- Vector2D* getPosition() { return position; }
- Vector2D* getVelocity() { return velocity; }
- Vector2D* getNormalizedDirection(void) {
- Vector2D* direction = new Vector2D(velocity->x, velocity->y);
- direction->normalize();
- return direction;
- }
- };
- #endif
Add Comment
Please, Sign In to add comment