diff --git a/Demos/AllBulletDemos/Main.cpp b/Demos/AllBulletDemos/Main.cpp index ce909251e..cec0ff1c0 100644 --- a/Demos/AllBulletDemos/Main.cpp +++ b/Demos/AllBulletDemos/Main.cpp @@ -47,7 +47,7 @@ namespace int framePeriod;//todo: test if this value should be 0 int mainWindow; GLUI *glui; - float hz; + //float hz; float viewZoom=20.f; float viewX; float viewY; diff --git a/Demos/Box2dDemo/Box2dDemo.cpp b/Demos/Box2dDemo/Box2dDemo.cpp index 5c87a2543..3d591c878 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; diff --git a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp index 4bdfc162e..da2b9cb86 100644 --- a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp +++ b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp @@ -49,7 +49,7 @@ void CcdPhysicsDemo::clientMoveAndDisplay() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //simple dynamics world doesn't handle fixed-time-stepping - float ms = getDeltaTimeMicroseconds(); + //float ms = getDeltaTimeMicroseconds(); ///step the simulation if (m_dynamicsWorld) diff --git a/Demos/CharacterDemo/CharacterDemo.cpp b/Demos/CharacterDemo/CharacterDemo.cpp index 54452492a..085a5839c 100644 --- a/Demos/CharacterDemo/CharacterDemo.cpp +++ b/Demos/CharacterDemo/CharacterDemo.cpp @@ -44,11 +44,11 @@ static int gJump = 0; CharacterDemo::CharacterDemo() : +m_indexVertexArrays(0), +m_vertices(0), m_cameraHeight(4.f), m_minCameraDistance(3.f), -m_maxCameraDistance(10.f), -m_indexVertexArrays(0), -m_vertices(0) +m_maxCameraDistance(10.f) { m_character = 0; m_cameraPosition = btVector3(30,30,30); diff --git a/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp b/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp index ed8c2902f..c44d9a558 100644 --- a/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp +++ b/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.cpp @@ -246,8 +246,8 @@ void CollisionInterfaceDemo::displayCallback(void) { //GL_ShapeDrawer::drawCoordSystem(); - btQuaternion qA = objects[0].getWorldTransform().getRotation(); - btQuaternion qB = objects[1].getWorldTransform().getRotation(); +// btQuaternion qA = objects[0].getWorldTransform().getRotation(); +// btQuaternion qB = objects[1].getWorldTransform().getRotation(); if (!m_idle) diff --git a/Demos/ConcaveConvexcastDemo/ConcaveConvexcastDemo.cpp b/Demos/ConcaveConvexcastDemo/ConcaveConvexcastDemo.cpp index 867832556..8faf62a42 100644 --- a/Demos/ConcaveConvexcastDemo/ConcaveConvexcastDemo.cpp +++ b/Demos/ConcaveConvexcastDemo/ConcaveConvexcastDemo.cpp @@ -92,7 +92,7 @@ public: this->min_y = min_y; this->max_y = max_y; sign = 1.0; - btScalar dalpha = 2*SIMD_2_PI/NUMRAYS_IN_BAR; + // btScalar dalpha = 2*SIMD_2_PI/NUMRAYS_IN_BAR; for (int i = 0; i < NUMRAYS_IN_BAR; i++) { btScalar z = (max_z-min_z)/NUMRAYS_IN_BAR * i + min_z; diff --git a/Demos/ConstraintDemo/ConstraintDemo.cpp b/Demos/ConstraintDemo/ConstraintDemo.cpp index a35faa717..afabc114f 100644 --- a/Demos/ConstraintDemo/ConstraintDemo.cpp +++ b/Demos/ConstraintDemo/ConstraintDemo.cpp @@ -127,7 +127,7 @@ void ConstraintDemo::initPhysics() btRigidBody* body0 = localCreateRigidBody( mass,trans,shape); trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0)); mass = 1.f; - btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape); + // btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape); btVector3 pivotInA(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,0); btTypedConstraint* p2p = new btPoint2PointConstraint(*body0,pivotInA); m_dynamicsWorld->addConstraint(p2p); @@ -145,7 +145,7 @@ void ConstraintDemo::initPhysics() trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0)); mass = 1.f; - btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape); +// btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape); // btRigidBody* body1 = localCreateRigidBody( 0.0,trans,0); //body1->setActivationState(DISABLE_DEACTIVATION); //body1->setDamping(0.3,0.3); @@ -153,9 +153,9 @@ void ConstraintDemo::initPhysics() btVector3 pivotInA(CUBE_HALF_EXTENTS,-CUBE_HALF_EXTENTS,-CUBE_HALF_EXTENTS); btVector3 axisInA(0,0,1); - btVector3 pivotInB = body1 ? body1->getCenterOfMassTransform().inverse()(body0->getCenterOfMassTransform()(pivotInA)) : pivotInA; - btVector3 axisInB = body1? - (body1->getCenterOfMassTransform().getBasis().inverse()*(body1->getCenterOfMassTransform().getBasis() * axisInA)) : + // btVector3 pivotInB = body1 ? body1->getCenterOfMassTransform().inverse()(body0->getCenterOfMassTransform()(pivotInA)) : pivotInA; +// btVector3 axisInB = body1? +// (body1->getCenterOfMassTransform().getBasis().inverse()*(body1->getCenterOfMassTransform().getBasis() * axisInA)) : body0->getCenterOfMassTransform().getBasis() * axisInA; #define P2P diff --git a/Demos/FractureDemo/btFractureDynamicsWorld.cpp b/Demos/FractureDemo/btFractureDynamicsWorld.cpp index 2fbcce406..a5c13e83d 100644 --- a/Demos/FractureDemo/btFractureDynamicsWorld.cpp +++ b/Demos/FractureDemo/btFractureDynamicsWorld.cpp @@ -29,7 +29,7 @@ void btFractureDynamicsWorld::glueCallback() for (i=0;iisStaticOrKinematicObject()) @@ -68,8 +68,8 @@ void btFractureDynamicsWorld::glueCallback() btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1(); int tag0 = (colObj0)->getIslandTag(); int tag1 = (colObj1)->getIslandTag(); - btRigidBody* body0 = btRigidBody::upcast(colObj0); - btRigidBody* body1 = btRigidBody::upcast(colObj1); + //btRigidBody* body0 = btRigidBody::upcast(colObj0); + //btRigidBody* body1 = btRigidBody::upcast(colObj1); if (!colObj0->isStaticOrKinematicObject() && !colObj1->isStaticOrKinematicObject()) @@ -410,7 +410,7 @@ void btFractureDynamicsWorld::breakDisconnectedParts( btFractureBody* fracObj) { } - int fractureObjectIndex = -1; + // int fractureObjectIndex = -1; int numShapes=0; @@ -422,7 +422,7 @@ void btFractureDynamicsWorld::breakDisconnectedParts( btFractureBody* fracObj) for (idx=startIslandIndex;idxgetChildShape(i); + // btCollisionShape* shape = compound->getChildShape(i); newCompound->addChildShape(compound->getChildTransform(i),compound->getChildShape(i)); masses.push_back(fracObj->m_masses[i]); numShapes++; diff --git a/Demos/MultiMaterialDemo/MultiMaterialDemo.cpp b/Demos/MultiMaterialDemo/MultiMaterialDemo.cpp index dee265683..14e961982 100644 --- a/Demos/MultiMaterialDemo/MultiMaterialDemo.cpp +++ b/Demos/MultiMaterialDemo/MultiMaterialDemo.cpp @@ -160,8 +160,8 @@ void MultiMaterialDemo::initPhysics() int vertStride = sizeof(btVector3); int indexStride = 3*sizeof(int); - int materialStride = sizeof(CustomMaterial); - int triangleMaterialStride = sizeof(int); + // int materialStride = sizeof(CustomMaterial); + // int triangleMaterialStride = sizeof(int); gVertices = new btVector3[totalVerts]; gIndices = new int[totalTriangles*3]; diff --git a/Demos/MultiThreadedDemo/MultiThreadedDemo.cpp b/Demos/MultiThreadedDemo/MultiThreadedDemo.cpp index 521fd8187..a8dd7cef8 100644 --- a/Demos/MultiThreadedDemo/MultiThreadedDemo.cpp +++ b/Demos/MultiThreadedDemo/MultiThreadedDemo.cpp @@ -176,7 +176,7 @@ void MultiThreadedDemo::clientMoveAndDisplay() - float dt = getDeltaTimeMicroseconds() * 0.000001f; +// float dt = getDeltaTimeMicroseconds() * 0.000001f; // printf("dt = %f: ",dt); diff --git a/Demos/OpenGL/GLDebugDrawer.cpp b/Demos/OpenGL/GLDebugDrawer.cpp index 79758df6c..a1d40e879 100644 --- a/Demos/OpenGL/GLDebugDrawer.cpp +++ b/Demos/OpenGL/GLDebugDrawer.cpp @@ -12,6 +12,10 @@ GLDebugDrawer::GLDebugDrawer() } +GLDebugDrawer::~GLDebugDrawer() +{ +} + void GLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor) { glBegin(GL_LINES); diff --git a/Demos/OpenGL/GLDebugDrawer.h b/Demos/OpenGL/GLDebugDrawer.h index 2a05405a7..4ac170337 100644 --- a/Demos/OpenGL/GLDebugDrawer.h +++ b/Demos/OpenGL/GLDebugDrawer.h @@ -12,7 +12,7 @@ class GLDebugDrawer : public btIDebugDraw public: GLDebugDrawer(); - + virtual ~GLDebugDrawer(); virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor); diff --git a/Demos/OpenGL/GL_Simplex1to4.cpp b/Demos/OpenGL/GL_Simplex1to4.cpp index b364a1b98..440f41d01 100644 --- a/Demos/OpenGL/GL_Simplex1to4.cpp +++ b/Demos/OpenGL/GL_Simplex1to4.cpp @@ -34,6 +34,10 @@ GL_Simplex1to4::GL_Simplex1to4() { } +GL_Simplex1to4::~GL_Simplex1to4() +{ +} + /// /// Debugging method calcClosest calculates the closest point to the origin, using m_simplexSolver /// diff --git a/Demos/OpenGL/GL_Simplex1to4.h b/Demos/OpenGL/GL_Simplex1to4.h index c75e3573b..e256aab82 100644 --- a/Demos/OpenGL/GL_Simplex1to4.h +++ b/Demos/OpenGL/GL_Simplex1to4.h @@ -28,6 +28,7 @@ class GL_Simplex1to4 : public btBU_Simplex1to4 public: GL_Simplex1to4(); + virtual ~GL_Simplex1to4(); void calcClosest(btScalar* m); diff --git a/Demos/OpenGL/stb_image.cpp b/Demos/OpenGL/stb_image.cpp index fb2de7d6d..a60e13024 100644 --- a/Demos/OpenGL/stb_image.cpp +++ b/Demos/OpenGL/stb_image.cpp @@ -1402,7 +1402,6 @@ static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 *in_far, in { // resample with nearest-neighbor int i,j; - in_far = in_far; for (i=0; i < w; ++i) for (j=0; j < hs; ++j) out[i*hs+j] = in_near[i]; diff --git a/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp b/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp index 24b4636f2..8bbced421 100644 --- a/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp +++ b/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp @@ -631,8 +631,8 @@ void btParticlesDynamicsWorld::runCollideParticlesKernel() { btAlignedObjectArray pairs; - float particleRad = m_simParams.m_particleRad; - float collideDist2 = (particleRad + particleRad)*(particleRad + particleRad); +// float particleRad = m_simParams.m_particleRad; +// float collideDist2 = (particleRad + particleRad)*(particleRad + particleRad); cl_int ciErrNum; if(m_useCpuControls[SIMSTAGE_COLLIDE_PARTICLES]->m_active) { // CPU version diff --git a/Demos/Raytracer/Raytracer.cpp b/Demos/Raytracer/Raytracer.cpp index 7d78901cc..97810a1ff 100644 --- a/Demos/Raytracer/Raytracer.cpp +++ b/Demos/Raytracer/Raytracer.cpp @@ -227,7 +227,7 @@ bool Raytracer::worldRaytest(const btVector3& rayFrom,const btVector3& rayTo,btV bool Raytracer::singleObjectRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint) { - btScalar closestHitResults = 1.f; +// btScalar closestHitResults = 1.f; btCollisionWorld::ClosestRayResultCallback resultCallback(rayFrom,rayTo); @@ -478,7 +478,9 @@ void Raytracer::displayCallback() rgba[3] = 1.f; raytracePicture->setPixel(x,y,rgba); } else - btVector4 rgba = raytracePicture->getPixel(x,y); + { + // btVector4 rgba = raytracePicture->getPixel(x,y); + } if (!rgba.length2()) { raytracePicture->setPixel(x,y,btVector4(1,1,1,1)); diff --git a/Demos/SerializeDemo/SerializeDemo.cpp b/Demos/SerializeDemo/SerializeDemo.cpp index 9b6117cc6..2a128214b 100644 --- a/Demos/SerializeDemo/SerializeDemo.cpp +++ b/Demos/SerializeDemo/SerializeDemo.cpp @@ -98,8 +98,8 @@ void SerializeDemo::keyboardCallback(unsigned char key, int x, int y) btCollisionObject* colObj0 = (btCollisionObject*)manifold->getBody0(); btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1(); - int tag0 = (colObj0)->getIslandTag(); - int tag1 = (colObj1)->getIslandTag(); + // int tag0 = (colObj0)->getIslandTag(); + // int tag1 = (colObj1)->getIslandTag(); btRigidBody* body0 = btRigidBody::upcast(colObj0); btRigidBody* body1 = btRigidBody::upcast(colObj1); if (bodies.findLinearSearch(body0)==bodies.size()) diff --git a/Demos/SharedOpenCL/btOpenCLUtils.cpp b/Demos/SharedOpenCL/btOpenCLUtils.cpp index 318e6d259..03fcf005e 100644 --- a/Demos/SharedOpenCL/btOpenCLUtils.cpp +++ b/Demos/SharedOpenCL/btOpenCLUtils.cpp @@ -755,7 +755,7 @@ cl_kernel btOpenCLUtils::compileCLKernelFromString(cl_context clContext, cl_devi printf("compiling kernel %s ",kernelName); cl_kernel kernel; cl_int localErrNum; - size_t program_length = strlen(kernelSource); + //size_t program_length = strlen(kernelSource); cl_program m_cpProgram = prog; diff --git a/Demos/SliderConstraintDemo/SliderConstraintDemo.cpp b/Demos/SliderConstraintDemo/SliderConstraintDemo.cpp index 15e392f09..12fe4e56d 100755 --- a/Demos/SliderConstraintDemo/SliderConstraintDemo.cpp +++ b/Demos/SliderConstraintDemo/SliderConstraintDemo.cpp @@ -55,7 +55,7 @@ April 24, 2008 #endif static btPoint2PointConstraint* spP2PConst; -static btHingeConstraint* spHingeConst; +//static btHingeConstraint* spHingeConst; diff --git a/Demos/SoftDemo/SoftDemo.cpp b/Demos/SoftDemo/SoftDemo.cpp index d25acfc72..2413c0211 100644 --- a/Demos/SoftDemo/SoftDemo.cpp +++ b/Demos/SoftDemo/SoftDemo.cpp @@ -52,7 +52,7 @@ static btRigidBody* staticBody = 0; static float waveheight = 5.f; const float TRIANGLE_SIZE=8.f; -unsigned int current_demo=20; +int current_demo=20; #define DEMO_MODE_TIMEOUT 15.f //15 seconds for each demo @@ -1663,7 +1663,7 @@ void SoftDemo::clientMoveAndDisplay() #else //during idle mode, just run 1 simulation step maximum, otherwise 4 at max - int maxSimSubSteps = m_idle ? 1 : 4; + // int maxSimSubSteps = m_idle ? 1 : 4; //if (m_idle) // dt = 1.0/420.f; @@ -1743,10 +1743,10 @@ void SoftDemo::renderme() glDisable(GL_LIGHTING); m_dynamicsWorld->debugDrawWorld(); - int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1; + //int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1; btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld; - btIDebugDraw* sdraw = softWorld ->getDebugDrawer(); + //btIDebugDraw* sdraw = softWorld ->getDebugDrawer(); for ( int i=0;igetSoftBodyArray().size();i++) diff --git a/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp b/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp index ab9fd7f1d..5857f8cea 100644 --- a/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp +++ b/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp @@ -223,8 +223,8 @@ int main(int argc, char **argv) const char* cSourceFile = "VectorAddKernels.cl"; printf("loadProgSource (%s)...\n", cSourceFile); - const char* cPathAndName = cSourceFile; #ifdef LOAD_FROM_FILE + const char* cPathAndName = cSourceFile; size_t szKernelLength; const char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength); #else diff --git a/Demos/VoronoiFractureDemo/VoronoiFractureDemo.cpp b/Demos/VoronoiFractureDemo/VoronoiFractureDemo.cpp index a7d074752..174c795c3 100644 --- a/Demos/VoronoiFractureDemo/VoronoiFractureDemo.cpp +++ b/Demos/VoronoiFractureDemo/VoronoiFractureDemo.cpp @@ -65,8 +65,8 @@ void VoronoiFractureDemo::attachFixedConstraints() btCollisionObject* colObj0 = (btCollisionObject*)manifold->getBody0(); btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1(); - int tag0 = (colObj0)->getIslandTag(); - int tag1 = (colObj1)->getIslandTag(); + // int tag0 = (colObj0)->getIslandTag(); +// int tag1 = (colObj1)->getIslandTag(); btRigidBody* body0 = btRigidBody::upcast(colObj0); btRigidBody* body1 = btRigidBody::upcast(colObj1); if (bodies.findLinearSearch(body0)==bodies.size()) diff --git a/Extras/ConvexDecomposition/cd_hull.cpp b/Extras/ConvexDecomposition/cd_hull.cpp index 0f7d98942..0fc8b51e0 100644 --- a/Extras/ConvexDecomposition/cd_hull.cpp +++ b/Extras/ConvexDecomposition/cd_hull.cpp @@ -2534,7 +2534,7 @@ int calchullgen(float3 *verts,int verts_count, int vlimit,Array vlimit-=4; while(vlimit >0 && (te=extrudable(epsilon, tris))) { - int3 ti=*te; + // int3 ti=*te; int v=te->vmax; assert(!isextreme[v]); // wtf we've already done this vertex isextreme[v]=1; diff --git a/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp b/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp index 8e3b92d9d..e3e363b8d 100644 --- a/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp +++ b/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp @@ -539,7 +539,7 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap tmpPos[i].deSerializeFloat(mss->m_localPositionArrayPtr[i].m_pos); radii[i] = mss->m_localPositionArrayPtr[i].m_radius; } - shape = new btMultiSphereShape(&tmpPos[0],&radii[0],numSpheres); + shape = createMultiSphereShape(&tmpPos[0],&radii[0],numSpheres); break; } case CONVEX_HULL_SHAPE_PROXYTYPE: @@ -1393,6 +1393,12 @@ btScaledBvhTriangleMeshShape* btBulletWorldImporter::createScaledTrangleMeshShap return shape; } +btMultiSphereShape* btBulletWorldImporter::createMultiSphereShape(const btVector3* positions,const btScalar* radi,int numSpheres) +{ + btMultiSphereShape* shape = new btMultiSphereShape(positions, radi, numSpheres); + m_allocatedCollisionShapes.push_back(shape); + return shape; +} btRigidBody& btBulletWorldImporter::getFixedBody() { diff --git a/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.h b/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.h index 05c3ccbfc..5a273686f 100644 --- a/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.h +++ b/Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.h @@ -183,6 +183,8 @@ public: virtual class btCompoundShape* createCompoundShape(); virtual class btScaledBvhTriangleMeshShape* createScaledTrangleMeshShape(btBvhTriangleMeshShape* meshShape,const btVector3& localScalingbtBvhTriangleMeshShape); + virtual class btMultiSphereShape* createMultiSphereShape(const btVector3* positions,const btScalar* radi,int numSpheres); + virtual btTriangleIndexVertexArray* createMeshInterface(btStridingMeshInterfaceData& meshData); ///acceleration and connectivity structures diff --git a/Extras/glui/GL/glui.h b/Extras/glui/GL/glui.h index 2deb9dc45..4ef2d3b71 100644 --- a/Extras/glui/GL/glui.h +++ b/Extras/glui/GL/glui.h @@ -1017,7 +1017,7 @@ public: spacebar_mouse_click = true; /* Does spacebar simulate a mouse click? */ live_type = GLUI_LIVE_NONE; text = ""; - last_live_text == ""; + // last_live_text == ""; live_inited = false; collapsible = false; is_open = true; diff --git a/build/premake4.lua b/build/premake4.lua index 4fa810fb3..194fefa70 100644 --- a/build/premake4.lua +++ b/build/premake4.lua @@ -9,8 +9,8 @@ solution "0BulletSolution" } newoption { - trigger = "with-demos", - description = "Enable demos and extras" + trigger = "without-demos", + description = "Disable demos and extras" } newoption { @@ -165,7 +165,7 @@ end include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia" end - if _OPTIONS["with-demos"] then + if not _OPTIONS["without-demos"] then include "../Demos" include "../Extras" end diff --git a/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp index ee3f95467..2c3627782 100644 --- a/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp @@ -354,7 +354,7 @@ void b2CollidePolygons(btManifoldResult* manifold, btVector3 v11 = vertices1[edge1]; btVector3 v12 = edge1 + 1 < count1 ? vertices1[edge1+1] : vertices1[0]; - btVector3 dv = v12 - v11; + //btVector3 dv = v12 - v11; btVector3 sideNormal = b2Mul(xf1.getBasis(), v12 - v11); sideNormal.normalize(); btVector3 frontNormal = btCrossS(sideNormal, 1.0f); diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index 72a39c530..fda3e7a0f 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -314,8 +314,8 @@ void btConvexConvexAlgorithm ::processCollision (const btCollisionObjectWrapper* { btCapsuleShape* capsuleA = (btCapsuleShape*) min0; btCapsuleShape* capsuleB = (btCapsuleShape*) min1; - btVector3 localScalingA = capsuleA->getLocalScaling(); - btVector3 localScalingB = capsuleB->getLocalScaling(); + // btVector3 localScalingA = capsuleA->getLocalScaling(); + // btVector3 localScalingB = capsuleB->getLocalScaling(); btScalar threshold = m_manifoldPtr->getContactBreakingThreshold(); diff --git a/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp b/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp index a8d526f53..73fa4e87e 100644 --- a/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp +++ b/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp @@ -482,7 +482,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr tri_shape->getVertex(1,v1); tri_shape->getVertex(2,v2); - btVector3 center = (v0+v1+v2)*btScalar(1./3.); + //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); btVector3 tri_normal; diff --git a/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp b/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp index d45911519..ad1d1bf78 100644 --- a/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp +++ b/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp @@ -44,7 +44,7 @@ btVector3 btConvexPointCloudShape::localGetSupportingVertexWithoutMargin(const b if( m_numPoints > 0 ) { // Here we take advantage of dot(a*b, c) = dot( a, b*c) to do less work. Note this transformation is true mathematically, not numerically. - btVector3 scaled = vec * m_localScaling; + // btVector3 scaled = vec * m_localScaling; int index = (int) vec.maxDot( &m_unscaledPoints[0], m_numPoints, maxDot); //FIXME: may violate encapsulation of m_unscaledPoints return getScaledPoint(index); } diff --git a/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp b/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp index dd22fc563..b3d449676 100644 --- a/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp +++ b/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp @@ -242,7 +242,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s int gfxindex; // btVector3 triangle[3]; - btVector3 meshScaling = getScaling(); + // btVector3 meshScaling = getScaling(); ///if the number of parts is big, the performance might drop due to the innerloop switch on indextype for (part=0;part SIMD_EPSILON) - { - // non-zero twist?! this should never happen. - int wtf = 0; wtf = wtf; - } - +#if 0 + // non-zero twist?! this should never happen. + btAssert(fabs(vSwingAxis.x()) <= SIMD_EPSILON)); +#endif + // Compute limit for given swing. tricky: // Given a swing axis, we're looking for the intersection with the bounding cone ellipse. // (Since we're dealing with angles, this ellipse is embedded on the surface of a sphere.) @@ -877,8 +876,10 @@ void btConeTwistConstraint::computeConeLimitInfo(const btQuaternion& qCone, else if (swingAngle < 0) { // this should never happen! - int wtf = 0; wtf = wtf; - } +#if 0 + btAssert(0); +#endif + } } btVector3 btConeTwistConstraint::GetPointForAngle(btScalar fAngleInRadians, btScalar fLength) const @@ -929,7 +930,9 @@ void btConeTwistConstraint::computeTwistLimitInfo(const btQuaternion& qTwist, if (twistAngle < 0) { // this should never happen - int wtf = 0; wtf = wtf; +#if 0 + btAssert(0); +#endif } vTwistAxis = btVector3(qMinTwist.x(), qMinTwist.y(), qMinTwist.z()); @@ -976,10 +979,10 @@ void btConeTwistConstraint::setMotorTarget(const btQuaternion &q) { btTransform trACur = m_rbA.getCenterOfMassTransform(); btTransform trBCur = m_rbB.getCenterOfMassTransform(); - btTransform trABCur = trBCur.inverse() * trACur; - btQuaternion qABCur = trABCur.getRotation(); - btTransform trConstraintCur = (trBCur * m_rbBFrame).inverse() * (trACur * m_rbAFrame); - btQuaternion qConstraintCur = trConstraintCur.getRotation(); +// btTransform trABCur = trBCur.inverse() * trACur; +// btQuaternion qABCur = trABCur.getRotation(); +// btTransform trConstraintCur = (trBCur * m_rbBFrame).inverse() * (trACur * m_rbAFrame); + //btQuaternion qConstraintCur = trConstraintCur.getRotation(); btQuaternion qConstraint = m_rbBFrame.getRotation().inverse() * q * m_rbAFrame.getRotation(); setMotorTargetInConstraintSpace(qConstraint); diff --git a/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h b/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h index 581b711a5..09c048bed 100644 --- a/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h @@ -144,6 +144,7 @@ public: virtual void solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep); + void updateRHS(btScalar timeStep); diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp index 2b3871498..6f765884e 100644 --- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp @@ -118,7 +118,7 @@ void btGeneric6DofSpringConstraint::internalUpdateSprings(btConstraintInfo2* inf { // it is assumed that calculateTransforms() have been called before this call int i; - btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity(); + //btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity(); for(i = 0; i < 3; i++) { if(m_springEnabled[i]) diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp index 9e3a2baee..20b35fb9c 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -702,8 +702,8 @@ void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info btTransform trA = transA*m_rbAFrame; btTransform trB = transB*m_rbBFrame; // pivot point - btVector3 pivotAInW = trA.getOrigin(); - btVector3 pivotBInW = trB.getOrigin(); +// btVector3 pivotAInW = trA.getOrigin(); +// btVector3 pivotBInW = trB.getOrigin(); #if 1 // difference between frames in WCS btVector3 ofs = trB.getOrigin() - trA.getOrigin(); diff --git a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp index 7e0d93b97..11b2ec801 100644 --- a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp @@ -124,7 +124,7 @@ void btPoint2PointConstraint::getInfo2NonVirtual (btConstraintInfo2* info, const btVector3 a2 = body1_trans.getBasis()*getPivotInB(); { - btVector3 a2n = -a2; + // btVector3 a2n = -a2; btVector3* angular0 = (btVector3*)(info->m_J2angularAxis); btVector3* angular1 = (btVector3*)(info->m_J2angularAxis+info->rowskip); btVector3* angular2 = (btVector3*)(info->m_J2angularAxis+2*info->rowskip); diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index f02cee114..31f845e5a 100644 --- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -677,8 +677,8 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m int solverBodyIdA = getOrInitSolverBody(*colObj0); int solverBodyIdB = getOrInitSolverBody(*colObj1); - btRigidBody* bodyA = btRigidBody::upcast(colObj0); - btRigidBody* bodyB = btRigidBody::upcast(colObj1); +// btRigidBody* bodyA = btRigidBody::upcast(colObj0); +// btRigidBody* bodyB = btRigidBody::upcast(colObj1); btSolverBody* solverBodyA = &m_tmpSolverBodyPool[solverBodyIdA]; btSolverBody* solverBodyB = &m_tmpSolverBodyPool[solverBodyIdB]; @@ -686,7 +686,7 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m ///avoid collision response between two static objects - if (!solverBodyA || !solverBodyA->m_originalBody && (!solverBodyB || !solverBodyB->m_originalBody)) + if (!solverBodyA || (!solverBodyA->m_originalBody && (!solverBodyB || !solverBodyB->m_originalBody))) return; for (int j=0;jgetNumContacts();j++) @@ -704,8 +704,8 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m int frictionIndex = m_tmpSolverContactConstraintPool.size(); btSolverConstraint& solverConstraint = m_tmpSolverContactConstraintPool.expandNonInitializing(); - btRigidBody* rb0 = btRigidBody::upcast(colObj0); - btRigidBody* rb1 = btRigidBody::upcast(colObj1); +// btRigidBody* rb0 = btRigidBody::upcast(colObj0); +// btRigidBody* rb1 = btRigidBody::upcast(colObj1); solverConstraint.m_solverBodyIdA = solverBodyIdA; solverConstraint.m_solverBodyIdB = solverBodyIdB; @@ -908,7 +908,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol info2.m_J2angularAxis = currentConstraintRow->m_relpos2CrossNormal; info2.rowskip = sizeof(btSolverConstraint)/sizeof(btScalar);//check this ///the size of btSolverConstraint needs be a multiple of btScalar - btAssert(info2.rowskip*sizeof(btScalar)== sizeof(btSolverConstraint)); + btAssert(info2.rowskip*sizeof(btScalar)== sizeof(btSolverConstraint)); info2.m_constraintError = ¤tConstraintRow->m_rhs; currentConstraintRow->m_cfm = infoGlobal.m_globalCfm; info2.m_damping = infoGlobal.m_damping; @@ -997,7 +997,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol } } - btContactSolverInfo info = infoGlobal; +// btContactSolverInfo info = infoGlobal; int numNonContactPool = m_tmpSolverNonContactConstraintPool.size(); diff --git a/src/BulletDynamics/ConstraintSolver/btSolverBody.h b/src/BulletDynamics/ConstraintSolver/btSolverBody.h index b027acbf6..4e1a8df6a 100644 --- a/src/BulletDynamics/ConstraintSolver/btSolverBody.h +++ b/src/BulletDynamics/ConstraintSolver/btSolverBody.h @@ -275,7 +275,7 @@ ATTRIBUTE_ALIGNED64 (struct) btSolverBody btTransform newTransform; if (m_pushVelocity[0]!=0.f || m_pushVelocity[1]!=0 || m_pushVelocity[2]!=0 || m_turnVelocity[0]!=0.f || m_turnVelocity[1]!=0 || m_turnVelocity[2]!=0) { - btQuaternion orn = m_worldTransform.getRotation(); + // btQuaternion orn = m_worldTransform.getRotation(); btTransformUtil::integrateTransform(m_worldTransform,m_pushVelocity,m_turnVelocity*splitImpulseTurnErp,timeStep,newTransform); m_worldTransform = newTransform; } diff --git a/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h b/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h index b85f5c282..c3951f664 100644 --- a/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h @@ -27,7 +27,7 @@ class btRigidBody; ///1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and friction constraints. -ATTRIBUTE_ALIGNED64 (struct) btSolverConstraint +ATTRIBUTE_ALIGNED16 (struct) btSolverConstraint { BT_DECLARE_ALIGNED_ALLOCATOR(); @@ -42,41 +42,27 @@ ATTRIBUTE_ALIGNED64 (struct) btSolverConstraint mutable btSimdScalar m_appliedPushImpulse; mutable btSimdScalar m_appliedImpulse; - - + btScalar m_friction; btScalar m_jacDiagABInv; - union - { - int m_numConsecutiveRowsPerKernel; - btScalar m_unusedPadding0; - }; - - int m_overrideNumSolverIterations; - - union - { - int m_frictionIndex; - btScalar m_unusedPadding1; - }; + btScalar m_rhs; + btScalar m_cfm; - int m_solverBodyIdA; - - int m_solverBodyIdB; - - union + btScalar m_lowerLimit; + btScalar m_upperLimit; + btScalar m_rhsPenetration; + union { void* m_originalContactPoint; btScalar m_unusedPadding4; }; - btScalar m_rhs; - btScalar m_cfm; - btScalar m_lowerLimit; - btScalar m_upperLimit; - - btScalar m_rhsPenetration; + int m_overrideNumSolverIterations; + int m_frictionIndex; + int m_solverBodyIdA; + int m_solverBodyIdB; + enum btSolverConstraintType { BT_SOLVER_CONTACT_1D = 0, diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 24751af5b..3f6f5c015 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -203,13 +203,14 @@ struct InplaceSolverIslandCallback : public btSimulationIslandManager::IslandCal btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration) :btDynamicsWorld(dispatcher,pairCache,collisionConfiguration), +m_sortedConstraints (), +m_solverIslandCallback ( NULL ), m_constraintSolver(constraintSolver), m_gravity(0,-10,0), m_localTime(0), m_synchronizeAllMotionStates(false), -m_profileTimings(0), -m_sortedConstraints (), -m_solverIslandCallback ( NULL ) +m_profileTimings(0) + { if (!m_constraintSolver) { diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp index 33b24da03..3293c2b88 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp @@ -793,7 +793,7 @@ void btOpenCLSoftBodySolver::optimize( btAlignedObjectArray< btSoftBody * > &sof int firstLink = getLinkData().getNumLinks(); int numLinks = softBody->m_links.size(); - int maxLinks = numLinks; +// int maxLinks = numLinks; // Allocate space for the links getLinkData().createLinks( numLinks ); diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index b05efe598..c4a9b6c41 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -460,8 +460,8 @@ void btSoftBody::addAeroForceToNode(const btVector3& windVelocity,int nodeInde const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; - const btScalar kPR = m_cfg.kPR; - const btScalar kVC = m_cfg.kVC; + //const btScalar kPR = m_cfg.kPR; + //const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_aero = as_lift || as_drag; diff --git a/src/LinearMath/btConvexHull.cpp b/src/LinearMath/btConvexHull.cpp index e57f8d88a..2ae855dbc 100644 --- a/src/LinearMath/btConvexHull.cpp +++ b/src/LinearMath/btConvexHull.cpp @@ -563,7 +563,7 @@ int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit) vlimit-=4; while(vlimit >0 && ((te=extrudable(epsilon)) != 0)) { - int3 ti=*te; + //int3 ti=*te; int v=te->vmax; btAssert(v != -1); btAssert(!isextreme[v]); // wtf we've already done this vertex