-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cup.h
55 lines (43 loc) · 1.11 KB
/
Cup.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
/*
* Caleb Everett
* graphics final
*
* Header for Cup
* Defines 6 pockets for balls to go in.
*/
#if !defined(CUP_H)
#define CUP_H
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
#include <btBulletDynamicsCommon.h>
#include <iostream>
#include <math.h>
#define sideBottom_length 8
#define sideWall_length 8
#define cornerBottom_length 8
#define cornerWall_length 8
using namespace std;
class Cup
{
private:
//bullet stuff
btCollisionShape *bottomShape;
btMotionState *bottomMotionState;
btRigidBody *bottomRigidBody;
btCollisionShape *wallShape;
btMotionState *wallMotionState;
btRigidBody *wallRigidBody;
// vertex arrays for drawing the 6 cups. sideBottom and cornerBottom are not used, cups are just shutes, balls can fall out
static const float sideBottomVertex[sideBottom_length][3];
static const float sideWallVertex[sideWall_length][3];
static const float cornerBottomVertex[cornerBottom_length][3];
static const float cornerWallVertex[cornerWall_length][3];
public:
Cup();
void add(btDiscreteDynamicsWorld *dynamicsWorld);
void draw();
};
#endif