diff --git a/Demos/Benchmarks/BenchmarkDemo.cpp b/Demos/Benchmarks/BenchmarkDemo.cpp index c42700d64..9e575f58f 100644 --- a/Demos/Benchmarks/BenchmarkDemo.cpp +++ b/Demos/Benchmarks/BenchmarkDemo.cpp @@ -65,7 +65,7 @@ public: { ms = 0; max_ms = 0; - min_ms = 9999.0; + min_ms = 9999; sum_ms_samples = 0; sum_ms = 0; } @@ -77,7 +77,7 @@ public: frame_counter = 0; ms = 0; max_ms = 0; - min_ms = 9999.0; + min_ms = 9999; sum_ms_samples = 0; sum_ms = 0; dx = 10.0; @@ -105,8 +105,8 @@ public: void move (btScalar dt) { - if (dt > (1.0/60.0)) - dt = 1.0/60.0; + if (dt > btScalar(1.0/60.0)) + dt = btScalar(1.0/60.0); for (int i = 0; i < NUMRAYS; i++) { source[i][0] += dx * dt * sign; @@ -315,7 +315,7 @@ void BenchmarkDemo::initPhysics() m_dynamicsWorld = dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration); //dynamicsWorld->getSimulationIslandManager()->setSplitIslands(false); dynamicsWorld->getDispatchInfo().m_useConvexConservativeDistanceUtil = true; - dynamicsWorld->getDispatchInfo().m_convexConservativeDistanceThreshold = 0.01; + dynamicsWorld->getDispatchInfo().m_convexConservativeDistanceThreshold = btScalar(0.01); m_dynamicsWorld->setGravity(btVector3(0,-10,0)); @@ -553,7 +553,7 @@ void BenchmarkDemo::createTowerCircle(const btVector3& offsetPosition,int stackS trans.setRotation(rotY); localCreateRigidBody(mass,trans,blockShape); - rotY *= btQuaternion(btVector3(0,1,0),SIMD_PI/(rotSize*0.5)); + rotY *= btQuaternion(btVector3(0,1,0),SIMD_PI/(rotSize*btScalar(0.5))); } posY += boxSize[1] * 2.0f; @@ -581,15 +581,15 @@ void BenchmarkDemo::createTest2() // Enrico: Shouldn't these three variables be real constants and not defines? #ifndef M_PI -#define M_PI 3.14159265358979323846 +#define M_PI btScalar(3.14159265358979323846) #endif #ifndef M_PI_2 -#define M_PI_2 1.57079632679489661923 +#define M_PI_2 btScalar(1.57079632679489661923) #endif #ifndef M_PI_4 -#define M_PI_4 0.785398163397448309616 +#define M_PI_4 btScalar(0.785398163397448309616) #endif class RagDoll @@ -731,9 +731,9 @@ public: // Setup some damping on the m_bodies for (int i = 0; i < BODYPART_COUNT; ++i) { - m_bodies[i]->setDamping(0.05, 0.85); - m_bodies[i]->setDeactivationTime(0.8); - m_bodies[i]->setSleepingThresholds(1.6, 2.5); + m_bodies[i]->setDamping(btScalar(0.05), btScalar(0.85)); + m_bodies[i]->setDeactivationTime(btScalar(0.8)); + m_bodies[i]->setSleepingThresholds(btScalar(1.6), btScalar(2.5)); } // Now setup the constraints @@ -901,7 +901,7 @@ void BenchmarkDemo::createTest4() for (int i=0;iaddPoint(vtx*(1./scaling)); + convexHullShape->addPoint(vtx*btScalar(1./scaling)); } btTransform trans; @@ -1022,7 +1022,7 @@ void BenchmarkDemo::createLargeMeshBody() trans.setOrigin(btVector3(0,-25,0)); btRigidBody* body = localCreateRigidBody(0,trans,trimeshShape); - body->setFriction (0.9); + body->setFriction (btScalar(0.9)); } diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index b2e48ebe0..152506e58 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -365,9 +365,10 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl btVector3 v0,v1; btVector3 sepNormalWorldSpace; - btScalar sepDist = 0.f; + #ifdef USE_SEPDISTANCE_UTIL2 + btScalar sepDist = 0.f; if (dispatchInfo.m_useConvexConservativeDistanceUtil) { sepDist = gjkPairDetector.getCachedSeparatingDistance(); diff --git a/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp index a7b3b163d..dda85dc69 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp @@ -102,9 +102,9 @@ void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0 btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape(); btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape(); - bool hasCollision = false; + const btVector3& planeNormal = planeShape->getPlaneNormal(); - const btScalar& planeConstant = planeShape->getPlaneConstant(); + //const btScalar& planeConstant = planeShape->getPlaneConstant(); //first perform a collision query with the non-perturbated collision objects { diff --git a/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp index baebfb092..f130d30fa 100644 --- a/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp +++ b/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp @@ -23,7 +23,7 @@ btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScala :btConvexInternalAabbCachingShape () { m_shapeType = MULTI_SPHERE_SHAPE_PROXYTYPE; - btScalar startMargin = btScalar(BT_LARGE_FLOAT); + //btScalar startMargin = btScalar(BT_LARGE_FLOAT); m_localPositionArray.resize(numSpheres); m_radiArray.resize(numSpheres); diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index b9376507f..e97300c52 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -870,7 +870,7 @@ void btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep) gNumClampedCcdMotions++; btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher()); - btConvexShape* convexShape = static_cast(body->getCollisionShape()); + //btConvexShape* convexShape = static_cast(body->getCollisionShape()); btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast(body->getCollisionShape()); sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup; diff --git a/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp b/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp index 44922a499..dab42cc71 100644 --- a/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp +++ b/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp @@ -97,7 +97,7 @@ void SpuCollisionTaskProcess::initialize2(bool useEpa) printf("SpuCollisionTaskProcess::initialize()\n"); #endif //DEBUG_SPU_TASK_SCHEDULING - for (int i = 0; i < m_maxNumOutstandingTasks; i++) + for (int i = 0; i < int (m_maxNumOutstandingTasks); i++) { m_taskBusy[i] = false; } @@ -153,7 +153,7 @@ void SpuCollisionTaskProcess::issueTask2() unsigned int outputSize; - for (int i=0;i=0); - btAssert(taskId deltas; btAlignedObjectArray weights; deltas.resize(m_nodes.size(),btVector3(0,0,0)); @@ -2780,7 +2780,7 @@ void btSoftBody::PSolve_Links(btSoftBody* psb,btScalar kst,btScalar ti) const btVector3 del=b.m_x-a.m_x; const btScalar len=del.length2(); const btScalar k=((l.m_c1-len)/(l.m_c0*(l.m_c1+len)))*kst; - const btScalar t=k*a.m_im; + //const btScalar t=k*a.m_im; a.m_x-=del*(k*a.m_im); b.m_x+=del*(k*b.m_im); } diff --git a/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp b/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp index 9b85acfac..02e8186be 100644 --- a/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp +++ b/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp @@ -218,7 +218,7 @@ void btSoftBodyConcaveCollisionAlgorithm::processCollision (btCollisionObject* b { - btCollisionObject* convexBody = m_isSwapped ? body1 : body0; + //btCollisionObject* convexBody = m_isSwapped ? body1 : body0; btCollisionObject* triBody = m_isSwapped ? body0 : body1; if (triBody->getCollisionShape()->isConcave()) diff --git a/src/BulletSoftBody/btSoftBodyHelpers.cpp b/src/BulletSoftBody/btSoftBodyHelpers.cpp index 6b055fa65..448d3c81f 100644 --- a/src/BulletSoftBody/btSoftBodyHelpers.cpp +++ b/src/BulletSoftBody/btSoftBodyHelpers.cpp @@ -371,7 +371,7 @@ void btSoftBodyHelpers::Draw( btSoftBody* psb, break; case btSoftBody::Joint::eType::Angular: { - const btSoftBody::AJoint* pja=(const btSoftBody::AJoint*)pj; + //const btSoftBody::AJoint* pja=(const btSoftBody::AJoint*)pj; const btVector3 o0=pj->m_bodies[0].xform().getOrigin(); const btVector3 o1=pj->m_bodies[1].xform().getOrigin(); const btVector3 a0=pj->m_bodies[0].xform().getBasis()*pj->m_refs[0]; diff --git a/src/LinearMath/btConvexHull.cpp b/src/LinearMath/btConvexHull.cpp index 8b0760fa8..85c7c5dcc 100644 --- a/src/LinearMath/btConvexHull.cpp +++ b/src/LinearMath/btConvexHull.cpp @@ -1135,7 +1135,7 @@ void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, b ocount = 0; - for (i=0; i