From 4a3c2506d49d30664f7b285e6d8c731a03aa73ca Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Sat, 15 Dec 2007 02:42:33 +0000 Subject: [PATCH] fixed cmake/jam for HelloWorld sample --- Demos/CMakeLists.txt | 2 +- Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp | 4 +++- Demos/HelloWorld/CMakeLists.txt | 14 ++++++++++++++ Demos/HelloWorld/HelloWorld.cpp | 4 ++-- Demos/HelloWorld/Jamfile | 3 +++ Demos/Jamfile | 3 ++- 6 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 Demos/HelloWorld/CMakeLists.txt create mode 100644 Demos/HelloWorld/Jamfile diff --git a/Demos/CMakeLists.txt b/Demos/CMakeLists.txt index 22f9d5fce..80454c0b2 100644 --- a/Demos/CMakeLists.txt +++ b/Demos/CMakeLists.txt @@ -1,2 +1,2 @@ -SUBDIRS( OpenGL AllBulletDemos MultiThreadedDemo CcdPhysicsDemo ConstraintDemo GenericJointDemo RagdollDemo BasicDemo BspDemo MovingConcaveDemo VehicleDemo ColladaDemo UserCollisionAlgorithm ) +SUBDIRS( OpenGL AllBulletDemos HelloWorld MultiThreadedDemo CcdPhysicsDemo ConstraintDemo GenericJointDemo RagdollDemo BasicDemo BspDemo MovingConcaveDemo VehicleDemo ColladaDemo UserCollisionAlgorithm ) diff --git a/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp b/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp index ead976931..82c88ed64 100644 --- a/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp +++ b/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp @@ -126,7 +126,9 @@ void LinearConvexCastDemo::displayCallback(void) gGjkSimplexSolver.reset(); - btSubsimplexConvexCast convexCaster( shapePtr[ 0 ], shapePtr[ 1 ], &gGjkSimplexSolver ); + + btGjkConvexCast convexCaster(shapePtr[ 0 ], shapePtr[ 1 ], &gGjkSimplexSolver ); + //btSubsimplexConvexCast convexCaster( shapePtr[ 0 ], shapePtr[ 1 ], &gGjkSimplexSolver ); btConvexCast::CastResult result; convexCaster.calcTimeOfImpact( tr[ 0 ], toA, tr[ 1 ], toB, result ); diff --git a/Demos/HelloWorld/CMakeLists.txt b/Demos/HelloWorld/CMakeLists.txt new file mode 100644 index 000000000..622f2ca55 --- /dev/null +++ b/Demos/HelloWorld/CMakeLists.txt @@ -0,0 +1,14 @@ +# HelloWorld is a minimal sample creating, stepping and deleting a Bullet dynamics world + +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/src } +) + +LINK_LIBRARIES( + LibBulletDynamics LibBulletCollision LibLinearMath +) + +ADD_EXECUTABLE(HelloWorld + HelloWorld.cpp +) + diff --git a/Demos/HelloWorld/HelloWorld.cpp b/Demos/HelloWorld/HelloWorld.cpp index 95cf4d55e..b852a3c28 100644 --- a/Demos/HelloWorld/HelloWorld.cpp +++ b/Demos/HelloWorld/HelloWorld.cpp @@ -116,9 +116,9 @@ int main(int argc, char** argv) dynamicsWorld->stepSimulation(1.f/60.f,10); //print positions of all objects - for (i=dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--) + for (int j=dynamicsWorld->getNumCollisionObjects()-1; j>=0 ;j--) { - btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[i]; + btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[j]; btRigidBody* body = btRigidBody::upcast(obj); if (body && body->getMotionState()) { diff --git a/Demos/HelloWorld/Jamfile b/Demos/HelloWorld/Jamfile new file mode 100644 index 000000000..dc43b0c1f --- /dev/null +++ b/Demos/HelloWorld/Jamfile @@ -0,0 +1,3 @@ +SubDir TOP Demos HelloWorld ; + +BulletBasicDemo HelloWorld : [ Wildcard *.h *.cpp ] ; diff --git a/Demos/Jamfile b/Demos/Jamfile index f5aef97d9..d161217b1 100644 --- a/Demos/Jamfile +++ b/Demos/Jamfile @@ -21,7 +21,7 @@ if $(GLUT.AVAILABLE) = "yes" rule BulletBasicDemo { Application $(<) : $(>) : noinstall console nomanifest ; - LinkWith $(<) : bulletcollision bulletmath ; + LinkWith $(<) : bulletdynamics bulletcollision bulletmath ; CFlags $(<) : [ FIncludes $(TOP)/src ] ; @@ -62,6 +62,7 @@ SubInclude TOP Demos MultiThreadedDemo ; #SubInclude TOP Demos ForkLiftDemo ; SubInclude TOP Demos BulletDinoDemo ; SubInclude TOP Demos EPAPenDepthDemo ; +SubInclude TOP Demos HelloWorld ; SubInclude TOP Demos BspDemo ; SubInclude TOP Demos BasicDemo ; SubInclude TOP Demos ConvexDecompositionDemo ;