blob: 4114ad3457162217c4f58a7e5214778cc9456a59 (
plain)
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
53
54
55
56
57
|
#ifndef BIRD_H
#define BIRD_H
/*
Hostile bird character for 'Run the gauntlet' game
Tim Redfern April 2012
??how to manage visibility
Bird should automatically stay within viewing volume of camera
from the birds POV, The visible area is a frustrum extending down from the camera
1) like opensteer, extend the birds heading and decide whether this will hit the edge
2) have an actual model of the volume and work within it
3) how do we make the bird aware of players in front of it
--> this all implies being able to take a sightline from the bird and determine
-visibility of objects
-distance to obstructions
-build basic of time/speed/heading update/draw
-basic anim cycle
*/
#include "ofMain.h"
#include "morphmesh.h"
#include "normBindTexture.h"
class bird
{
public:
bird();
virtual ~bird();
void update(const vector<ofVec3f>& players);
void draw();
protected:
private:
ofVec3f position;
ofVec3f heading;
ofVec3f direction;
float velocity; //per second
float turnAngle; //per second
float diveAngle; //per second
float lastTime;
morphmesh model;
ofImage texture;
};
#endif // BIRD_H
|