Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Demos / CellSpuDemo / BasicDemo2.h
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose, 
8 including commercial applications, and to alter it and redistribute it freely, 
9 subject to the following restrictions:
10
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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 #ifndef BASIC_DEMO_H
16 #define BASIC_DEMO_H
17
18 #include "LinearMath/btQuickprof.h"
19
20 class btDiscreteDynamicsworld;
21 class btCollisionShape;
22 class btOverlappingPairCache;
23 class btCollisionDispatcher;
24 class btConstraintSolver;
25 struct btCollisionAlgorithmCreateFunc;
26
27 ///BasicDemo is good starting point for learning the code base and porting.
28 class BasicDemo 
29 {
30         btClock m_clock;
31
32         //keep the collision shapes, for deletion/cleanup
33         btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
34
35         btBroadphaseInterface*  m_overlappingPairCache;
36
37         btCollisionDispatcher*  m_dispatcher;
38         btDefaultCollisionConfiguration* m_collisionConfiguration;
39         btConstraintSolver*     m_solver;
40         btDiscreteDynamicsWorld*        m_dynamicsWorld;
41
42         btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
43         btCollisionAlgorithmCreateFunc* m_sphereBoxCF;
44         btCollisionAlgorithmCreateFunc* m_boxSphereCF;
45
46         btRigidBody* localCreateRigidBody(btScalar mass,const btTransform& startTrans,btCollisionShape* colShape);
47
48
49         public:
50
51         void    initPhysics();
52
53         void    exitPhysics();
54
55         virtual void clientMoveAndDisplay();
56
57         
58         
59 };
60
61 #endif //BASIC_DEMO_H
62