From bc3f9535adcf7343a3375a53053e2523ad53a5f9 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Fri, 13 Apr 2007 01:37:21 +0000 Subject: [PATCH] cleaned up, removed warning under MSVC2005 (Level 4) Mostly related to alignment and unused variables --- Demos/OpenGL/DemoApplication.cpp | 6 +++ Demos/OpenGL/GL_ShapeDrawer.cpp | 12 ++++- .../BroadphaseCollision/btAxisSweep3.cpp | 11 ++--- .../BroadphaseCollision/btAxisSweep3.h | 2 +- .../BroadphaseCollision/btBroadphaseProxy.h | 2 +- .../btCollisionAlgorithm.h | 1 + .../btSimpleBroadphase.cpp | 11 ++--- .../BroadphaseCollision/btSimpleBroadphase.h | 1 + .../SphereTriangleDetector.cpp | 8 ++-- .../CollisionDispatch/btCollisionCreateFunc.h | 5 ++- .../btCollisionDispatcher.cpp | 11 +++++ .../CollisionDispatch/btCollisionObject.h | 6 ++- .../CollisionDispatch/btCollisionWorld.h | 6 +-- .../btConvexConcaveCollisionAlgorithm.cpp | 5 ++- .../btConvexConvexAlgorithm.cpp | 5 +++ .../btEmptyCollisionAlgorithm.cpp | 5 +-- .../btEmptyCollisionAlgorithm.h | 2 + .../btSimulationIslandManager.cpp | 4 +- .../btSphereBoxCollisionAlgorithm.cpp | 7 +++ .../btSphereSphereCollisionAlgorithm.cpp | 7 +++ .../btSphereTriangleCollisionAlgorithm.cpp | 5 +++ .../CollisionShapes/btBvhTriangleMeshShape.h | 1 + .../CollisionShapes/btCapsuleShape.cpp | 8 ++-- .../CollisionShapes/btCapsuleShape.h | 6 +-- .../CollisionShapes/btCollisionShape.h | 7 +-- .../CollisionShapes/btConvexHullShape.cpp | 7 +-- .../CollisionShapes/btConvexShape.h | 8 +++- .../btConvexTriangleMeshShape.cpp | 19 ++++---- .../CollisionShapes/btEmptyShape.cpp | 4 +- .../btHeightfieldTerrainShape.cpp | 11 +++-- .../CollisionShapes/btMinkowskiSumShape.cpp | 3 +- .../CollisionShapes/btOptimizedBvh.cpp | 45 +++++++++++++++++-- .../CollisionShapes/btOptimizedBvh.h | 6 ++- .../CollisionShapes/btSphereShape.cpp | 3 ++ .../CollisionShapes/btStaticPlaneShape.cpp | 5 +++ .../btStridingMeshInterface.cpp | 5 +++ .../CollisionShapes/btTetrahedronShape.cpp | 6 +-- .../btTriangleIndexVertexArray.h | 10 +++-- .../CollisionShapes/btTriangleMesh.cpp | 2 + .../CollisionShapes/btTriangleMesh.h | 8 ++-- .../CollisionShapes/btTriangleMeshShape.cpp | 5 ++- .../CollisionShapes/btTriangleMeshShape.h | 2 +- .../CollisionShapes/btTriangleShape.h | 2 + .../NarrowPhaseCollision/btConvexCast.h | 4 +- .../btDiscreteCollisionDetectorInterface.h | 1 - .../btGjkEpaPenetrationDepthSolver.cpp | 3 ++ .../btGjkPairDetector.cpp | 3 +- .../btMinkowskiPenetrationDepthSolver.cpp | 7 +++ .../NarrowPhaseCollision/btPointCollector.h | 4 ++ .../ConstraintSolver/btContactConstraint.cpp | 15 +++++++ .../btGeneric6DofConstraint.cpp | 15 ++++--- .../btGeneric6DofConstraint.h | 7 +++ .../ConstraintSolver/btHingeConstraint.cpp | 1 + .../ConstraintSolver/btHingeConstraint.h | 6 +-- .../btPoint2PointConstraint.cpp | 1 + .../btSequentialImpulseConstraintSolver.cpp | 27 +++++++---- .../btSolve2LinearConstraint.cpp | 16 ++++++- .../btSolve2LinearConstraint.h | 3 +- .../ConstraintSolver/btSolverConstraint.h | 2 +- .../ConstraintSolver/btTypedConstraint.h | 8 +++- .../Dynamics/btDiscreteDynamicsWorld.cpp | 14 +++++- src/BulletDynamics/Dynamics/btDynamicsWorld.h | 12 ++--- .../Dynamics/btSimpleDynamicsWorld.cpp | 4 ++ .../Vehicle/btRaycastVehicle.cpp | 4 +- src/BulletDynamics/Vehicle/btRaycastVehicle.h | 1 + src/BulletDynamics/Vehicle/btWheelInfo.cpp | 1 + src/LinearMath/btAlignedAllocator.h | 1 + src/LinearMath/btAlignedObjectArray.h | 4 +- src/LinearMath/btDefaultMotionState.h | 7 +-- src/LinearMath/btMatrix3x3.h | 2 +- src/LinearMath/btMotionState.h | 5 +-- 71 files changed, 348 insertions(+), 125 deletions(-) diff --git a/Demos/OpenGL/DemoApplication.cpp b/Demos/OpenGL/DemoApplication.cpp index fb226777e..ed0af3910 100644 --- a/Demos/OpenGL/DemoApplication.cpp +++ b/Demos/OpenGL/DemoApplication.cpp @@ -227,6 +227,9 @@ void DemoApplication::reshape(int w, int h) void DemoApplication::keyboardCallback(unsigned char key, int x, int y) { + (void)x; + (void)y; + m_lastKey = 0; switch (key) @@ -367,6 +370,9 @@ void DemoApplication::keyboardCallback(unsigned char key, int x, int y) void DemoApplication::specialKeyboard(int key, int x, int y) { + (void)x; + (void)y; + switch (key) { case GLUT_KEY_F1: diff --git a/Demos/OpenGL/GL_ShapeDrawer.cpp b/Demos/OpenGL/GL_ShapeDrawer.cpp index cddba522c..cb3254cdb 100644 --- a/Demos/OpenGL/GL_ShapeDrawer.cpp +++ b/Demos/OpenGL/GL_ShapeDrawer.cpp @@ -211,6 +211,10 @@ public: virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex) { + (void)triangleIndex; + (void)partId; + + if (m_wireframe) { glBegin(GL_LINES); @@ -243,6 +247,10 @@ class TriangleGlDrawcallback : public btInternalTriangleIndexCallback public: virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) { + (void)triangleIndex; + (void)partId; + + glBegin(GL_TRIANGLES);//LINES); glColor3f(1, 0, 0); glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ()); @@ -453,7 +461,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons if (debugMode==btIDebugDraw::DBG_DrawFeaturesText) { glRasterPos3f(0.0, 0.0, 0.0); - BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->getExtraDebugInfo()); + //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->getExtraDebugInfo()); glColor3f(1.f, 1.f, 1.f); for (i=0;igetNumVertices();i++) @@ -544,7 +552,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons if (debugMode& btIDebugDraw::DBG_DrawFeaturesText) { - BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo()); + //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo()); } glEnable(GL_DEPTH_BUFFER_BIT); diff --git a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp index c4f0cad78..6a9a8c1b1 100644 --- a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp +++ b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp @@ -23,6 +23,7 @@ btBroadphaseProxy* btAxisSweep3::createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask) { + (void)shapeType; BP_FP_INT_TYPE handleId = addHandle(min,max, userPtr,collisionFilterGroup,collisionFilterMask); Handle* handle = getHandle(handleId); @@ -72,7 +73,7 @@ btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAab // handle 0 is reserved as the null index, and is also used as the sentinel m_firstFreeHandle = 1; { - for (int i = m_firstFreeHandle; i < maxHandles; i++) + for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++) m_pHandles[i].SetNextFree(i + 1); m_pHandles[maxHandles - 1].SetNextFree(0); } @@ -169,10 +170,10 @@ BP_FP_INT_TYPE btAxisSweep3::addHandle(const btPoint3& aabbMin,const btPoint3& a pHandle->m_collisionFilterMask = collisionFilterMask; // compute current limit of edge arrays - int limit = m_numHandles * 2; + BP_FP_INT_TYPE limit = m_numHandles * 2; // insert new edges just inside the max boundary edge - for (int axis = 0; axis < 3; axis++) + for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++) { m_pHandles[0].m_maxEdges[axis] += 2; @@ -229,12 +230,12 @@ void btAxisSweep3::removeHandle(BP_FP_INT_TYPE handle) for ( axis = 0; axis < 3; axis++) { Edge* pEdges = m_pEdges[axis]; - int max = pHandle->m_maxEdges[axis]; + BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis]; pEdges[max].m_pos = BP_HANDLE_SENTINEL; sortMaxUp(axis,max,false); - int i = pHandle->m_minEdges[axis]; + BP_FP_INT_TYPE i = pHandle->m_minEdges[axis]; pEdges[i].m_pos = BP_HANDLE_SENTINEL; sortMinUp(axis,i,false); diff --git a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h index 834e159ba..90cd35438 100644 --- a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h +++ b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h @@ -81,7 +81,7 @@ private: btVector3 m_quantize; // scaling factor for quantization - int m_numHandles; // number of active handles + BP_FP_INT_TYPE m_numHandles; // number of active handles int m_maxHandles; // max number of handles Handle* m_pHandles; // handles pool BP_FP_INT_TYPE m_firstFreeHandle; // free handles list diff --git a/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h index 01f197773..40d9748ff 100644 --- a/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h +++ b/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h @@ -62,7 +62,7 @@ CONCAVE_SHAPES_END_HERE, ///btBroadphaseProxy -ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy +struct btBroadphaseProxy { ///optional filtering to cull potential collisions diff --git a/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h b/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h index 7ce43fe69..55cec386a 100644 --- a/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h +++ b/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h @@ -36,6 +36,7 @@ struct btCollisionAlgorithmConstructionInfo btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp) :m_dispatcher(dispatcher) { + (void)temp; } btDispatcher* m_dispatcher; diff --git a/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp b/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp index 10df75266..30bcbe0c5 100644 --- a/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp +++ b/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp @@ -85,8 +85,8 @@ btBroadphaseProxy* btSimpleBroadphase::createProxy( const btVector3& min, cons btSimpleBroadphaseProxy* proxy1 = &m_proxies[0]; - int index = proxy - proxy1; - assert(index == freeIndex); + int index = int(proxy - proxy1); + btAssert(index == freeIndex); m_pProxies[m_numProxies] = proxy; m_numProxies++; @@ -100,7 +100,8 @@ class RemovingOverlapCallback : public btOverlapCallback protected: virtual bool processOverlap(btBroadphasePair& pair) { - assert(0); + (void)pair; + btAssert(0); return false; } }; @@ -131,8 +132,8 @@ void btSimpleBroadphase::destroyProxy(btBroadphaseProxy* proxyOrg) btSimpleBroadphaseProxy* proxy0 = static_cast(proxyOrg); btSimpleBroadphaseProxy* proxy1 = &m_proxies[0]; - int index = proxy0 - proxy1; - assert (index < m_maxProxies); + int index = int(proxy0 - proxy1); + btAssert (index < m_maxProxies); m_freeProxies[--m_firstFreeProxy] = index; removeOverlappingPairsContainingProxy(proxyOrg); diff --git a/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h b/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h index 281677081..1f265f3dd 100644 --- a/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h +++ b/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h @@ -31,6 +31,7 @@ struct btSimpleBroadphaseProxy : public btBroadphaseProxy :btBroadphaseProxy(userPtr,collisionFilterGroup,collisionFilterMask), m_min(minpt),m_max(maxpt) { + (void)shapeType; } diff --git a/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp index 2102cbf5f..b322c9fd6 100644 --- a/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp +++ b/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp @@ -29,6 +29,7 @@ m_triangle(triangle) void SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) { + (void)debugDraw; const btTransform& transformA = input.m_transformA; const btTransform& transformB = input.m_transformB; @@ -149,11 +150,8 @@ bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &po btScalar distanceSqr = contactToCentre.length2(); if (distanceSqr < (r - MAX_OVERLAP)*(r - MAX_OVERLAP)) { btScalar distance = btSqrt(distanceSqr); - if (1) - { - resultNormal = contactToCentre; - resultNormal.normalize(); - } + resultNormal = contactToCentre; + resultNormal.normalize(); point = contactPoint; depth = -(r-distance); return true; diff --git a/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h b/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h index 07e6eaf55..31706f193 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h @@ -34,8 +34,11 @@ struct btCollisionAlgorithmCreateFunc } virtual ~btCollisionAlgorithmCreateFunc(){}; - virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) + virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , btCollisionObject* body0,btCollisionObject* body1) { + + (void)body0; + (void)body1; return 0; } }; diff --git a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp index c4824d7c5..198276d76 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp @@ -42,6 +42,7 @@ m_compoundCreateFunc(0), m_swappedCompoundCreateFunc(0), m_emptyCreateFunc(0) { + (void)noDefaultAlgorithms; int i; setNearCallback(defaultNearCallback); @@ -294,6 +295,16 @@ public: { } + btCollisionPairCallback& operator=(btCollisionPairCallback& other) + { + m_dispatchInfo = other.m_dispatchInfo; + m_dispatcher = other.m_dispatcher; + return *this; + } + + virtual ~btCollisionPairCallback() {} + + virtual bool processOverlap(btBroadphasePair& pair) { (*m_dispatcher->getNearCallback())(pair,*m_dispatcher,m_dispatchInfo); diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/src/BulletCollision/CollisionDispatch/btCollisionObject.h index 573af5d4f..93990235a 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -40,8 +40,6 @@ ATTRIBUTE_ALIGNED16(class) btCollisionObject protected: btTransform m_worldTransform; - btBroadphaseProxy* m_broadphaseHandle; - btCollisionShape* m_collisionShape; ///m_interpolationWorldTransform is used for CCD and interpolation ///it can be either previous or future (predicted) transform @@ -50,6 +48,8 @@ protected: //without destroying the continuous interpolated motion (which uses this interpolation velocities) btVector3 m_interpolationLinearVelocity; btVector3 m_interpolationAngularVelocity; + btBroadphaseProxy* m_broadphaseHandle; + btCollisionShape* m_collisionShape; int m_collisionFlags; @@ -76,6 +76,8 @@ protected: /// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionThreshold btScalar m_ccdSquareMotionThreshold; + + char m_pad[8]; public: diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/src/BulletCollision/CollisionDispatch/btCollisionWorld.h index de089ef56..0b0286c50 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.h @@ -142,10 +142,10 @@ public: { } - btCollisionObject* m_collisionObject; + btCollisionObject* m_collisionObject; LocalShapeInfo* m_localShapeInfo; - const btVector3& m_hitNormalLocal; - btScalar m_hitFraction; + btVector3 m_hitNormalLocal; + btScalar m_hitFraction; }; diff --git a/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp index 62e8fcba1..24ceacfd4 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp @@ -198,7 +198,8 @@ void btConvexConcaveCollisionAlgorithm::processCollision (btCollisionObject* bod btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { - + (void)resultOut; + (void)dispatchInfo; btCollisionObject* convexbody = m_isSwapped ? body1 : body0; btCollisionObject* triBody = m_isSwapped ? body0 : body1; @@ -242,6 +243,8 @@ btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObj virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) { + (void)partId; + (void)triangleIndex; //do a swept sphere for now btTransform ident; ident.setIdentity(); diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index 04e5b8011..9105fe20b 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -77,6 +77,9 @@ m_ownManifold (false), m_manifoldPtr(mf), m_lowLevelOfDetail(false) { + (void)body0; + (void)body1; + } @@ -156,6 +159,8 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl bool disableCcd = false; btScalar btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { + (void)resultOut; + (void)dispatchInfo; ///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold ///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold diff --git a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp index 7849e5c84..936054387 100644 --- a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp @@ -22,12 +22,11 @@ btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& c { } -void btEmptyAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +void btEmptyAlgorithm::processCollision (btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* ) { - } -btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) +btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* ) { return btScalar(1.); } diff --git a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h index 8ffe68472..b1a193d2c 100644 --- a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h +++ b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h @@ -37,6 +37,8 @@ public: { virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1) { + (void)body0; + (void)body1; return new btEmptyAlgorithm(ci); } }; diff --git a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp index cfb3c445e..479080278 100644 --- a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp +++ b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -140,7 +140,7 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher, - if (0) + /*if (0) { int maxNumManifolds = dispatcher->getNumManifolds(); btCollisionDispatcher* colDis = (btCollisionDispatcher*)dispatcher; @@ -148,6 +148,8 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher, callback->ProcessIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, 0); return; } + */ + BEGIN_PROFILE("islandUnionFindAndHeapSort"); diff --git a/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp index 364373bf3..5c67165ed 100644 --- a/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp @@ -50,6 +50,8 @@ btSphereBoxCollisionAlgorithm::~btSphereBoxCollisionAlgorithm() void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { + (void)dispatchInfo; + (void)resultOut; if (!m_manifoldPtr) return; @@ -83,6 +85,11 @@ void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,b btScalar btSphereBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { + (void)resultOut; + (void)dispatchInfo; + (void)col0; + (void)col1; + //not yet return btScalar(1.); } diff --git a/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp index 0f911a6ef..087c1753e 100644 --- a/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp @@ -41,6 +41,8 @@ btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm() void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { + (void)dispatchInfo; + if (!m_manifoldPtr) return; @@ -73,6 +75,11 @@ void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0 btScalar btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { + (void)col0; + (void)col1; + (void)dispatchInfo; + (void)resultOut; + //not yet return btScalar(1.); } diff --git a/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp index 1439c1614..9f7b32145 100644 --- a/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp @@ -66,6 +66,11 @@ void btSphereTriangleCollisionAlgorithm::processCollision (btCollisionObject* co btScalar btSphereTriangleCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { + (void)resultOut; + (void)dispatchInfo; + (void)col0; + (void)col1; + //not yet return btScalar(1.); } diff --git a/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h b/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h index f6195c808..4914d9f95 100644 --- a/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h +++ b/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h @@ -26,6 +26,7 @@ ATTRIBUTE_ALIGNED16(class) btBvhTriangleMeshShape : public btTriangleMeshShape btOptimizedBvh* m_bvh; bool m_useQuantizedAabbCompression; + bool m_pad[12];////need padding due to alignment public: diff --git a/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp b/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp index b390b8f0a..cdf168b8b 100644 --- a/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp +++ b/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp @@ -19,7 +19,7 @@ subject to the following restrictions: #include "BulletCollision/CollisionShapes/btCollisionMargin.h" #include "LinearMath/btQuaternion.h" -btCapsuleShape::btCapsuleShape(float radius, float height) +btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) { m_implicitShapeDimensions.setValue(radius,0.5f*height,radius); } @@ -46,7 +46,7 @@ btCapsuleShape::btCapsuleShape(float radius, float height) btVector3 vtx; btScalar newDot; - float radius = getRadius(); + btScalar radius = getRadius(); { @@ -78,7 +78,7 @@ btCapsuleShape::btCapsuleShape(float radius, float height) { - float radius = getRadius(); + btScalar radius = getRadius(); for (int j=0;j IndexedMeshArray; ATTRIBUTE_ALIGNED16( class) btTriangleIndexVertexArray : public btStridingMeshInterface { IndexedMeshArray m_indexedMeshes; + int m_pad[3]; public: @@ -66,9 +68,9 @@ public: /// unLockVertexBase finishes the access to a subpart of the triangle mesh /// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished - virtual void unLockVertexBase(int subpart) {} + virtual void unLockVertexBase(int subpart) {(void)subpart;} - virtual void unLockReadOnlyVertexBase(int subpart) const {} + virtual void unLockReadOnlyVertexBase(int subpart) const {(void)subpart;} /// getNumSubParts returns the number of seperate subparts /// each subpart has a continuous array of vertices and indices @@ -86,8 +88,8 @@ public: return m_indexedMeshes; } - virtual void preallocateVertices(int numverts){} - virtual void preallocateIndices(int numindices){} + virtual void preallocateVertices(int numverts){(void) numverts;} + virtual void preallocateIndices(int numindices){(void) numindices;} } ; diff --git a/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp b/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp index 200863151..98c54ef45 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp +++ b/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp @@ -24,6 +24,7 @@ btTriangleMesh::btTriangleMesh () void btTriangleMesh::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) { + (void)subpart; numverts = m_vertices.size(); *vertexbase = (unsigned char*)&m_vertices[0]; type = PHY_FLOAT; @@ -38,6 +39,7 @@ void btTriangleMesh::getLockedVertexIndexBase(unsigned char **vertexbase, int& n void btTriangleMesh::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const { + (void)subpart; numverts = m_vertices.size(); *vertexbase = (unsigned char*)&m_vertices[0]; type = PHY_FLOAT; diff --git a/src/BulletCollision/CollisionShapes/btTriangleMesh.h b/src/BulletCollision/CollisionShapes/btTriangleMesh.h index 50bb1fb4f..525f5336b 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMesh.h +++ b/src/BulletCollision/CollisionShapes/btTriangleMesh.h @@ -57,16 +57,16 @@ class btTriangleMesh : public btStridingMeshInterface /// unLockVertexBase finishes the access to a subpart of the triangle mesh /// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished - virtual void unLockVertexBase(int subpart) {} + virtual void unLockVertexBase(int subpart) {(void) subpart;} - virtual void unLockReadOnlyVertexBase(int subpart) const {} + virtual void unLockReadOnlyVertexBase(int subpart) const { (void) subpart;} /// getNumSubParts returns the number of seperate subparts /// each subpart has a continuous array of vertices and indices virtual int getNumSubParts() const; - virtual void preallocateVertices(int numverts){} - virtual void preallocateIndices(int numindices){} + virtual void preallocateVertices(int numverts){(void) numverts;} + virtual void preallocateIndices(int numindices){(void) numindices;} }; diff --git a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp index 39e798a7b..c9fc51870 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp +++ b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp @@ -93,6 +93,8 @@ public: virtual void processTriangle( btVector3* triangle,int partId, int triangleIndex) { + (void)partId; + (void)triangleIndex; for (int i=0;i<3;i++) { btScalar dot = m_supportVecLocal.dot(triangle[i]); @@ -176,8 +178,9 @@ void btTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const void btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { + (void)mass; //moving concave objects not supported - assert(0); + btAssert(0); inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); } diff --git a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h index 31753ebc9..e6173e476 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h +++ b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h @@ -24,9 +24,9 @@ subject to the following restrictions: class btTriangleMeshShape : public btConcaveShape { protected: - btStridingMeshInterface* m_meshInterface; btVector3 m_localAabbMin; btVector3 m_localAabbMax; + btStridingMeshInterface* m_meshInterface; public: diff --git a/src/BulletCollision/CollisionShapes/btTriangleShape.h b/src/BulletCollision/CollisionShapes/btTriangleShape.h index 14a7c93ab..c2e240c05 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleShape.h +++ b/src/BulletCollision/CollisionShapes/btTriangleShape.h @@ -111,12 +111,14 @@ public: virtual void getPlaneEquation(int i, btVector3& planeNormal,btPoint3& planeSupport) const { + (void)i; calcNormal(planeNormal); planeSupport = m_vertices1[0]; } virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) { + (void)mass; btAssert(0); inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); } diff --git a/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h b/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h index b323008f4..3101b5999 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h +++ b/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h @@ -37,8 +37,8 @@ public: { //virtual bool addRayResult(const btVector3& normal,btScalar fraction) = 0; - virtual void DebugDraw(btScalar fraction) {} - virtual void drawCoordSystem(const btTransform& trans) {} + virtual void DebugDraw(btScalar fraction) {(void)fraction;} + virtual void drawCoordSystem(const btTransform& trans) {(void)trans;} CastResult() :m_fraction(btScalar(1e30)), diff --git a/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h b/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h index 4022b0125..15000c1ab 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h +++ b/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h @@ -30,7 +30,6 @@ struct btDiscreteCollisionDetectorInterface struct Result { - void operator delete(void* ptr) {}; virtual ~Result(){} diff --git a/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp b/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp index f9a4b5410..3fc8c3dcc 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp @@ -26,6 +26,9 @@ bool btGjkEpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& sim class btIDebugDraw* debugDraw, btStackAlloc* stackAlloc ) { + (void)debugDraw; + (void)v; + (void)simplexSolver; const btScalar radialmargin(btScalar(0.)); diff --git a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp index c6e7dadc1..f1f3f7f7f 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp @@ -91,7 +91,8 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result& m_simplexSolver->reset(); - while (true) + for ( ; ; ) + //while (true) { btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis(); diff --git a/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp b/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp index 3750afde0..c4bab3a13 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp @@ -78,6 +78,9 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s ) { + (void)stackAlloc; + (void)v; + struct btIntermediateResult : public btDiscreteCollisionDetectorInterface::Result { @@ -93,6 +96,10 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) { + (void)partId0; + (void)index0; + (void)partId1; + (void)index1; } void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) { diff --git a/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h b/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h index e14bc450a..6262f44b9 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h +++ b/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h @@ -37,6 +37,10 @@ struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) { + (void)partId0; + (void)index0; + (void)partId1; + (void)index1; //?? } diff --git a/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp index ee6922191..bb3fe8325 100644 --- a/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp @@ -32,6 +32,10 @@ void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1, btRigidBody& body2, const btVector3& pos2, btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep) { + (void)timeStep; + (void)distance; + + btScalar normalLenSqr = normal.length2(); ASSERT2(btFabs(normalLenSqr) < btScalar(1.1)); if (normalLenSqr > btScalar(1.1)) @@ -153,6 +157,8 @@ btScalar resolveSingleFriction( const btContactSolverInfo& solverInfo) { + (void)solverInfo; + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); const btVector3& pos2 = contactPoint.getPositionWorldOnB(); @@ -234,6 +240,8 @@ btScalar resolveSingleFrictionOriginal( const btContactSolverInfo& solverInfo) { + (void)solverInfo; + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); const btVector3& pos2 = contactPoint.getPositionWorldOnB(); @@ -391,12 +399,19 @@ btScalar resolveSingleCollisionCombined( return normalImpulse; } + btScalar resolveSingleFrictionEmpty( btRigidBody& body1, btRigidBody& body2, btManifoldPoint& contactPoint, const btContactSolverInfo& solverInfo) { + (void)contactPoint; + (void)body1; + (void)body2; + (void)solverInfo; + + return btScalar(0.); }; diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp index dbec99f22..e31db8e64 100644 --- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp @@ -168,9 +168,10 @@ bool MatrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz) xyz[0] = btAtan2(getMatrixElem(mat,3),getMatrixElem(mat,4)); xyz[1] = SIMD_HALF_PI; xyz[2] = 0.0; - return false; + } - return false; + + return false; } @@ -329,12 +330,13 @@ void btGeneric6DofConstraint::solveConstraint(btScalar timeStep) void btGeneric6DofConstraint::updateRHS(btScalar timeStep) { + (void)timeStep; } btScalar btGeneric6DofConstraint::computeAngle(int axis) const { - btScalar angle; + btScalar angle = btScalar(0.f); switch (axis) { @@ -376,9 +378,12 @@ btScalar btGeneric6DofConstraint::computeAngle(int axis) const angle = btAtan2( s, c ); } break; - default: assert ( 0 ) ; break ; + default: + btAssert ( 0 ) ; + + break ; } - return angle; + return angle; } diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h index ff0d314c8..b114e54fa 100644 --- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h @@ -40,12 +40,19 @@ class btGeneric6DofConstraint : public btTypedConstraint btScalar m_accumulatedImpulse[6]; + btGeneric6DofConstraint& operator=(btGeneric6DofConstraint& other) + { + btAssert(0); + (void) other; + return *this; + } public: btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ); btGeneric6DofConstraint(); + virtual void buildJacobian(); virtual void solveConstraint(btScalar timeStep); diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp index 00170d7e9..27e309875 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -223,6 +223,7 @@ void btHingeConstraint::solveConstraint(btScalar timeStep) void btHingeConstraint::updateRHS(btScalar timeStep) { + (void)timeStep; } diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h index 572ab0d31..5c1ceafbc 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h @@ -37,8 +37,8 @@ class btHingeConstraint : public btTypedConstraint bool m_angularOnly; - float m_motorTargetVelocity; - float m_maxMotorImpulse; + btScalar m_motorTargetVelocity; + btScalar m_maxMotorImpulse; bool m_enableAngularMotor; public: @@ -69,7 +69,7 @@ public: m_angularOnly = angularOnly; } - void enableAngularMotor(bool enableMotor,float targetVelocity,float maxMotorImpulse) + void enableAngularMotor(bool enableMotor,btScalar targetVelocity,btScalar maxMotorImpulse) { m_enableAngularMotor = enableMotor; m_motorTargetVelocity = targetVelocity; diff --git a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp index bb9b2b993..aacb0a3ea 100644 --- a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp @@ -110,6 +110,7 @@ void btPoint2PointConstraint::solveConstraint(btScalar timeStep) void btPoint2PointConstraint::updateRHS(btScalar timeStep) { + (void)timeStep; } diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index 749efa0d7..405a9aeb8 100644 --- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -42,8 +42,8 @@ int gTotalContactPoints = 0; struct btOrderIndex { - short int m_manifoldIndex; - short int m_pointIndex; + int m_manifoldIndex; + int m_pointIndex; }; @@ -124,11 +124,12 @@ m_btSeed2(0) void initSolverBody(btSolverBody* solverBody, btRigidBody* rigidbody) { - int size = sizeof(btSolverBody); +/* int size = sizeof(btSolverBody); int sizeofrb = sizeof(btRigidBody); int sizemanifold = sizeof(btPersistentManifold); int sizeofmp = sizeof(btManifoldPoint); int sizeofPersistData = sizeof (btConstraintPersistentData); +*/ solverBody->m_angularVelocity = rigidbody->getAngularVelocity(); solverBody->m_centerOfMassPosition = rigidbody->getCenterOfMassPosition(); @@ -159,6 +160,8 @@ SIMD_FORCE_INLINE btScalar resolveSingleCollisionCombinedCacheFriendly( btSolverConstraint& contactConstraint, const btContactSolverInfo& solverInfo) { + (void)solverInfo; + btScalar normalImpulse(0.f); { if (contactConstraint.m_penetration < 0.f) @@ -225,6 +228,7 @@ SIMD_FORCE_INLINE btScalar resolveSingleFrictionCacheFriendly( const btContactSolverInfo& solverInfo, btScalar appliedNormalImpulse) { + (void)solverInfo; const btScalar combinedFriction = contactConstraint.m_friction; @@ -335,6 +339,8 @@ btAlignedObjectArray tmpSolverFrictionConstraintPool; btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendly(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc) { + (void)stackAlloc; + (void)debugDrawer; if (!(numConstraints + numManifolds)) { @@ -364,7 +370,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendly(btCollisio //int sizeofSC = sizeof(btSolverConstraint); - if (1) + //if (1) { //if m_stackAlloc, try to pack bodies/constraints to speed up solving // btBlock* sablock; @@ -407,8 +413,8 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendly(btCollisio btRigidBody* rb1 = (btRigidBody*)manifold->getBody1(); - int solverBodyIdA; - int solverBodyIdB; + int solverBodyIdA=-1; + int solverBodyIdB=-1; if (manifold->getNumContacts()) { @@ -766,13 +772,13 @@ btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bod { - int j; + short j; for (j=0;jgetNumContacts();p++) + for (short p=0;pgetNumContacts();p++) { gOrder[totalPoints].m_manifoldIndex = j; gOrder[totalPoints].m_pointIndex = p; @@ -859,6 +865,8 @@ btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bod void btSequentialImpulseConstraintSolver::prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer) { + (void)debugDrawer; + btRigidBody* body0 = (btRigidBody*)manifoldPtr->getBody0(); btRigidBody* body1 = (btRigidBody*)manifoldPtr->getBody1(); @@ -1117,6 +1125,9 @@ btScalar btSequentialImpulseConstraintSolver::solve(btRigidBody* body0,btRigidBo btScalar btSequentialImpulseConstraintSolver::solveFriction(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) { + (void)debugDrawer; + (void)iter; + { diff --git a/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp index cb60262ec..0c7dbd668 100644 --- a/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp @@ -43,6 +43,12 @@ void btSolve2LinearConstraint::resolveUnilateralPairConstraint( btScalar depthB, const btVector3& normalB, btScalar& imp0,btScalar& imp1) { + (void)linvelA; + (void)linvelB; + (void)angvelB; + (void)angvelA; + + imp0 = btScalar(0.); imp1 = btScalar(0.); @@ -126,6 +132,13 @@ void btSolve2LinearConstraint::resolveBilateralPairConstraint( btScalar& imp0,btScalar& imp1) { + (void)linvelA; + (void)linvelB; + (void)angvelA; + (void)angvelB; + + + imp0 = btScalar(0.); imp1 = btScalar(0.); @@ -221,7 +234,7 @@ void btSolve2LinearConstraint::resolveBilateralPairConstraint( } - +/* void btSolve2LinearConstraint::resolveAngularConstraint( const btMatrix3x3& invInertiaAWS, const btScalar invMassA, const btVector3& linvelA,const btVector3& angvelA, @@ -238,4 +251,5 @@ void btSolve2LinearConstraint::resolveAngularConstraint( const btMatrix3x3& invI { } +*/ diff --git a/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h b/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h index 99d9ee026..e7d26645c 100644 --- a/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h @@ -85,7 +85,7 @@ public: btScalar depthB, const btVector3& normalB, btScalar& imp0,btScalar& imp1); - +/* void resolveAngularConstraint( const btMatrix3x3& invInertiaAWS, const btScalar invMassA, const btVector3& linvelA,const btVector3& angvelA, @@ -100,6 +100,7 @@ public: btScalar depthB, const btVector3& normalB, btScalar& imp0,btScalar& imp1); +*/ }; diff --git a/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h b/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h index 2229148c2..19af30e32 100644 --- a/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h @@ -44,7 +44,7 @@ ATTRIBUTE_ALIGNED16 (struct) btSolverConstraint int m_constraintType; int m_frictionIndex; -// int m_unusedPadding[2]; + int m_unusedPadding[2]; enum btSolverConstraintType { diff --git a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h index 084eb1059..dfee6e80d 100644 --- a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h @@ -24,7 +24,13 @@ class btTypedConstraint { int m_userConstraintType; int m_userConstraintId; - + + btTypedConstraint& operator=(btTypedConstraint& other) + { + btAssert(0); + (void) other; + return *this; + } protected: btRigidBody& m_rbA; diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 3efc5129f..102b1f00e 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -318,8 +318,8 @@ void btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body) if (body->getCollisionShape()) { bool isDynamic = !(body->isStaticObject() || body->isKinematicObject()); - short collisionFilterGroup = isDynamic? btBroadphaseProxy::DefaultFilter : btBroadphaseProxy::StaticFilter; - short collisionFilterMask = isDynamic? btBroadphaseProxy::AllFilter : btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter; + short collisionFilterGroup = isDynamic? short(btBroadphaseProxy::DefaultFilter) : short(btBroadphaseProxy::StaticFilter); + short collisionFilterMask = isDynamic? short(btBroadphaseProxy::AllFilter) : short(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter); addCollisionObject(body,collisionFilterGroup,collisionFilterMask); } @@ -449,6 +449,12 @@ void btDiscreteDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo) } + InplaceSolverIslandCallback& operator=(InplaceSolverIslandCallback& other) + { + btAssert(0); + (void)other; + return *this; + } virtual void ProcessIsland(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifolds,int numManifolds, int islandId) { //also add all non-contact constraints/joints for this island @@ -646,6 +652,7 @@ void btDiscreteDynamicsWorld::predictUnconstraintMotion(btScalar timeStep) void btDiscreteDynamicsWorld::startProfiling(btScalar timeStep) { + (void)timeStep; #ifdef USE_QUICKPROF @@ -706,6 +713,9 @@ public: virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex) { + (void)partId; + (void)triangleIndex; + btVector3 wv0,wv1,wv2; wv0 = m_worldTrans*triangle[0]; wv1 = m_worldTrans*triangle[1]; diff --git a/src/BulletDynamics/Dynamics/btDynamicsWorld.h b/src/BulletDynamics/Dynamics/btDynamicsWorld.h index 39e67adb1..1d057cdcd 100644 --- a/src/BulletDynamics/Dynamics/btDynamicsWorld.h +++ b/src/BulletDynamics/Dynamics/btDynamicsWorld.h @@ -43,13 +43,13 @@ class btDynamicsWorld : public btCollisionWorld virtual void updateAabbs() = 0; - virtual void addConstraint(btTypedConstraint* constraint) {}; + virtual void addConstraint(btTypedConstraint* constraint) { (void)constraint;}; - virtual void removeConstraint(btTypedConstraint* constraint) {}; + virtual void removeConstraint(btTypedConstraint* constraint) {(void)constraint;}; - virtual void addVehicle(btRaycastVehicle* vehicle) {}; + virtual void addVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}; - virtual void removeVehicle(btRaycastVehicle* vehicle) {}; + virtual void removeVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}; virtual void setDebugDrawer(btIDebugDraw* debugDrawer) = 0; @@ -68,9 +68,9 @@ class btDynamicsWorld : public btCollisionWorld virtual int getNumConstraints() const { return 0; } - virtual btTypedConstraint* getConstraint(int index) { return 0; } + virtual btTypedConstraint* getConstraint(int index) { (void)index; return 0; } - virtual const btTypedConstraint* getConstraint(int index) const { return 0; } + virtual const btTypedConstraint* getConstraint(int index) const { (void)index; return 0; } }; diff --git a/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp index fdec1cd02..24e24d3f9 100644 --- a/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp @@ -51,6 +51,10 @@ btSimpleDynamicsWorld::~btSimpleDynamicsWorld() int btSimpleDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep) { + (void)fixedTimeStep; + (void)maxSubSteps; + + ///apply gravity, predict motion predictUnconstraintMotion(timeStep); diff --git a/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp b/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp index aea08479b..29bc2e9b0 100644 --- a/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp +++ b/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp @@ -40,6 +40,7 @@ m_pitchControl(btScalar(0.)) void btRaycastVehicle::defaultInit(const btVehicleTuning& tuning) { + (void)tuning; m_currentVehicleSpeedKmHour = btScalar(0.); m_steeringValue = btScalar(0.); @@ -397,12 +398,13 @@ btWheelInfo& btRaycastVehicle::getWheelInfo(int index) void btRaycastVehicle::setBrake(btScalar brake,int wheelIndex) { btAssert((wheelIndex >= 0) && (wheelIndex < getNumWheels())); - getWheelInfo(wheelIndex).m_brake; + getWheelInfo(wheelIndex).m_brake = brake; } void btRaycastVehicle::updateSuspension(btScalar deltaTime) { + (void)deltaTime; btScalar chassisMass = btScalar(1.) / m_chassisBody->getInvMass(); diff --git a/src/BulletDynamics/Vehicle/btRaycastVehicle.h b/src/BulletDynamics/Vehicle/btRaycastVehicle.h index 19f349967..2597273c0 100644 --- a/src/BulletDynamics/Vehicle/btRaycastVehicle.h +++ b/src/BulletDynamics/Vehicle/btRaycastVehicle.h @@ -156,6 +156,7 @@ public: virtual void solveConstraint(btScalar timeStep) { + (void)timeStep; //not yet } diff --git a/src/BulletDynamics/Vehicle/btWheelInfo.cpp b/src/BulletDynamics/Vehicle/btWheelInfo.cpp index 91b4e8665..e51c0a5f1 100644 --- a/src/BulletDynamics/Vehicle/btWheelInfo.cpp +++ b/src/BulletDynamics/Vehicle/btWheelInfo.cpp @@ -21,6 +21,7 @@ btScalar btWheelInfo::getSuspensionRestLength() const void btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo) { + (void)raycastInfo; if (m_raycastInfo.m_isInContact) diff --git a/src/LinearMath/btAlignedAllocator.h b/src/LinearMath/btAlignedAllocator.h index 4fababd96..ea1acf8ab 100644 --- a/src/LinearMath/btAlignedAllocator.h +++ b/src/LinearMath/btAlignedAllocator.h @@ -55,6 +55,7 @@ public: pointer address ( reference ref ) const { return &ref; } const_pointer address ( const_reference ref ) const { return &ref; } pointer allocate ( size_type n , const_pointer * hint = 0 ) { + (void)hint; return reinterpret_cast< pointer >(btAlignedAlloc( sizeof(value_type) * n , Alignment )); } void construct ( pointer ptr , const value_type & value ) { new (ptr) value_type( value ); } diff --git a/src/LinearMath/btAlignedObjectArray.h b/src/LinearMath/btAlignedObjectArray.h index 5caada814..5d8112a88 100644 --- a/src/LinearMath/btAlignedObjectArray.h +++ b/src/LinearMath/btAlignedObjectArray.h @@ -26,12 +26,12 @@ template //template class btAlignedObjectArray { + btAlignedAllocator m_allocator; + int m_size; int m_capacity; T* m_data; - btAlignedAllocator m_allocator; - protected: SIMD_FORCE_INLINE int allocSize(int size) { diff --git a/src/LinearMath/btDefaultMotionState.h b/src/LinearMath/btDefaultMotionState.h index b2a6d1d02..bff31166e 100644 --- a/src/LinearMath/btDefaultMotionState.h +++ b/src/LinearMath/btDefaultMotionState.h @@ -31,12 +31,7 @@ struct btDefaultMotionState : public btMotionState m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ; } - ///Bullet gives a callback for objects that are about to be deactivated (put asleep) - /// You can intercept this callback for your own bookkeeping. - ///Also you can return false to disable deactivation for this object this frame. - virtual bool deactivationCallback(void* userPointer) { - return true; - } + }; diff --git a/src/LinearMath/btMatrix3x3.h b/src/LinearMath/btMatrix3x3.h index d59191207..e9d6e6795 100644 --- a/src/LinearMath/btMatrix3x3.h +++ b/src/LinearMath/btMatrix3x3.h @@ -176,7 +176,7 @@ class btMatrix3x3 { void getRotation(btQuaternion& q) const { btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z(); - float temp[4]; + btScalar temp[4]; if (trace > btScalar(0.0)) { diff --git a/src/LinearMath/btMotionState.h b/src/LinearMath/btMotionState.h index 7c20e232e..e788b3d89 100644 --- a/src/LinearMath/btMotionState.h +++ b/src/LinearMath/btMotionState.h @@ -34,10 +34,7 @@ class btMotionState //Bullet only calls the update of worldtransform for active objects virtual void setWorldTransform(const btTransform& worldTrans)=0; - //future: when Bullet makes attempt to deactivate object, you can intercept this callback (return false to disable deactivation for this object this frame) - virtual bool deactivationCallback(void* userPointer) { - return true; - } + }; #endif //BT_MOTIONSTATE_H