-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbird.h
132 lines (94 loc) · 2.59 KB
/
bird.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#ifndef BIRD_INC_GUARD
#define BIRD_INC_GUARD
#define BEAK_INNER_SIDE_LEN 1.0
#define BEAK_SHIFT 0.5
#define BEAK_OUTER_SIDE_LEN 2.0
#define BIRD_LENGTH 10.0
#define BIRD_HEIGHT 4.0
#define BEAK_LENGTH 4.0
#define NUM_HEAD_RADI 5
#define HEAD_END_RAD 4.0
#define HEAD_END_SHIFT 1
#define HEAD_END_LENGTH 2.0
#define HEAD_INNER_RAD 4.5
#define HEAD_INNER_X_SHIFT 2.1
#define HEAD_INNER_SHIFT 0.25
#define HEAD_INNER_LENGTH 2.0
#define HEAD_START_RAD 3.0
#define HEAD_START_SHIFT 1.25
#define HEAD_START_X_SHIFT 2.20
#define HEAD_START_LENGTH 2.0
#define BODY_FRONT_RAD 3.5
#define BODY_FRONT_SHIFT 0.25
#define BODY_FRONT_X_SHIFT 1.5
#define BODY_FRONT_LENGTH 2.5
#define BODY_MID_RAD 4
#define BODY_MID_LENGTH 4
#define BODY_MID_X_SHIFT 1.75
#define BODY_MID_SHIFT 1
#define BODY_BACK_RAD 4
#define BODY_BACK_LENGTH 15
#define BODY_BACK_X_SHIFT 2
#define BODY_BACK_SHIFT 0
#define BODY_REAR_RAD 1
#define BODY_REAR_LENGTH 2
#define BODY_REAR_X_SHIFT 2.5
#define BODY_REAR_SHIFT 0
#define NOT_FLAPPING 0
#define FLAPPING_DOWN 1
#define FLAPPING_UP 2
#define RETURNING 3
#define BEAK_R 0.94902
#define BEAK_G 0.623529
#define BEAK_B 0.121569
#define HEAD_R 153
#define HEAD_G 42
#define HEAD_B 89
#define BACK_HEAD_R 153
#define BACK_HEAD_G 42
#define BACK_HEAD_B 42
#define BODY_R 153
#define BODY_G 42
#define BODY_B 42
#define WING_R 70
#define WING_G 83
#define WING_B 14
#define NUM_WING_GUIDE_POINTS 5
#define BIRD_SCALE 7
#include <stdio.h>
#include <stdlib.h>
#include "bird_physics.h"
#include "quadobj.h"
typedef struct
{
QuadObject quadObject;
int flapping;
float flappingAmount;
int * frontTopLeftWing;
int * backTopLeftWing;
int * frontBottomLeftWing;
int * backBottomLeftWing;
int * frontTopRightWing;
int * backTopRightWing;
int * frontBottomRightWing;
int * backBottomRightWing;
ColoredVertex * origFrontTopLeftWing;
ColoredVertex * origBackTopLeftWing;
ColoredVertex * origFrontBottomLeftWing;
ColoredVertex * origBackBottomLeftWing;
ColoredVertex * origFrontTopRightWing;
ColoredVertex * origBackTopRightWing;
ColoredVertex * origFrontBottomRightWing;
ColoredVertex * origBackBottomRightWing;
int startWingQuadIndex;
int endWingQuadIndex;
Bird_physics * bird_physics;
} Bird;
void bird_initBird(Bird * birdPtr, Bird_physics * bird_physics_ptr);
void bird_initBirdModel(Bird * birdModelPtr);
void bird_draw(Bird * birdPtr);
void bird_flap(Bird * birdPtr);
void bird_animate(Bird * birdPtr);
void bird_step(Bird * birdPtr, Bird_physics * bird_physics, float timestep);
void bird_setParams(Bird * birdPtr);
#endif