diff --git a/Demos/BasicDemo/main.cpp b/Demos/BasicDemo/main.cpp index 2d46d7cff..957c4ba7b 100644 --- a/Demos/BasicDemo/main.cpp +++ b/Demos/BasicDemo/main.cpp @@ -66,12 +66,12 @@ int main(int argc,char** argv) map.remove(key2); - const OurValue* ourPtr = map.find(key1); - for (int i=0;im_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ()); - } +// } BasicDemo ccdDemo; ccdDemo.initPhysics(); diff --git a/Demos/Benchmarks/BenchmarkDemo.cpp b/Demos/Benchmarks/BenchmarkDemo.cpp index d39fd54fe..c6ad70073 100644 --- a/Demos/Benchmarks/BenchmarkDemo.cpp +++ b/Demos/Benchmarks/BenchmarkDemo.cpp @@ -223,7 +223,7 @@ void BenchmarkDemo::clientMoveAndDisplay() #endif //USE_GRAPHICAL_BENCHMARK //simple dynamics world doesn't handle fixed-time-stepping - float ms = getDeltaTimeMicroseconds(); + //float ms = getDeltaTimeMicroseconds(); ///step the simulation if (m_dynamicsWorld) @@ -427,7 +427,8 @@ void BenchmarkDemo::createTest1() pos[0] = offset + (float)i * (cubeSize * 2.0f + spacing); trans.setOrigin(pos); - btRigidBody* cmbody = localCreateRigidBody(mass,trans,blockShape); + btRigidBody* cmbody; + cmbody= localCreateRigidBody(mass,trans,blockShape); } } offset -= 0.05f * spacing * (size-1); @@ -449,7 +450,7 @@ void BenchmarkDemo::createWall(const btVector3& offsetPosition,int stackSize,con btVector3 localInertia(0,0,0); blockShape->calculateLocalInertia(mass,localInertia); - float diffX = boxSize[0] * 1.0f; +// float diffX = boxSize[0] * 1.0f; float diffY = boxSize[1] * 1.0f; float diffZ = boxSize[2] * 1.0f; @@ -863,7 +864,7 @@ void BenchmarkDemo::createTest3() float sizeX = 1.f; float sizeY = 1.f; - int rc=0; + //int rc=0; btScalar scale(3.5); btVector3 pos(0.0f, sizeY, 0.0f); diff --git a/Demos/Benchmarks/Taru.mdl b/Demos/Benchmarks/Taru.mdl index f9cf621b0..4ebc5039d 100644 --- a/Demos/Benchmarks/Taru.mdl +++ b/Demos/Benchmarks/Taru.mdl @@ -47,142 +47,3 @@ static float TaruVtx[] = { 1.08664f,1.99237f,0.0f, }; -static float TaruNml[] = { -0.938103f,-0.346356f,0.0f, -0.663339f,-0.346356f,-0.663339f, -0.707107f,0.0f,-0.707107f, -1.0f,0.0f,0.0f, -0.0f,-0.346356f,-0.938103f, -0.0f,0.0f,-1.0f, -0.0f,-0.346356f,-0.938103f, --0.663339f,-0.346356f,-0.663339f, --0.707107f,0.0f,-0.707107f, -0.0f,0.0f,-1.0f, --0.938103f,-0.346356f,0.0f, --1.0f,0.0f,0.0f, --0.663339f,-0.346356f,0.663339f, --0.707107f,0.0f,0.707107f, -0.0f,-0.346356f,0.938103f, -1.21445e-007f,0.0f,1.0f, -0.663339f,-0.346356f,0.663339f, -0.707107f,0.0f,0.707107f, -0.663339f,0.346356f,-0.663339f, -0.938103f,0.346356f,0.0f, -0.0f,0.346356f,-0.938103f, --0.663339f,0.346356f,-0.663339f, -0.0f,0.346356f,-0.938103f, --0.938103f,0.346356f,0.0f, --0.663339f,0.346356f,0.663339f, -1.2508e-007f,0.346356f,0.938103f, -0.663339f,0.346356f,0.663339f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,-1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -0.0f,1.0f,0.0f, -}; - -static float TaruTex[] = { -0.75f,0.0f, -0.875f,0.0f, -0.875f,0.5f, -0.75f,0.5f, -1.0f,0.0f, -1.0f,0.5f, -0.0f,0.0f, -0.125f,0.0f, -0.125f,0.5f, -0.0f,0.5f, -0.25f,0.0f, -0.25f,0.5f, -0.375f,0.0f, -0.375f,0.5f, -0.5f,0.0f, -0.5f,0.5f, -0.625f,0.0f, -0.625f,0.5f, -0.875f,1.0f, -0.75f,1.0f, -1.0f,1.0f, -0.125f,1.0f, -0.0f,1.0f, -0.25f,1.0f, -0.375f,1.0f, -0.5f,1.0f, -0.625f,1.0f, -1.0f,0.5f, -0.853553f,0.146447f, -0.5f,0.0f, -0.146447f,0.146447f, -0.0f,0.5f, -0.146447f,0.853553f, -0.5f,1.0f, -0.853553f,0.853553f, -0.146447f,0.853553f, -0.0f,0.5f, -0.146447f,0.146447f, -0.5f,0.0f, -0.853553f,0.146447f, -1.0f,0.5f, -0.853553f,0.853553f, -0.5f,1.0f, -}; - -static unsigned short TaruIdx[] = { -0,1,2, -2,3,0, -1,4,5, -5,2,1, -6,7,8, -8,9,6, -7,10,11, -11,8,7, -10,12,13, -13,11,10, -12,14,15, -15,13,12, -14,16,17, -17,15,14, -16,0,3, -3,17,16, -3,2,18, -18,19,3, -2,5,20, -20,18,2, -9,8,21, -21,22,9, -8,11,23, -23,21,8, -11,13,24, -24,23,11, -13,15,25, -25,24,13, -15,17,26, -26,25,15, -17,3,19, -19,26,17, -27,28,29, -29,30,31, -31,32,33, -29,31,33, -27,29,33, -34,27,33, -35,36,37, -37,38,39, -39,40,41, -37,39,41, -35,37,41, -42,35,41, -}; - diff --git a/Demos/Benchmarks/main.cpp b/Demos/Benchmarks/main.cpp index bd96a1cae..ccf2dc6e0 100644 --- a/Demos/Benchmarks/main.cpp +++ b/Demos/Benchmarks/main.cpp @@ -44,7 +44,7 @@ int main(int argc,char** argv) BenchmarkDemo7 benchmarkDemo7; BenchmarkDemo* demoArray[NUM_DEMOS] = {&benchmarkDemo1,&benchmarkDemo2,&benchmarkDemo3,&benchmarkDemo4,&benchmarkDemo5,&benchmarkDemo6,&benchmarkDemo7}; - char* demoNames[NUM_DEMOS] = {"3000 fall", "1000 stack", "136 ragdolls","1000 convex", "prim-trimesh", "convex-trimesh","raytests"}; + const char* demoNames[NUM_DEMOS] = {"3000 fall", "1000 stack", "136 ragdolls","1000 convex", "prim-trimesh", "convex-trimesh","raytests"}; float totalTime[NUM_DEMOS] = {0.f,0.f,0.f,0.f,0.f,0.f,0.f}; #ifdef USE_GRAPHICAL_BENCHMARK diff --git a/Demos/Box2dDemo/Box2dDemo.cpp b/Demos/Box2dDemo/Box2dDemo.cpp index c131772a0..cb5fe2f58 100644 --- a/Demos/Box2dDemo/Box2dDemo.cpp +++ b/Demos/Box2dDemo/Box2dDemo.cpp @@ -114,7 +114,7 @@ void Box2dDemo::initPhysics() toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 2"); toggle ->m_active = true; toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 3"); - GL_SliderControl* slider = m_dialogDynamicsWorld->createSlider(settings,"Slider"); +// GL_SliderControl* slider = m_dialogDynamicsWorld->createSlider(settings,"Slider"); GL_DialogWindow* dialog = m_dialogDynamicsWorld->createDialog(0,200,420,300,"Help"); GL_TextControl* txt = new GL_TextControl; @@ -242,9 +242,9 @@ void Box2dDemo::initPhysics() if (isDynamic) colShape->calculateLocalInertia(mass,localInertia); - float start_x = START_POS_X - ARRAY_SIZE_X/2; - float start_y = START_POS_Y; - float start_z = START_POS_Z - ARRAY_SIZE_Z/2; +// float start_x = START_POS_X - ARRAY_SIZE_X/2; +// float start_y = START_POS_Y; +// float start_z = START_POS_Z - ARRAY_SIZE_Z/2; btVector3 x(-ARRAY_SIZE_X, 8.0f,-20.f); btVector3 y; diff --git a/Demos/CMakeLists.txt b/Demos/CMakeLists.txt index d71d84e23..79d117b8c 100644 --- a/Demos/CMakeLists.txt +++ b/Demos/CMakeLists.txt @@ -11,6 +11,7 @@ InternalEdgeDemo GimpactTestDemo GenericJointDemo SerializeDemo +SoftDemo ) diff --git a/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp b/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp index 857ef7ddc..bfccf3582 100644 --- a/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp +++ b/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp @@ -186,7 +186,7 @@ void CollisionInterfaceDemo::displayCallback(void) { { btPersistentManifold* contactManifold = manifoldArray[i]; btCollisionObject* obA = static_cast(contactManifold->getBody0()); - btCollisionObject* obB = static_cast(contactManifold->getBody1()); + // btCollisionObject* obB = static_cast(contactManifold->getBody1()); glDisable(GL_DEPTH_TEST); int numContacts = contactManifold->getNumContacts(); diff --git a/Demos/ConstraintDemo/ConstraintDemo.cpp b/Demos/ConstraintDemo/ConstraintDemo.cpp index 56c158067..97a9cf3d4 100644 --- a/Demos/ConstraintDemo/ConstraintDemo.cpp +++ b/Demos/ConstraintDemo/ConstraintDemo.cpp @@ -109,7 +109,8 @@ void ConstraintDemo::initPhysics() btTransform groundTransform; groundTransform.setIdentity(); groundTransform.setOrigin(btVector3(0,-56,0)); - btRigidBody* groundBody = localCreateRigidBody(0, groundTransform, groundShape); + btRigidBody* groundBody; + groundBody= localCreateRigidBody(0, groundTransform, groundShape); diff --git a/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp b/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp index 23bb1e468..b550b17e1 100644 --- a/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp +++ b/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp @@ -287,7 +287,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) } } - float mass = 1.f; + // float mass = 1.f; //float collisionMargin = 0.01f; //this is a tools issue: due to collision margin, convex objects overlap, compensate for it here: @@ -463,7 +463,8 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) btConvexHullShape* convexShape = convexDecomposition.m_convexShapes[i]; compound->addChildShape(trans,convexShape); - btRigidBody* body = localCreateRigidBody( 1.0, trans,convexShape); + btRigidBody* body; + body = localCreateRigidBody( 1.0, trans,convexShape); } #if 1 diff --git a/Demos/GimpactTestDemo/GimpactTestDemo.cpp b/Demos/GimpactTestDemo/GimpactTestDemo.cpp index 06c6cac0a..9e5427319 100644 --- a/Demos/GimpactTestDemo/GimpactTestDemo.cpp +++ b/Demos/GimpactTestDemo/GimpactTestDemo.cpp @@ -482,12 +482,14 @@ void GimpactConcaveDemo::initPhysics() startTransform.setOrigin(btVector3(0,height,-5)); startTransform.setRotation(btQuaternion(0,0,3.14159265*0.5)); - btRigidBody* bodyA = localCreateRigidBody(massT, startTransform,m_trimeshShape); + btRigidBody* bodyA; + bodyA= localCreateRigidBody(massT, startTransform,m_trimeshShape); height -= step; startTransform.setOrigin(btVector3(0,height,-5)); startTransform.setRotation(btQuaternion(3.14159265*0.5,0,3.14159265*0.5)); - btRigidBody* bodyB = localCreateRigidBody(massT, startTransform,m_trimeshShape); + btRigidBody* bodyB; + bodyB= localCreateRigidBody(massT, startTransform,m_trimeshShape); } #else @@ -601,7 +603,7 @@ void GimpactConcaveDemo::clientMoveAndDisplay() unsigned long int time = getDeltaTimeMicroseconds()/btScalar(1000); - printf("%i time %i ms \n",m_steps_done,time); + printf("%i time %i ms \n",m_steps_done,int(time)); //#ifdef BULLET_GIMPACT // printf("%i time %.1f ms \n",m_steps_done,btGImpactCollisionAlgorithm::getAverageTreeCollisionTime()); diff --git a/Demos/GimpactTestDemo/GimpactTestDemo.h b/Demos/GimpactTestDemo/GimpactTestDemo.h index 2727f9a59..0b83e49c3 100644 --- a/Demos/GimpactTestDemo/GimpactTestDemo.h +++ b/Demos/GimpactTestDemo/GimpactTestDemo.h @@ -60,17 +60,23 @@ class GimpactConcaveDemo : public PlatformDemoApplication public: GimpactConcaveDemo() - : m_trimeshShape(NULL), + : m_steps_done(0), + m_trimeshShape(NULL), m_trimeshShape2(NULL), m_indexVertexArrays(NULL), m_indexVertexArrays2(NULL), - m_collisionConfiguration(NULL), - m_dispatcher(NULL), - m_broadphase(NULL), - kinematicTorus(NULL), - m_constraintSolver(NULL), - m_gimpactCollisionCreateFunc(NULL), - m_steps_done(0) + + + kinematicTorus(NULL), + + + m_gimpactCollisionCreateFunc(NULL), + m_collisionConfiguration(NULL), + + m_dispatcher(NULL), + + m_broadphase(NULL), + m_constraintSolver(NULL) { } diff --git a/Demos/OpenGL/DemoApplication.cpp b/Demos/OpenGL/DemoApplication.cpp index 1ec6af165..6f4dd01c5 100644 --- a/Demos/OpenGL/DemoApplication.cpp +++ b/Demos/OpenGL/DemoApplication.cpp @@ -65,23 +65,24 @@ m_ele(20.f), m_azi(0.f), m_cameraPosition(0.f,0.f,0.f), m_cameraTargetPosition(0.f,0.f,0.f), +m_mouseOldX(0), +m_mouseOldY(0), +m_mouseButtons(0), +m_modifierKeys(0), m_scaleBottom(0.5f), m_scaleFactor(2.f), m_cameraUp(0,1,0), m_forwardAxis(2), m_glutScreenWidth(0), m_glutScreenHeight(0), +m_ortho(0), m_ShootBoxInitialSpeed(40.f), m_stepping(true), m_singleStep(false), m_idle(false), + m_enableshadows(false), -m_sundirection(btVector3(1,-2,1)*1000), -m_ortho(0), -m_mouseOldX(0), -m_mouseOldY(0), -m_mouseButtons(0), -m_modifierKeys(0) +m_sundirection(btVector3(1,-2,1)*1000) { #ifndef BT_NO_PROFILE m_profileIterator = CProfileManager::Get_Iterator(); diff --git a/Demos/OpenGL/GLDebugFont.cpp b/Demos/OpenGL/GLDebugFont.cpp index e54e3346b..3823a2070 100644 --- a/Demos/OpenGL/GLDebugFont.cpp +++ b/Demos/OpenGL/GLDebugFont.cpp @@ -48,6 +48,8 @@ subject to the following restrictions: #include //for memset extern unsigned char sFontData[]; +static bool sTexturesInitialized = false; + static GLuint sTexture = -1; static int sScreenWidth = -1; static int sScreenHeight = -1; @@ -62,8 +64,9 @@ void GLDebugResetFont(int screenWidth,int screenHeight) sScreenWidth = screenWidth; sScreenHeight = screenHeight; - if (sTexture==-1) + if (!sTexturesInitialized) { + sTexturesInitialized = true; glGenTextures(1, &sTexture); glBindTexture(GL_TEXTURE_2D, sTexture); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); @@ -71,8 +74,6 @@ void GLDebugResetFont(int screenWidth,int screenHeight) glTexImage2D(GL_TEXTURE_2D, 0, 3, 256 , 256 , 0, GL_RGB, GL_UNSIGNED_BYTE, &sFontData[0]); } - int windowWidth=screenWidth; - int windowHeight = screenHeight; printf("generating font at resolution %d,%d\n",screenWidth,screenHeight); } @@ -82,9 +83,7 @@ void GLDebugResetFont(int screenWidth,int screenHeight) void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3& rgb) { - - const char* string2 = "test"; - if (sTexture==-1) + if (!sTexturesInitialized) { GLDebugResetFont(sScreenWidth,sScreenHeight); } diff --git a/Demos/OpenGL/GL_DialogDynamicsWorld.cpp b/Demos/OpenGL/GL_DialogDynamicsWorld.cpp index 5929644d4..9ed266e37 100644 --- a/Demos/OpenGL/GL_DialogDynamicsWorld.cpp +++ b/Demos/OpenGL/GL_DialogDynamicsWorld.cpp @@ -249,12 +249,13 @@ GL_SliderControl* GL_DialogDynamicsWorld::createSlider(GL_DialogWindow* dialog, btTransform frameInB; frameInB.setIdentity(); //frameInB.setOrigin(-offset/2); - bool useFrameA = false; - + btScalar lowerLimit = 80.f; btScalar upperLimit = 170.f; #if 0 + bool useFrameA = false; + btGeneric6DofConstraint* constraint = new btGeneric6DofConstraint(*dialogBody,*body,frameInA,frameInB,useFrameA); m_dynamicsWorld->addConstraint(constraint,true); constraint->setLimit(0,lowerLimit,upperLimit); @@ -339,7 +340,7 @@ void GL_DialogDynamicsWorld::draw(btScalar timeStep) static btRigidBody* pickedBody = 0;//for deactivation state static btScalar mousePickClamping = 111130.f; -static int gPickingConstraintId = 0; +//static int gPickingConstraintId = 0; static btVector3 gOldPickingPos; static btVector3 gHitPos(-1,-1,-1); diff --git a/Demos/OpenGL/GL_DialogWindow.cpp b/Demos/OpenGL/GL_DialogWindow.cpp index 0158845d3..8f00715b1 100644 --- a/Demos/OpenGL/GL_DialogWindow.cpp +++ b/Demos/OpenGL/GL_DialogWindow.cpp @@ -30,9 +30,10 @@ m_dialogWidth(dialogWidth), m_dialogHeight(dialogHeight), m_screenWidth(0), m_screenHeight(0), +m_dialogTitle(dialogTitle), m_MaxClipPlanes(-1), -m_collisionObject(collisionObject), -m_dialogTitle(dialogTitle) +m_collisionObject(collisionObject) + { } @@ -291,7 +292,7 @@ void GL_ToggleControl::draw(int& parentHorPos2,int& parentVertPos2,btScalar delt if (m_active) { //unsigned int red = 0xff8f0000; - unsigned int white = 0xff8f0000; + // unsigned int white = 0xff8f0000; unsigned int black = 0xff1f1f1f; borderSize = 4; drawRect(parentHorPos+borderSize, parentVertPos+borderSize, parentHorPos+16-borderSize, parentVertPos+16-borderSize, black,black,black,black); diff --git a/Demos/OpenGL/GL_DialogWindow.h b/Demos/OpenGL/GL_DialogWindow.h index 5287d8764..7b18b28eb 100644 --- a/Demos/OpenGL/GL_DialogWindow.h +++ b/Demos/OpenGL/GL_DialogWindow.h @@ -130,10 +130,10 @@ public: GL_SliderControl(const char* sliderText,btCollisionObject* sliderBody, GL_DialogWindow* parentWindow, btScalar lowerLimit,btScalar upperLimit,btTypedConstraint* constaint) :m_sliderBody(sliderBody), m_parentWindow(parentWindow), - m_sliderText(sliderText), m_lowerLimit(lowerLimit), m_upperLimit(upperLimit), - m_constraint(constaint) + m_constraint(constaint), + m_sliderText(sliderText) { m_type = GL_SLIDER_CONTROL; } diff --git a/Demos/OpenGL/GL_ShapeDrawer.cpp b/Demos/OpenGL/GL_ShapeDrawer.cpp index 2b003d2b3..f3b1f14de 100644 --- a/Demos/OpenGL/GL_ShapeDrawer.cpp +++ b/Demos/OpenGL/GL_ShapeDrawer.cpp @@ -532,7 +532,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons static const GLfloat planex[]={1,0,0,0}; - static const GLfloat planey[]={0,1,0,0}; + // static const GLfloat planey[]={0,1,0,0}; static const GLfloat planez[]={0,0,1,0}; glTexGenfv(GL_S,GL_OBJECT_PLANE,planex); glTexGenfv(GL_T,GL_OBJECT_PLANE,planez); @@ -839,10 +839,10 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons btVector3 normal; btVector3 vtx; polyshape->getPlane(normal,vtx,i); - btScalar d = vtx.dot(normal); + //btScalar d = vtx.dot(normal); - char buf[12]; - sprintf(buf," plane %d",i); + //char buf[12]; + //sprintf(buf," plane %d",i); //btDrawString(BMF_GetFont(BMF_kHelvetica10),buf); } @@ -921,7 +921,7 @@ void GL_ShapeDrawer::drawShadow(btScalar* m,const btVector3& extrusion,const bt } else { - bool useWireframeFallback = true; + // bool useWireframeFallback = true; if (shape->isConvex()) { ShapeCache* sc=cache((btConvexShape*)shape); diff --git a/Demos/SerializeDemo/main.cpp b/Demos/SerializeDemo/main.cpp index 0edd77735..cb529b910 100644 --- a/Demos/SerializeDemo/main.cpp +++ b/Demos/SerializeDemo/main.cpp @@ -66,12 +66,12 @@ int main(int argc,char** argv) map.remove(key2); - const OurValue* ourPtr = map.find(key1); - for (int i=0;im_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ()); - } +// const OurValue* ourPtr = map.find(key1); +// for (int i=0;im_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ()); +// } SerializeDemo ccdDemo; ccdDemo.initPhysics(); diff --git a/Demos/SoftDemo/SoftDemo.cpp b/Demos/SoftDemo/SoftDemo.cpp index 92567468f..5d3833b5c 100644 --- a/Demos/SoftDemo/SoftDemo.cpp +++ b/Demos/SoftDemo/SoftDemo.cpp @@ -1526,7 +1526,7 @@ void SoftDemo::renderme() } long ms=btMax(m_clock.getTimeMilliseconds(),1); long rayperseconds=(1000*(origins.size()*sbs.size()))/ms; - printf("%d ms (%d rays/s)\r\n",ms,rayperseconds); + printf("%d ms (%d rays/s)\r\n",int(ms),int(rayperseconds)); } /* Draw rays */ const btVector3 c[]={ origins[0], diff --git a/Extras/ConvexDecomposition/cd_wavefront.cpp b/Extras/ConvexDecomposition/cd_wavefront.cpp index 32c3e1164..fdd5f9884 100644 --- a/Extras/ConvexDecomposition/cd_wavefront.cpp +++ b/Extras/ConvexDecomposition/cd_wavefront.cpp @@ -603,12 +603,12 @@ int OBJ::LoadMesh(const char *fname,GeometryInterface *iface) return ret; } -static const char * GetArg(const char **argv,int i,int argc) -{ - const char * ret = 0; - if ( i < argc ) ret = argv[i]; - return ret; -} +//static const char * GetArg(const char **argv,int i,int argc) +//{ + // const char * ret = 0; + // if ( i < argc ) ret = argv[i]; + // return ret; +//} void OBJ::getVertex(GeometryVertex &v,const char *face) const { diff --git a/Extras/Serialize/BulletFileLoader/bDNA.cpp b/Extras/Serialize/BulletFileLoader/bDNA.cpp index 6f3684cb1..9108b11c7 100644 --- a/Extras/Serialize/BulletFileLoader/bDNA.cpp +++ b/Extras/Serialize/BulletFileLoader/bDNA.cpp @@ -382,7 +382,7 @@ void bDNA::init(char *data, int len, bool swap) { nr= (long)cp; - long mask=3; + //long mask=3; nr= ((nr+3)&~3)-nr; while (nr--) { @@ -415,7 +415,7 @@ void bDNA::init(char *data, int len, bool swap) { nr= (long)cp; - long mask=3; + // long mask=3; nr= ((nr+3)&~3)-nr; while (nr--) { diff --git a/Extras/Serialize/BulletFileLoader/btBulletFile.cpp b/Extras/Serialize/BulletFileLoader/btBulletFile.cpp index bd70e1289..10226d9f6 100644 --- a/Extras/Serialize/BulletFileLoader/btBulletFile.cpp +++ b/Extras/Serialize/BulletFileLoader/btBulletFile.cpp @@ -88,7 +88,7 @@ void btBulletFile::parseData() printf ("Chunk size = %d",CHUNK_HEADER_LEN); printf ("File chunk size = %d",ChunkUtils::getOffset(mFlags)); - const bool swap = (mFlags&FD_ENDIAN_SWAP)!=0; + //const bool swap = (mFlags&FD_ENDIAN_SWAP)!=0; mDataStart = 12; diff --git a/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp b/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp index 1f4d77349..edf9bccc7 100644 --- a/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp +++ b/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp @@ -226,9 +226,9 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap } case CONVEX_HULL_SHAPE_PROXYTYPE: { - int sz = sizeof(btConvexHullShapeData); - int sz2 = sizeof(btConvexInternalShapeData); - int sz3 = sizeof(btCollisionShapeData); + // int sz = sizeof(btConvexHullShapeData); + // int sz2 = sizeof(btConvexInternalShapeData); + // int sz3 = sizeof(btCollisionShapeData); btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd; int numPoints = convexData->m_numUnscaledPoints; @@ -407,11 +407,11 @@ bool btBulletWorldImporter::loadFileFromMemory( bParse::btBulletFile* bulletFil } } - for (i=0;im_collisionObjects.size();i++) - { - btCollisionObjectData* colObjData = (btCollisionObjectData*)bulletFile2->m_collisionObjects[i]; - printf("bla"); - } +// for (i=0;im_collisionObjects.size();i++) +// { +// btCollisionObjectData* colObjData = (btCollisionObjectData*)bulletFile2->m_collisionObjects[i]; +// printf("bla"); +// } for (i=0;im_constraints.size();i++) diff --git a/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp index 757a35973..f99d4e3e0 100644 --- a/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp @@ -135,7 +135,7 @@ static int ClipSegmentToLine(ClipVertex vOut[2], ClipVertex vIn[2], static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1, int edge1, const btBox2dShape* poly2, const btTransform& xf2) { - int count1 = poly1->getVertexCount(); + //int count1 = poly1->getVertexCount(); const btVector3* vertices1 = poly1->getVertices(); const btVector3* normals1 = poly1->getNormals(); @@ -271,7 +271,7 @@ static void FindIncidentEdge(ClipVertex c[2], const btBox2dShape* poly1, const btTransform& xf1, int edge1, const btBox2dShape* poly2, const btTransform& xf2) { - int count1 = poly1->getVertexCount(); + //int count1 = poly1->getVertexCount(); const btVector3* normals1 = poly1->getNormals(); int count2 = poly2->getVertexCount(); diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp index c04e70c53..1332f1294 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp @@ -30,8 +30,8 @@ btCollisionObject::btCollisionObject() m_deactivationTime(btScalar(0.)), m_friction(btScalar(0.5)), m_restitution(btScalar(0.)), - m_userObjectPointer(0), m_internalType(CO_COLLISION_OBJECT), + m_userObjectPointer(0), m_hitFraction(btScalar(1.)), m_ccdSweptSphereRadius(btScalar(0.)), m_ccdMotionThreshold(btScalar(0.)), diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index 7420764f0..c1d988aed 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -238,8 +238,8 @@ struct btPerturbedContactResult : public btManifoldResult :m_originalManifoldResult(originalResult), m_transformA(transformA), m_transformB(transformB), - m_perturbA(perturbA), m_unPerturbedTransform(unPerturbedTransform), + m_perturbA(perturbA), m_debugDrawer(debugDrawer) { } diff --git a/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp b/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp index 2487e6476..4537dba70 100644 --- a/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp +++ b/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp @@ -461,16 +461,16 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject* btVector3 center = (v0+v1+v2)*btScalar(1./3.); btVector3 red(1,0,0), green(0,1,0),blue(0,0,1),white(1,1,1),black(0,0,0); - const btTransform& tr = colObj0->getWorldTransform(); btVector3 tri_normal; tri_shape->calcNormal(tri_normal); - btScalar dot = tri_normal.dot(cp.m_normalWorldOnB); + //btScalar dot = tri_normal.dot(cp.m_normalWorldOnB); btVector3 nearest; btNearestPointInLineSegment(cp.m_localPointB,v0,v1,nearest); btVector3 contact = cp.m_localPointB; #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW + const btTransform& tr = colObj0->getWorldTransform(); btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,red); #endif //BT_INTERNAL_EDGE_DEBUG_DRAW diff --git a/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp b/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp index 9a93c0a78..bb127573d 100644 --- a/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp +++ b/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp @@ -189,7 +189,7 @@ bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const ///fills the dataBuffer and returns the struct name (and 0 on failure) const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const { - int szc = sizeof(btConvexHullShapeData); + //int szc = sizeof(btConvexHullShapeData); btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer; btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer); @@ -206,8 +206,8 @@ const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* seriali if (numElem) { int sz = sizeof(btVector3Data); - int sz2 = sizeof(btVector3DoubleData); - int sz3 = sizeof(btVector3FloatData); + // int sz2 = sizeof(btVector3DoubleData); + // int sz3 = sizeof(btVector3FloatData); btChunk* chunk = serializer->allocate(sz,numElem); btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr; for (int i=0;im_numMeshParts = getNumSubParts(); - void* uniquePtr = 0; + //void* uniquePtr = 0; trimeshData->m_meshPartsPtr = 0; @@ -201,7 +201,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s trimeshData->m_meshPartsPtr = memPtr; - int numtotalphysicsverts = 0; + // int numtotalphysicsverts = 0; int part,graphicssubparts = getNumSubParts(); const unsigned char * vertexbase; const unsigned char * indexbase; @@ -210,7 +210,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s PHY_ScalarType gfxindextype; int stride,numverts,numtriangles; int gfxindex; - btVector3 triangle[3]; + // btVector3 triangle[3]; btVector3 meshScaling = getScaling(); diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp index 172e36910..9c79ade2f 100644 --- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp @@ -56,9 +56,9 @@ m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD) static btRigidBody s_fixed(0, 0, 0); btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB) : btTypedConstraint(D6_CONSTRAINT_TYPE, s_fixed, rbB), - m_useSolveConstraintObsolete(false), m_frameInB(frameInB), - m_useLinearReferenceFrameA(useLinearReferenceFrameB) + m_useLinearReferenceFrameA(useLinearReferenceFrameB), + m_useSolveConstraintObsolete(false) { ///not providing rigidbody A means implicitly using worldspace for body A m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB; diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 024d66861..d3ac0b5ed 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -713,8 +713,8 @@ class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConve public: btClosestNotMeConvexResultCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) : btCollisionWorld::ClosestConvexResultCallback(fromA,toA), - m_allowedPenetration(0.0f), m_me(me), + m_allowedPenetration(0.0f), m_pairCache(pairCache), m_dispatcher(dispatcher) { diff --git a/src/BulletMultiThreaded/MiniCLTask/MiniCLTask.cpp b/src/BulletMultiThreaded/MiniCLTask/MiniCLTask.cpp index 40aec14b9..e7f424b1e 100644 --- a/src/BulletMultiThreaded/MiniCLTask/MiniCLTask.cpp +++ b/src/BulletMultiThreaded/MiniCLTask/MiniCLTask.cpp @@ -70,7 +70,7 @@ void processMiniCLTask(void* userPtr, void* lsMemory) { // BT_PROFILE("processSampleTask"); - MiniCLTask_LocalStoreMemory* localMemory = (MiniCLTask_LocalStoreMemory*)lsMemory; + //MiniCLTask_LocalStoreMemory* localMemory = (MiniCLTask_LocalStoreMemory*)lsMemory; MiniCLTaskDesc* taskDescPtr = (MiniCLTaskDesc*)userPtr; MiniCLTaskDesc& taskDesc = *taskDescPtr; diff --git a/src/BulletMultiThreaded/PosixThreadSupport.cpp b/src/BulletMultiThreaded/PosixThreadSupport.cpp index 241780940..540f0dcf1 100644 --- a/src/BulletMultiThreaded/PosixThreadSupport.cpp +++ b/src/BulletMultiThreaded/PosixThreadSupport.cpp @@ -172,7 +172,7 @@ void PosixThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned in // get at least one thread which has finished size_t last = -1; - for(size_t t=0; t < m_activeSpuStatus.size(); ++t) { + for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) { if(2 == m_activeSpuStatus[t].m_status) { last = t; break; @@ -233,9 +233,9 @@ void PosixThreadSupport::startSPU() ///tell the task scheduler we are done with the SPU tasks void PosixThreadSupport::stopSPU() { - for(size_t t=0; t < m_activeSpuStatus.size(); ++t) { + for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) { btSpuStatus& spuStatus = m_activeSpuStatus[t]; - printf("%s: Thread %i used: %ld\n", __FUNCTION__, t, spuStatus.threadUsed); + printf("%s: Thread %i used: %ld\n", __FUNCTION__, int(t), spuStatus.threadUsed); destroySem(spuStatus.startSemaphore); checkPThreadFunction(pthread_cancel(spuStatus.thread)); diff --git a/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp b/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp index dab42cc71..86eda8697 100644 --- a/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp +++ b/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp @@ -26,7 +26,7 @@ subject to the following restrictions: void SpuCollisionTaskProcess::setNumTasks(int maxNumTasks) { - if (m_maxNumOutstandingTasks != maxNumTasks) + if (int(m_maxNumOutstandingTasks) != maxNumTasks) { m_maxNumOutstandingTasks = maxNumTasks; m_taskBusy.resize(m_maxNumOutstandingTasks); @@ -69,7 +69,7 @@ m_maxNumOutstandingTasks(0) m_threadInterface->startSPU(); //printf("sizeof vec_float4: %d\n", sizeof(vec_float4)); - printf("sizeof SpuGatherAndProcessWorkUnitInput: %d\n", sizeof(SpuGatherAndProcessWorkUnitInput)); + printf("sizeof SpuGatherAndProcessWorkUnitInput: %d\n", int(sizeof(SpuGatherAndProcessWorkUnitInput))); } diff --git a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp index 49cff5a3f..a09d19c61 100644 --- a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp +++ b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp @@ -1033,7 +1033,7 @@ void processCollisionTask(void* userPtr, void* lsMemPtr) collisionPairInput.m_isSwapped); - float distance=0.f; + //float distance=0.f; btVector3 normalInB; diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index a4d78af8c..f6b98ddf4 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -2327,7 +2327,7 @@ void btSoftBody::solveClusters(btScalar sor) void btSoftBody::applyClusters(bool drift) { BT_PROFILE("ApplyClusters"); - const btScalar f0=m_sst.sdt; +// const btScalar f0=m_sst.sdt; //const btScalar f1=f0/2; btAlignedObjectArray deltas; btAlignedObjectArray weights; @@ -2625,6 +2625,9 @@ void btSoftBody::applyForces() nrm=NormalizeAny(rel_v);break; case btSoftBody::eAeroModel::V_TwoSided: nrm*=(btScalar)(btDot(nrm,rel_v)<0?-1:+1);break; + default: + { + } } const btScalar dvn=btDot(rel_v,nrm); /* Compute forces */ @@ -2671,6 +2674,9 @@ void btSoftBody::applyForces() { case btSoftBody::eAeroModel::F_TwoSided: nrm*=(btScalar)(btDot(nrm,rel_v)<0?-1:+1);break; + default: + { + } } const btScalar dvn=btDot(rel_v,nrm); /* Compute forces */ @@ -2815,6 +2821,9 @@ btSoftBody::psolver_t btSoftBody::getSolver(ePSolver::_ solver) return(&btSoftBody::PSolve_RContacts); case ePSolver::SContacts: return(&btSoftBody::PSolve_SContacts); + default: + { + } } return(0); } @@ -2825,6 +2834,9 @@ btSoftBody::vsolver_t btSoftBody::getSolver(eVSolver::_ solver) switch(solver) { case eVSolver::Linear: return(&btSoftBody::VSolve_Links); + default: + { + } } return(0); } diff --git a/src/BulletSoftBody/btSoftBodyHelpers.cpp b/src/BulletSoftBody/btSoftBodyHelpers.cpp index bbeffd6bf..516485bf4 100644 --- a/src/BulletSoftBody/btSoftBodyHelpers.cpp +++ b/src/BulletSoftBody/btSoftBodyHelpers.cpp @@ -380,7 +380,12 @@ void btSoftBodyHelpers::Draw( btSoftBody* psb, idraw->drawLine(o0,o0+a1*10,btVector3(1,1,0)); idraw->drawLine(o1,o1+a0*10,btVector3(0,1,1)); idraw->drawLine(o1,o1+a1*10,btVector3(0,1,1)); + break; } + default: + { + } + } } } diff --git a/src/LinearMath/btConvexHull.cpp b/src/LinearMath/btConvexHull.cpp index 8ff54288b..532d76d88 100644 --- a/src/LinearMath/btConvexHull.cpp +++ b/src/LinearMath/btConvexHull.cpp @@ -1156,7 +1156,7 @@ void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, b for (int k=0;k