-
Notifications
You must be signed in to change notification settings - Fork 0
/
bowl.cpp
74 lines (52 loc) · 890 Bytes
/
bowl.cpp
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
#include "bowl.h"
#include "math.h"
#include "lina.h"
#include <GL/glut.h>
bowl::bowl(Vector vPos3, Vector vPace3, bool bmove)
{
oldPos.resize(3);
pos.resize(3);
pos[0] = vPos3[0];
pos[1] = vPos3[1];
pos[2] = vPos3[2];
pace.resize(3);
pace[0] = vPace3[0];
pace[1] = vPace3[1];
pace[2] = vPace3[2];
move = bmove;
gravity = 0.001f;
radius = 0.1f;
friction = 0.8f;
}
bowl::bowl()
{
oldPos.resize(3);
pos.resize(3);
pos[0] = 0.0f;
pos[1] = 0.0f;
pos[2] = 0.0f;
pace.resize(3);
pace[0] = 0.0f;
pace[1] = 0.0f;
pace[2] = 0.0f;
radius = 0.1f;
move = true;
fixed = false;
gravity = 0.001f;
friction = 0.8f;
}
void bowl::updatePosition(float deltaT)
{
if(!fixed)
{
oldPos[0] = pos[0];
oldPos[1] = pos[1];
oldPos[2] = pos[2];
pos[0] += pace[0];
pos[1] += pace[1];
pos[2] += pace[2];
}
}
bowl::~bowl(void)
{
}