2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
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:
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.
15 #ifndef CONVEX_DECOMPOSITION_DEMO_H
16 #define CONVEX_DECOMPOSITION_DEMO_H
20 #include "Win32DemoApplication.h"
21 #define PlatformDemoApplication Win32DemoApplication
23 #include "GlutDemoApplication.h"
24 #define PlatformDemoApplication GlutDemoApplication
27 #include "LinearMath/btAlignedObjectArray.h"
29 class btBroadphaseInterface;
30 class btCollisionShape;
31 class btOverlappingPairCache;
32 class btCollisionDispatcher;
33 class btConstraintSolver;
34 struct btCollisionAlgorithmCreateFunc;
35 class btDefaultCollisionConfiguration;
38 ///ConvexDecompositionDemo shows automatic convex decomposition of a concave mesh
39 class ConvexDecompositionDemo : public PlatformDemoApplication
42 void setupEmptyDynamicsWorld();
46 //keep the collision shapes, for deletion/cleanup
47 btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
49 btAlignedObjectArray<btTriangleMesh*> m_trimeshes;
51 btBroadphaseInterface* m_broadphase;
53 btCollisionDispatcher* m_dispatcher;
55 btConstraintSolver* m_solver;
57 btDefaultCollisionConfiguration* m_collisionConfiguration;
60 virtual void initPhysics();
62 void initPhysics(const char* filename);
66 virtual ~ConvexDecompositionDemo()
71 virtual void clientMoveAndDisplay();
73 virtual void displayCallback();
75 static DemoApplication* Create()
77 ConvexDecompositionDemo* demo = new ConvexDecompositionDemo();
79 demo->initPhysics("file.obj");
86 #endif //CONVEX_DECOMPOSITION_DEMO_H