-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.h
More file actions
56 lines (40 loc) · 1.64 KB
/
Application.h
File metadata and controls
56 lines (40 loc) · 1.64 KB
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
#ifndef APPLICATION_H
#define APPLICATION_H
//------------- include/declaration -------------
#include "OpenGL/GlutDemoApplication.h"
#include "BulletSoftBody/btSoftBody.h"
class btBroadphaseInterface;
class btCollisionShape;
class btCollisionDispatcher;
class btConstraintSolver;
class btDefaultCollisionConfiguration;
// User include
class Creature;
class Scene;
//-----------------------------------------------
class Application : public GlutDemoApplication {
public:
Application() : m_creature(NULL), m_scene(NULL), m_elapsedTime(0) {}
virtual ~Application() { exitPhysics(); } // Destructor
void initPhysics(); // Initialize the simulation
void Init_Torus();
void exitPhysics(); // End the simulation
protected:
virtual void clientMoveAndDisplay(); // Update the simulation
virtual void displayCallback(); // Render the simulation
virtual void keyboardCallback(unsigned char key, int x, int y); // Input management
void resetScene(const btVector3& startOffset); // Reset the creature
void update(); // Update objects and display the time elapsed under balance
Creature * m_creature; // The creature
Scene * m_scene; // The scene
btCollisionShape * m_ground; // The ground
btBroadphaseInterface * m_broadphase; // The broadphase
btCollisionDispatcher * m_dispatcher; // The displatcher
btConstraintSolver * m_solver; // The solver
btDefaultCollisionConfiguration * m_collisionConfiguration; // The collision configuration
btSoftBodyWorldInfo m_softBodyWorldInfo;
DWORD m_startTime; // Time starter
DWORD m_currentTime; // Time counter
int m_elapsedTime; // Time elapsed in 10e-1 sec
};
#endif