Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Demos / GyroscopicDemo / GyroscopicDemo.h
1 /*\r
2 Bullet Continuous Collision Detection and Physics Library\r
3 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/\r
4 \r
5 This software is provided 'as-is', without any express or implied warranty.\r
6 In no event will the authors be held liable for any damages arising from the use of this software.\r
7 Permission is granted to anyone to use this software for any purpose, \r
8 including commercial applications, and to alter it and redistribute it freely, \r
9 subject to the following restrictions:\r
10 \r
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\r
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\r
13 3. This notice may not be removed or altered from any source distribution.\r
14 */\r
15 #ifndef BT_GYROSCOPIC_DEMO_H\r
16 #define BT_GYROSCOPIC_DEMO_H\r
17 \r
18 #ifdef _WINDOWS\r
19 #include "Win32DemoApplication.h"\r
20 #define PlatformDemoApplication Win32DemoApplication\r
21 #else\r
22 #include "GlutDemoApplication.h"\r
23 #define PlatformDemoApplication GlutDemoApplication\r
24 #endif\r
25 \r
26 ///GyroscopicDemo shows how to create a constraint, like Hinge or btGenericD6constraint\r
27 class GyroscopicDemo : public PlatformDemoApplication\r
28 {\r
29         //keep track of variables to delete memory at the end\r
30         btAlignedObjectArray<btCollisionShape*> m_collisionShapes;\r
31 \r
32         class btBroadphaseInterface*    m_overlappingPairCache;\r
33 \r
34         class btCollisionDispatcher*    m_dispatcher;\r
35 \r
36         class btConstraintSolver*       m_constraintSolver;\r
37 \r
38         class btDefaultCollisionConfiguration* m_collisionConfiguration;\r
39 \r
40         void    setupEmptyDynamicsWorld();\r
41 \r
42         void    clientResetScene();\r
43 \r
44 \r
45         public:\r
46 \r
47         GyroscopicDemo();\r
48 \r
49         virtual ~GyroscopicDemo();\r
50 \r
51         void    initPhysics();\r
52 \r
53         void    exitPhysics();\r
54 \r
55         virtual void clientMoveAndDisplay();\r
56 \r
57         virtual void displayCallback();\r
58 \r
59         static DemoApplication* Create()\r
60         {\r
61                 GyroscopicDemo* demo = new GyroscopicDemo();\r
62                 demo->myinit();\r
63                 demo->initPhysics();\r
64                 return demo;\r
65         }\r
66 \r
67         \r
68 };\r
69 \r
70 #endif //BT_GYROSCOPIC_DEMO_H\r
71 \r