mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-09 09:00:08 +00:00
remove some warnings, thanks to Zenja http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=4063
This commit is contained in:
parent
cc5ba4608f
commit
ed09140fb7
@ -65,7 +65,7 @@ public:
|
|||||||
{
|
{
|
||||||
ms = 0;
|
ms = 0;
|
||||||
max_ms = 0;
|
max_ms = 0;
|
||||||
min_ms = 9999.0;
|
min_ms = 9999;
|
||||||
sum_ms_samples = 0;
|
sum_ms_samples = 0;
|
||||||
sum_ms = 0;
|
sum_ms = 0;
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ public:
|
|||||||
frame_counter = 0;
|
frame_counter = 0;
|
||||||
ms = 0;
|
ms = 0;
|
||||||
max_ms = 0;
|
max_ms = 0;
|
||||||
min_ms = 9999.0;
|
min_ms = 9999;
|
||||||
sum_ms_samples = 0;
|
sum_ms_samples = 0;
|
||||||
sum_ms = 0;
|
sum_ms = 0;
|
||||||
dx = 10.0;
|
dx = 10.0;
|
||||||
@ -105,8 +105,8 @@ public:
|
|||||||
|
|
||||||
void move (btScalar dt)
|
void move (btScalar dt)
|
||||||
{
|
{
|
||||||
if (dt > (1.0/60.0))
|
if (dt > btScalar(1.0/60.0))
|
||||||
dt = 1.0/60.0;
|
dt = btScalar(1.0/60.0);
|
||||||
for (int i = 0; i < NUMRAYS; i++)
|
for (int i = 0; i < NUMRAYS; i++)
|
||||||
{
|
{
|
||||||
source[i][0] += dx * dt * sign;
|
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);
|
m_dynamicsWorld = dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration);
|
||||||
//dynamicsWorld->getSimulationIslandManager()->setSplitIslands(false);
|
//dynamicsWorld->getSimulationIslandManager()->setSplitIslands(false);
|
||||||
dynamicsWorld->getDispatchInfo().m_useConvexConservativeDistanceUtil = true;
|
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));
|
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||||
@ -553,7 +553,7 @@ void BenchmarkDemo::createTowerCircle(const btVector3& offsetPosition,int stackS
|
|||||||
trans.setRotation(rotY);
|
trans.setRotation(rotY);
|
||||||
localCreateRigidBody(mass,trans,blockShape);
|
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;
|
posY += boxSize[1] * 2.0f;
|
||||||
@ -581,15 +581,15 @@ void BenchmarkDemo::createTest2()
|
|||||||
// Enrico: Shouldn't these three variables be real constants and not defines?
|
// Enrico: Shouldn't these three variables be real constants and not defines?
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI btScalar(3.14159265358979323846)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef M_PI_2
|
#ifndef M_PI_2
|
||||||
#define M_PI_2 1.57079632679489661923
|
#define M_PI_2 btScalar(1.57079632679489661923)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef M_PI_4
|
#ifndef M_PI_4
|
||||||
#define M_PI_4 0.785398163397448309616
|
#define M_PI_4 btScalar(0.785398163397448309616)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class RagDoll
|
class RagDoll
|
||||||
@ -731,9 +731,9 @@ public:
|
|||||||
// Setup some damping on the m_bodies
|
// Setup some damping on the m_bodies
|
||||||
for (int i = 0; i < BODYPART_COUNT; ++i)
|
for (int i = 0; i < BODYPART_COUNT; ++i)
|
||||||
{
|
{
|
||||||
m_bodies[i]->setDamping(0.05, 0.85);
|
m_bodies[i]->setDamping(btScalar(0.05), btScalar(0.85));
|
||||||
m_bodies[i]->setDeactivationTime(0.8);
|
m_bodies[i]->setDeactivationTime(btScalar(0.8));
|
||||||
m_bodies[i]->setSleepingThresholds(1.6, 2.5);
|
m_bodies[i]->setSleepingThresholds(btScalar(1.6), btScalar(2.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now setup the constraints
|
// Now setup the constraints
|
||||||
@ -901,7 +901,7 @@ void BenchmarkDemo::createTest4()
|
|||||||
for (int i=0;i<TaruVtxCount;i++)
|
for (int i=0;i<TaruVtxCount;i++)
|
||||||
{
|
{
|
||||||
btVector3 vtx(TaruVtx[i*3],TaruVtx[i*3+1],TaruVtx[i*3+2]);
|
btVector3 vtx(TaruVtx[i*3],TaruVtx[i*3+1],TaruVtx[i*3+2]);
|
||||||
convexHullShape->addPoint(vtx*(1./scaling));
|
convexHullShape->addPoint(vtx*btScalar(1./scaling));
|
||||||
}
|
}
|
||||||
|
|
||||||
btTransform trans;
|
btTransform trans;
|
||||||
@ -1022,7 +1022,7 @@ void BenchmarkDemo::createLargeMeshBody()
|
|||||||
trans.setOrigin(btVector3(0,-25,0));
|
trans.setOrigin(btVector3(0,-25,0));
|
||||||
|
|
||||||
btRigidBody* body = localCreateRigidBody(0,trans,trimeshShape);
|
btRigidBody* body = localCreateRigidBody(0,trans,trimeshShape);
|
||||||
body->setFriction (0.9);
|
body->setFriction (btScalar(0.9));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,9 +365,10 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl
|
|||||||
|
|
||||||
btVector3 v0,v1;
|
btVector3 v0,v1;
|
||||||
btVector3 sepNormalWorldSpace;
|
btVector3 sepNormalWorldSpace;
|
||||||
btScalar sepDist = 0.f;
|
|
||||||
|
|
||||||
#ifdef USE_SEPDISTANCE_UTIL2
|
#ifdef USE_SEPDISTANCE_UTIL2
|
||||||
|
btScalar sepDist = 0.f;
|
||||||
if (dispatchInfo.m_useConvexConservativeDistanceUtil)
|
if (dispatchInfo.m_useConvexConservativeDistanceUtil)
|
||||||
{
|
{
|
||||||
sepDist = gjkPairDetector.getCachedSeparatingDistance();
|
sepDist = gjkPairDetector.getCachedSeparatingDistance();
|
||||||
|
@ -102,9 +102,9 @@ void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0
|
|||||||
btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape();
|
btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape();
|
||||||
btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape();
|
btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape();
|
||||||
|
|
||||||
bool hasCollision = false;
|
|
||||||
const btVector3& planeNormal = planeShape->getPlaneNormal();
|
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
|
//first perform a collision query with the non-perturbated collision objects
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScala
|
|||||||
:btConvexInternalAabbCachingShape ()
|
:btConvexInternalAabbCachingShape ()
|
||||||
{
|
{
|
||||||
m_shapeType = MULTI_SPHERE_SHAPE_PROXYTYPE;
|
m_shapeType = MULTI_SPHERE_SHAPE_PROXYTYPE;
|
||||||
btScalar startMargin = btScalar(BT_LARGE_FLOAT);
|
//btScalar startMargin = btScalar(BT_LARGE_FLOAT);
|
||||||
|
|
||||||
m_localPositionArray.resize(numSpheres);
|
m_localPositionArray.resize(numSpheres);
|
||||||
m_radiArray.resize(numSpheres);
|
m_radiArray.resize(numSpheres);
|
||||||
|
@ -870,7 +870,7 @@ void btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep)
|
|||||||
gNumClampedCcdMotions++;
|
gNumClampedCcdMotions++;
|
||||||
|
|
||||||
btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
|
btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
|
||||||
btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
|
//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
|
||||||
btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
|
btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
|
||||||
|
|
||||||
sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
|
sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
|
||||||
|
@ -97,7 +97,7 @@ void SpuCollisionTaskProcess::initialize2(bool useEpa)
|
|||||||
printf("SpuCollisionTaskProcess::initialize()\n");
|
printf("SpuCollisionTaskProcess::initialize()\n");
|
||||||
#endif //DEBUG_SPU_TASK_SCHEDULING
|
#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;
|
m_taskBusy[i] = false;
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ void SpuCollisionTaskProcess::issueTask2()
|
|||||||
unsigned int outputSize;
|
unsigned int outputSize;
|
||||||
|
|
||||||
|
|
||||||
for (int i=0;i<m_maxNumOutstandingTasks;i++)
|
for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
|
||||||
{
|
{
|
||||||
if (m_taskBusy[i])
|
if (m_taskBusy[i])
|
||||||
{
|
{
|
||||||
@ -287,7 +287,7 @@ SpuCollisionTaskProcess::flush2()
|
|||||||
unsigned int taskId=-1;
|
unsigned int taskId=-1;
|
||||||
unsigned int outputSize;
|
unsigned int outputSize;
|
||||||
|
|
||||||
for (int i=0;i<m_maxNumOutstandingTasks;i++)
|
for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
|
||||||
{
|
{
|
||||||
if (m_taskBusy[i])
|
if (m_taskBusy[i])
|
||||||
{
|
{
|
||||||
|
@ -108,7 +108,7 @@ void Win32ThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgumen
|
|||||||
|
|
||||||
btSpuStatus& spuStatus = m_activeSpuStatus[taskId];
|
btSpuStatus& spuStatus = m_activeSpuStatus[taskId];
|
||||||
btAssert(taskId>=0);
|
btAssert(taskId>=0);
|
||||||
btAssert(taskId<m_activeSpuStatus.size());
|
btAssert(int(taskId)<m_activeSpuStatus.size());
|
||||||
|
|
||||||
spuStatus.m_commandId = uiCommand;
|
spuStatus.m_commandId = uiCommand;
|
||||||
spuStatus.m_status = 1;
|
spuStatus.m_status = 1;
|
||||||
|
@ -2180,7 +2180,7 @@ void btSoftBody::updateClusters()
|
|||||||
{
|
{
|
||||||
btSoftBody::Cluster& c=*m_clusters[i];
|
btSoftBody::Cluster& c=*m_clusters[i];
|
||||||
const int n=c.m_nodes.size();
|
const int n=c.m_nodes.size();
|
||||||
const btScalar invn=1/(btScalar)n;
|
//const btScalar invn=1/(btScalar)n;
|
||||||
if(n)
|
if(n)
|
||||||
{
|
{
|
||||||
/* Frame */
|
/* Frame */
|
||||||
@ -2326,7 +2326,7 @@ void btSoftBody::applyClusters(bool drift)
|
|||||||
{
|
{
|
||||||
BT_PROFILE("ApplyClusters");
|
BT_PROFILE("ApplyClusters");
|
||||||
const btScalar f0=m_sst.sdt;
|
const btScalar f0=m_sst.sdt;
|
||||||
const btScalar f1=f0/2;
|
//const btScalar f1=f0/2;
|
||||||
btAlignedObjectArray<btVector3> deltas;
|
btAlignedObjectArray<btVector3> deltas;
|
||||||
btAlignedObjectArray<btScalar> weights;
|
btAlignedObjectArray<btScalar> weights;
|
||||||
deltas.resize(m_nodes.size(),btVector3(0,0,0));
|
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 btVector3 del=b.m_x-a.m_x;
|
||||||
const btScalar len=del.length2();
|
const btScalar len=del.length2();
|
||||||
const btScalar k=((l.m_c1-len)/(l.m_c0*(l.m_c1+len)))*kst;
|
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);
|
a.m_x-=del*(k*a.m_im);
|
||||||
b.m_x+=del*(k*b.m_im);
|
b.m_x+=del*(k*b.m_im);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
btCollisionObject* triBody = m_isSwapped ? body0 : body1;
|
||||||
|
|
||||||
if (triBody->getCollisionShape()->isConcave())
|
if (triBody->getCollisionShape()->isConcave())
|
||||||
|
@ -371,7 +371,7 @@ void btSoftBodyHelpers::Draw( btSoftBody* psb,
|
|||||||
break;
|
break;
|
||||||
case btSoftBody::Joint::eType::Angular:
|
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 o0=pj->m_bodies[0].xform().getOrigin();
|
||||||
const btVector3 o1=pj->m_bodies[1].xform().getOrigin();
|
const btVector3 o1=pj->m_bodies[1].xform().getOrigin();
|
||||||
const btVector3 a0=pj->m_bodies[0].xform().getBasis()*pj->m_refs[0];
|
const btVector3 a0=pj->m_bodies[0].xform().getBasis()*pj->m_refs[0];
|
||||||
|
@ -1135,7 +1135,7 @@ void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, b
|
|||||||
|
|
||||||
ocount = 0;
|
ocount = 0;
|
||||||
|
|
||||||
for (i=0; i<indexcount; i++)
|
for (i=0; i<int (indexcount); i++)
|
||||||
{
|
{
|
||||||
unsigned int v = indices[i]; // original array index
|
unsigned int v = indices[i]; // original array index
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user