-
Notifications
You must be signed in to change notification settings - Fork 2
/
CrowdObject.h
50 lines (35 loc) · 1.1 KB
/
CrowdObject.h
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
#ifndef _CROWD_H_
#define _CROWD_H_
#include "constants.h"
#include <jsoncpp/value.h>
enum objtype {AGENT,
WALL,
OBSTACLE,
FALLEN_AGENT,
ATTRACTOR};
class CrowdObject {
private:
v2f pos;
protected:
v2f norm;
objtype myType;
public:
CrowdObject( Json::Value c );
CrowdObject( );
//returns whether the object is visible within the vision rectangle presented
virtual bool isVisible( v2f pos, v2f dir, float vislength, float viswidth);
//returns the norm of the object in the return parameter
virtual void getNorm( v2f ret );
//gets the distance from the position argument to the object
virtual float getDistance( v2f pos );
//gets the direction vector from the calling position to the object
virtual void getDirection( v2f pos, v2f res);
//gets the type of object
int getType();
//returns a zero-vector for all non-agent CrowdObjects
virtual void getVelocity( v2f ret );
//functions needed by Agent - leaky abstractions
virtual void getPos( v2f ret) {v2fMult( ret, 0.0, ret ); return;}
virtual float getRadius() {return 0.0;}
};
#endif