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 BENCHMARK_DEMO_H
16
#define BENCHMARK_DEMO_H
19
#include "LinearMath/btAlignedObjectArray.h"
20
#include "LinearMath/btTransform.h"
22
class btDynamicsWorld;
27
class btBroadphaseInterface;
28
class btCollisionShape;
29
class btOverlappingPairCache;
30
class btCollisionDispatcher;
31
class btConstraintSolver;
32
struct btCollisionAlgorithmCreateFunc;
33
class btDefaultCollisionConfiguration;
36
#ifndef USE_GRAPHICAL_BENCHMARK
42
btDynamicsWorld* m_dynamicsWorld;
43
btScalar m_defaultContactProcessingThreshold;
47
:m_defaultContactProcessingThreshold(BT_LARGE_FLOAT)
50
virtual void myinit() {}
51
virtual btDynamicsWorld* getDynamicsWorld()
53
return m_dynamicsWorld;
56
btScalar getDeltaTimeMicroseconds()
62
void setCameraDistance(btScalar dist){}
63
void clientResetScene(){}
64
btRigidBody* localCreateRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape);
67
///BenchmarkDemo is provides several performance tests
68
#define PlatformDemoApplication DemoApplication
69
#else //USE_GRAPHICAL_BENCHMARK
72
#include "Win32DemoApplication.h"
73
#define PlatformDemoApplication Win32DemoApplication
75
#include "GlutDemoApplication.h"
76
#define PlatformDemoApplication GlutDemoApplication
79
#endif //USE_GRAPHICAL_BENCHMARK
82
class BenchmarkDemo : public PlatformDemoApplication
85
//keep the collision shapes, for deletion/cleanup
86
btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
88
btAlignedObjectArray<class RagDoll*> m_ragdolls;
90
btBroadphaseInterface* m_overlappingPairCache;
92
btCollisionDispatcher* m_dispatcher;
94
btConstraintSolver* m_solver;
96
btDefaultCollisionConfiguration* m_collisionConfiguration;
108
void createWall(const btVector3& offsetPosition,int stackSize,const btVector3& boxSize);
109
void createPyramid(const btVector3& offsetPosition,int stackSize,const btVector3& boxSize);
110
void createTowerCircle(const btVector3& offsetPosition,int stackSize,int rotSize,const btVector3& boxSize);
111
void createLargeMeshBody();
114
class SpuBatchRaycaster* m_batchRaycaster;
115
class btThreadSupportInterface* m_batchRaycasterThreadSupport;
122
BenchmarkDemo(int benchmark)
123
:m_benchmark(benchmark)
126
virtual ~BenchmarkDemo()
134
virtual void clientMoveAndDisplay();
136
virtual void displayCallback();
143
class BenchmarkDemo1 : public BenchmarkDemo
151
static DemoApplication* Create()
153
BenchmarkDemo1* demo = new BenchmarkDemo1;
160
class BenchmarkDemo2 : public BenchmarkDemo
168
static DemoApplication* Create()
170
BenchmarkDemo2* demo = new BenchmarkDemo2;
177
class BenchmarkDemo3 : public BenchmarkDemo
185
static DemoApplication* Create()
187
BenchmarkDemo3* demo = new BenchmarkDemo3;
194
class BenchmarkDemo4 : public BenchmarkDemo
202
static DemoApplication* Create()
204
BenchmarkDemo4* demo = new BenchmarkDemo4;
212
class BenchmarkDemo5 : public BenchmarkDemo
220
static DemoApplication* Create()
222
BenchmarkDemo5* demo = new BenchmarkDemo5;
230
class BenchmarkDemo6 : public BenchmarkDemo
238
static DemoApplication* Create()
240
BenchmarkDemo6* demo = new BenchmarkDemo6;
247
class BenchmarkDemo7 : public BenchmarkDemo
255
static DemoApplication* Create()
257
BenchmarkDemo7* demo = new BenchmarkDemo7;
264
#endif //BENCHMARK_DEMO_H