-
Notifications
You must be signed in to change notification settings - Fork 2
/
Table.h
53 lines (42 loc) · 1.01 KB
/
Table.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
/*
* Caleb Everett
* Graphics final
*
* Header for Table.
* Class draws a static table with bumpers and holes for pockets.
*/
#if !defined(TABLE_H)
#define TABLE_H
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
#include <btBulletDynamicsCommon.h>
#include <iostream>
#include <math.h>
#define bottomVertex_length 8
#define shortWallVertex_length 6
#define longWallVertex_length 6
using namespace std;
class Table
{
private:
// bullet stuff
btCollisionShape *bottomShape;
btMotionState *bottomMotionState;
btRigidBody *bottomRigidBody;
btCollisionShape *wallShape;
btMotionState *wallMotionState;
btRigidBody *wallRigidBody;
// vertex arrays for different parts of the table
static const float bottomVertex[bottomVertex_length][3];
static const float shortWallVertex[shortWallVertex_length][3];
static const float longWallVertex[longWallVertex_length][3];
public:
Table();
void add(btDiscreteDynamicsWorld *dynamicsWorld);
void draw();
~Table();
};
#endif