This commit is contained in:
erwin.coumans 2009-09-09 23:51:30 +00:00
parent cc5ba4608f
commit ed09140fb7
11 changed files with 30 additions and 29 deletions

View File

@ -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;i<TaruVtxCount;i++)
{
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;
@ -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));
}

View File

@ -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();

View File

@ -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
{

View File

@ -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);

View File

@ -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<btConvexShape*>(body->getCollisionShape());
//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;

View File

@ -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<m_maxNumOutstandingTasks;i++)
for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
{
if (m_taskBusy[i])
{
@ -287,7 +287,7 @@ SpuCollisionTaskProcess::flush2()
unsigned int taskId=-1;
unsigned int outputSize;
for (int i=0;i<m_maxNumOutstandingTasks;i++)
for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
{
if (m_taskBusy[i])
{

View File

@ -108,7 +108,7 @@ void Win32ThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgumen
btSpuStatus& spuStatus = m_activeSpuStatus[taskId];
btAssert(taskId>=0);
btAssert(taskId<m_activeSpuStatus.size());
btAssert(int(taskId)<m_activeSpuStatus.size());
spuStatus.m_commandId = uiCommand;
spuStatus.m_status = 1;

View File

@ -2180,7 +2180,7 @@ void btSoftBody::updateClusters()
{
btSoftBody::Cluster& c=*m_clusters[i];
const int n=c.m_nodes.size();
const btScalar invn=1/(btScalar)n;
//const btScalar invn=1/(btScalar)n;
if(n)
{
/* Frame */
@ -2326,7 +2326,7 @@ void btSoftBody::applyClusters(bool drift)
{
BT_PROFILE("ApplyClusters");
const btScalar f0=m_sst.sdt;
const btScalar f1=f0/2;
//const btScalar f1=f0/2;
btAlignedObjectArray<btVector3> deltas;
btAlignedObjectArray<btScalar> 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);
}

View File

@ -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())

View File

@ -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];

View File

@ -1135,7 +1135,7 @@ void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, b
ocount = 0;
for (i=0; i<indexcount; i++)
for (i=0; i<int (indexcount); i++)
{
unsigned int v = indices[i]; // original array index