updated GimpactTestDemo into AllBulletDemos
This commit is contained in:
@@ -21,6 +21,7 @@ subject to the following restrictions:
|
|||||||
#include "../ConcaveDemo/ConcaveDemo.h"
|
#include "../ConcaveDemo/ConcaveDemo.h"
|
||||||
#include "../ConvexDecompositionDemo/ConvexDecompositionDemo.h"
|
#include "../ConvexDecompositionDemo/ConvexDecompositionDemo.h"
|
||||||
#include "../RagdollDemo/RagdollDemo.h"
|
#include "../RagdollDemo/RagdollDemo.h"
|
||||||
|
#include "../GimpactTestDemo/GimpactTestDemo.h"
|
||||||
|
|
||||||
|
|
||||||
btDemoEntry g_demoEntries[] =
|
btDemoEntry g_demoEntries[] =
|
||||||
@@ -31,6 +32,7 @@ btDemoEntry g_demoEntries[] =
|
|||||||
{"BasicDemo", BasicDemo::Create},
|
{"BasicDemo", BasicDemo::Create},
|
||||||
{"BspDemo", BspDemo::Create},
|
{"BspDemo", BspDemo::Create},
|
||||||
{"ConcaveDemo",ConcaveDemo::Create},
|
{"ConcaveDemo",ConcaveDemo::Create},
|
||||||
|
{"Gimpact Test", GimpactConcaveDemo::Create},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ FrameWorkDemo AllBulletDemos :
|
|||||||
../ConcaveDemo/ConcavePhysicsDemo.cpp
|
../ConcaveDemo/ConcavePhysicsDemo.cpp
|
||||||
../ConvexDecompositionDemo/ConvexDecompositionDemo.cpp
|
../ConvexDecompositionDemo/ConvexDecompositionDemo.cpp
|
||||||
../RagdollDemo/RagdollDemo.cpp
|
../RagdollDemo/RagdollDemo.cpp
|
||||||
|
../GimpactTestDemo/GimpactTestDemo.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
btVector3* gVertices=0;
|
static btVector3* gVertices=0;
|
||||||
int* gIndices=0;
|
static int* gIndices=0;
|
||||||
btBvhTriangleMeshShape* trimeshShape =0;
|
static btBvhTriangleMeshShape* trimeshShape =0;
|
||||||
btRigidBody* staticBody = 0;
|
static btRigidBody* staticBody = 0;
|
||||||
static float waveheight = 5.f;
|
static float waveheight = 5.f;
|
||||||
|
|
||||||
const float TRIANGLE_SIZE=8.f;
|
const float TRIANGLE_SIZE=8.f;
|
||||||
@@ -61,7 +61,7 @@ inline btScalar calculateCombinedRestitution(float restitution0,float restitutio
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CustomMaterialCombinerCallback(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
|
static bool CustomMaterialCombinerCallback(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
|
||||||
{
|
{
|
||||||
|
|
||||||
float friction0 = colObj0->getFriction();
|
float friction0 = colObj0->getFriction();
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ extern int gNumGjkChecks;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
GLDebugDrawer debugDrawer;
|
|
||||||
//Real dts = 0.000001f;
|
//Real dts = 0.000001f;
|
||||||
Real dts = 1.0 / 60.0;
|
Real dts = 1.0 / 60.0;
|
||||||
|
|
||||||
@@ -116,23 +115,6 @@ extern ContactAddedCallback gContactAddedCallback;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//################################## main #####################################
|
|
||||||
int main(int argc,char** argv)
|
|
||||||
{
|
|
||||||
gContactAddedCallback = CustomMaterialCombinerCallback;
|
|
||||||
|
|
||||||
GimpactConcaveDemo* concaveDemo = new GimpactConcaveDemo(); /// This will not be Deleted!!!
|
|
||||||
concaveDemo->initPhysics();
|
|
||||||
concaveDemo->setCameraDistance(45.f);
|
|
||||||
|
|
||||||
//cannot run stepFront yet, the OpenGL context is not opened (stepFront updates camera...)
|
|
||||||
// concaveDemo->stepFront();
|
|
||||||
// concaveDemo->stepFront();
|
|
||||||
// concaveDemo->stepFront();
|
|
||||||
// concaveDemo->stepFront();
|
|
||||||
|
|
||||||
return glutmain(argc, argv,640,480,"DevO,s GIMPACT Test Demo",concaveDemo);
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void GimpactConcaveDemo::renderme()
|
void GimpactConcaveDemo::renderme()
|
||||||
@@ -416,7 +398,6 @@ void GimpactConcaveDemo::initPhysics()
|
|||||||
m_constraintSolver = new btSequentialImpulseConstraintSolver();
|
m_constraintSolver = new btSequentialImpulseConstraintSolver();
|
||||||
|
|
||||||
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_constraintSolver,m_collisionConfiguration);
|
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_constraintSolver,m_collisionConfiguration);
|
||||||
m_dynamicsWorld->setDebugDrawer(&debugDrawer);
|
|
||||||
|
|
||||||
//create trimesh model and shape
|
//create trimesh model and shape
|
||||||
initGImpactCollision();
|
initGImpactCollision();
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ subject to the following restrictions:
|
|||||||
#define TEST_CONCAVE_DEMO_H
|
#define TEST_CONCAVE_DEMO_H
|
||||||
|
|
||||||
#include "DemoApplication.h"
|
#include "DemoApplication.h"
|
||||||
|
class btTriangleIndexVertexArray;
|
||||||
|
class btDefaultCollisionConfiguration;
|
||||||
|
|
||||||
//#define BULLET_TRIANGLE_COLLISION 1
|
//#define BULLET_TRIANGLE_COLLISION 1
|
||||||
#define BULLET_GIMPACT 1
|
#define BULLET_GIMPACT 1
|
||||||
@@ -126,6 +128,14 @@ public: ///data
|
|||||||
btCollisionDispatcher* m_dispatcher;
|
btCollisionDispatcher* m_dispatcher;
|
||||||
btBroadphaseInterface* m_broadphase;
|
btBroadphaseInterface* m_broadphase;
|
||||||
btConstraintSolver* m_constraintSolver;
|
btConstraintSolver* m_constraintSolver;
|
||||||
|
|
||||||
|
static DemoApplication* Create()
|
||||||
|
{
|
||||||
|
GimpactConcaveDemo* demo = new GimpactConcaveDemo();
|
||||||
|
demo->myinit();
|
||||||
|
demo->initPhysics();
|
||||||
|
return demo;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //CONCAVE_DEMO_H
|
#endif //CONCAVE_DEMO_H
|
||||||
|
|||||||
@@ -35,17 +35,21 @@ if $(GLUT.AVAILABLE) = "yes"
|
|||||||
rule FrameWorkDemo
|
rule FrameWorkDemo
|
||||||
{
|
{
|
||||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||||
LinkWith $(<) : bulletopenglsupport convexdecomposition bulletdynamics bulletcollision bulletmath glui ;
|
LinkWith $(<) : GIMPACTUtils GIMPACT bulletopenglsupport convexdecomposition bulletdynamics bulletcollision bulletmath glui ;
|
||||||
CFlags $(<) :
|
CFlags $(<) :
|
||||||
[ FIncludes $(TOP)/Extras ]
|
[ FIncludes $(TOP)/Extras ]
|
||||||
[ FIncludes $(TOP)/Demos/OpenGL ]
|
[ FIncludes $(TOP)/Demos/OpenGL ]
|
||||||
[ FIncludes $(TOP)/Extras/ConvexDecomposition ]
|
[ FIncludes $(TOP)/Extras/ConvexDecomposition ]
|
||||||
|
[ FIncludes $(TOP)/Extras/GIMPACT/include ]
|
||||||
|
[ FIncludes $(TOP)/Extras/GIMPACTUtils ]
|
||||||
;
|
;
|
||||||
MsvcIncDirs $(<) :
|
MsvcIncDirs $(<) :
|
||||||
"../../Extras"
|
"../../Extras"
|
||||||
"../../src"
|
"../../src"
|
||||||
"../../Demos/OpenGL"
|
"../../Demos/OpenGL"
|
||||||
"../../Extras/ConvexDecomposition"
|
"../../Extras/ConvexDecomposition"
|
||||||
|
"../../Extras/GIMPACT/include"
|
||||||
|
"../../Extras/GIMPACTUtils"
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user