diff --git a/Demos/AllBulletDemos/DemoEntries.cpp b/Demos/AllBulletDemos/DemoEntries.cpp index 998b87723..76cf02f83 100644 --- a/Demos/AllBulletDemos/DemoEntries.cpp +++ b/Demos/AllBulletDemos/DemoEntries.cpp @@ -21,6 +21,7 @@ subject to the following restrictions: #include "../ConcaveDemo/ConcaveDemo.h" #include "../ConvexDecompositionDemo/ConvexDecompositionDemo.h" #include "../RagdollDemo/RagdollDemo.h" +#include "../GimpactTestDemo/GimpactTestDemo.h" btDemoEntry g_demoEntries[] = @@ -31,6 +32,7 @@ btDemoEntry g_demoEntries[] = {"BasicDemo", BasicDemo::Create}, {"BspDemo", BspDemo::Create}, {"ConcaveDemo",ConcaveDemo::Create}, + {"Gimpact Test", GimpactConcaveDemo::Create}, {0, 0} }; diff --git a/Demos/AllBulletDemos/Jamfile b/Demos/AllBulletDemos/Jamfile index 2b3600852..240bb9ad8 100644 --- a/Demos/AllBulletDemos/Jamfile +++ b/Demos/AllBulletDemos/Jamfile @@ -10,4 +10,5 @@ FrameWorkDemo AllBulletDemos : ../ConcaveDemo/ConcavePhysicsDemo.cpp ../ConvexDecompositionDemo/ConvexDecompositionDemo.cpp ../RagdollDemo/RagdollDemo.cpp + ../GimpactTestDemo/GimpactTestDemo.cpp ; diff --git a/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp b/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp index e83c63c98..f3831a5fc 100644 --- a/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp +++ b/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp @@ -30,10 +30,10 @@ subject to the following restrictions: -btVector3* gVertices=0; -int* gIndices=0; -btBvhTriangleMeshShape* trimeshShape =0; -btRigidBody* staticBody = 0; +static btVector3* gVertices=0; +static int* gIndices=0; +static btBvhTriangleMeshShape* trimeshShape =0; +static btRigidBody* staticBody = 0; static float waveheight = 5.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(); diff --git a/Demos/GimpactTestDemo/GimpactTestDemo.cpp b/Demos/GimpactTestDemo/GimpactTestDemo.cpp index 45df0aa75..b633e679b 100644 --- a/Demos/GimpactTestDemo/GimpactTestDemo.cpp +++ b/Demos/GimpactTestDemo/GimpactTestDemo.cpp @@ -45,7 +45,6 @@ extern int gNumGjkChecks; -GLDebugDrawer debugDrawer; //Real dts = 0.000001f; 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() @@ -416,7 +398,6 @@ void GimpactConcaveDemo::initPhysics() m_constraintSolver = new btSequentialImpulseConstraintSolver(); m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_constraintSolver,m_collisionConfiguration); - m_dynamicsWorld->setDebugDrawer(&debugDrawer); //create trimesh model and shape initGImpactCollision(); diff --git a/Demos/GimpactTestDemo/GimpactTestDemo.h b/Demos/GimpactTestDemo/GimpactTestDemo.h index 3d11005a6..5493b709b 100644 --- a/Demos/GimpactTestDemo/GimpactTestDemo.h +++ b/Demos/GimpactTestDemo/GimpactTestDemo.h @@ -16,6 +16,8 @@ subject to the following restrictions: #define TEST_CONCAVE_DEMO_H #include "DemoApplication.h" +class btTriangleIndexVertexArray; +class btDefaultCollisionConfiguration; //#define BULLET_TRIANGLE_COLLISION 1 #define BULLET_GIMPACT 1 @@ -126,6 +128,14 @@ public: ///data btCollisionDispatcher* m_dispatcher; btBroadphaseInterface* m_broadphase; btConstraintSolver* m_constraintSolver; + + static DemoApplication* Create() + { + GimpactConcaveDemo* demo = new GimpactConcaveDemo(); + demo->myinit(); + demo->initPhysics(); + return demo; + } }; #endif //CONCAVE_DEMO_H diff --git a/Demos/Jamfile b/Demos/Jamfile index 1161ff5f5..86bfbfa76 100644 --- a/Demos/Jamfile +++ b/Demos/Jamfile @@ -35,17 +35,21 @@ if $(GLUT.AVAILABLE) = "yes" rule FrameWorkDemo { Application $(<) : $(>) : noinstall console nomanifest ; - LinkWith $(<) : bulletopenglsupport convexdecomposition bulletdynamics bulletcollision bulletmath glui ; + LinkWith $(<) : GIMPACTUtils GIMPACT bulletopenglsupport convexdecomposition bulletdynamics bulletcollision bulletmath glui ; CFlags $(<) : [ FIncludes $(TOP)/Extras ] [ FIncludes $(TOP)/Demos/OpenGL ] [ FIncludes $(TOP)/Extras/ConvexDecomposition ] + [ FIncludes $(TOP)/Extras/GIMPACT/include ] + [ FIncludes $(TOP)/Extras/GIMPACTUtils ] ; MsvcIncDirs $(<) : "../../Extras" "../../src" "../../Demos/OpenGL" "../../Extras/ConvexDecomposition" + "../../Extras/GIMPACT/include" + "../../Extras/GIMPACTUtils" ; }