Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Demos / BulletXmlImportDemo / BulletXmlImportDemo.h
1 \r
2 /*\r
3 Bullet Continuous Collision Detection and Physics Library\r
4 Copyright (c) 2003-2010 Erwin Coumans  http://continuousphysics.com/Bullet/\r
5 \r
6 This software is provided 'as-is', without any express or implied warranty.\r
7 In no event will the authors be held liable for any damages arising from the use of this software.\r
8 Permission is granted to anyone to use this software for any purpose, \r
9 including commercial applications, and to alter it and redistribute it freely, \r
10 subject to the following restrictions:\r
11 \r
12 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
13 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\r
14 3. This notice may not be removed or altered from any source distribution.\r
15 */\r
16 #ifndef SERIALIZE_DEMO_H\r
17 #define SERIALIZE_DEMO_H\r
18 \r
19 #ifdef _WINDOWS\r
20 #include "Win32DemoApplication.h"\r
21 #define PlatformDemoApplication Win32DemoApplication\r
22 #else\r
23 #include "GlutDemoApplication.h"\r
24 #define PlatformDemoApplication GlutDemoApplication\r
25 #endif\r
26 \r
27 #include "LinearMath/btAlignedObjectArray.h"\r
28 \r
29 class btBroadphaseInterface;\r
30 class btCollisionShape;\r
31 class btOverlappingPairCache;\r
32 class btCollisionDispatcher;\r
33 class btConstraintSolver;\r
34 struct btCollisionAlgorithmCreateFunc;\r
35 class btDefaultCollisionConfiguration;\r
36 \r
37 ///BulletXmlImportDemo shows how to use save and load XML Bullet physics files (work-in-progress)\r
38 class BulletXmlImportDemo : public PlatformDemoApplication\r
39 {\r
40 \r
41         //keep the collision shapes, for deletion/cleanup\r
42         btAlignedObjectArray<btCollisionShape*> m_collisionShapes;\r
43 \r
44         btBroadphaseInterface*  m_broadphase;\r
45 \r
46         btCollisionDispatcher*  m_dispatcher;\r
47 \r
48         btConstraintSolver*     m_solver;\r
49 \r
50         btDefaultCollisionConfiguration* m_collisionConfiguration;\r
51 \r
52         class btBulletWorldImporter*            m_fileLoader;\r
53 \r
54         public:\r
55 \r
56         BulletXmlImportDemo()\r
57         {\r
58                 //m_idle=true;\r
59                 setCameraDistance(btScalar(30.));\r
60         }\r
61         virtual ~BulletXmlImportDemo();\r
62 \r
63         virtual void clientResetScene();\r
64 \r
65         void    initPhysics();\r
66 \r
67         void    setupEmptyDynamicsWorld();\r
68 \r
69         void    exitPhysics();\r
70 \r
71         virtual void clientMoveAndDisplay();\r
72 \r
73         virtual void displayCallback();\r
74         \r
75         static DemoApplication* Create()\r
76         {\r
77                 BulletXmlImportDemo* demo = new BulletXmlImportDemo;\r
78                 demo->myinit();\r
79                 demo->initPhysics();\r
80                 return demo;\r
81         }\r
82 \r
83         \r
84 };\r
85 \r
86 #endif //SERIALIZE_DEMO_H\r
87 \r