-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgent.h
More file actions
52 lines (43 loc) · 973 Bytes
/
Agent.h
File metadata and controls
52 lines (43 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _AGENT
#define _AGENT
/*
* Agent.h
* openFrameworks
*
* Created by Joshua Walton on 12/5/08.
* Copyright 2008 Lab at Rockwell Group. All rights reserved.
*
*/
#include "ofMain.h"
#include "ofxVectorMath.h"
class Agent {
public:
ofxVec3f pos;
ofxVec3f vel;
ofxVec3f acc;
ofxVec3f origPos;
int elapsedTime;
int timeStarted;
int timeToLive;
int myID;
float myWidth, myHeight, myDepth;
float origWidth, origHeight, origDepth;
float alpha;
bool isVisible;
float damping;
Agent();
bool isDead();
// Behavior Functions
virtual void draw();
void addForce(ofxVec3f _force);
void addScale(float _scale);
virtual void update();
void resetForce();
void bounceOffWalls();
void addRepulsionForce(ofxVec3f _rforce, float radius, float scale);
void addAttractionForce(Agent & p, float radius, float scale);
void setInitialCondition(ofxVec3f ps, ofxVec3f vs);
void addDampingForce();
bool checkCollision(int _x, int _y);
};
#endif