Cleaned up some compile-time warnings.
This commit is contained in:
@@ -164,14 +164,15 @@ void BasicDemo::initPhysics()
|
|||||||
trans.setIdentity();
|
trans.setIdentity();
|
||||||
//stack them
|
//stack them
|
||||||
int colsize = 2;
|
int colsize = 2;
|
||||||
int row = (i*HALF_EXTENTS*2)/(colsize*2*HALF_EXTENTS);
|
int row = (int)((i*HALF_EXTENTS*2)/(colsize*2*HALF_EXTENTS));
|
||||||
int row2 = row;
|
int row2 = row;
|
||||||
int col = (i)%(colsize)-colsize/2;
|
int col = (i)%(colsize)-colsize/2;
|
||||||
btVector3 pos(col*2*HALF_EXTENTS + (row2%2)*HALF_EXTENTS,
|
btVector3 pos(col*2*HALF_EXTENTS + (row2%2)*HALF_EXTENTS,
|
||||||
row*2*HALF_EXTENTS+HALF_EXTENTS,0);
|
row*2*HALF_EXTENTS+HALF_EXTENTS,0);
|
||||||
|
|
||||||
trans.setOrigin(pos);
|
trans.setOrigin(pos);
|
||||||
btRigidBody* body = localCreateRigidBody(1.f,trans,sphereShape);
|
//btRigidBody* body = localCreateRigidBody(1.f,trans,sphereShape);
|
||||||
|
localCreateRigidBody(1.f,trans,sphereShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
clientResetScene();
|
clientResetScene();
|
||||||
@@ -194,9 +195,9 @@ void BasicDemo::exitPhysics()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//delete collision shapes
|
//delete collision shapes
|
||||||
for (i=0;i<m_collisionShapes.size();i++)
|
for (unsigned int j=0;j<m_collisionShapes.size();j++)
|
||||||
{
|
{
|
||||||
btCollisionShape* shape = m_collisionShapes[i];
|
btCollisionShape* shape = m_collisionShapes[j];
|
||||||
delete shape;
|
delete shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ public:
|
|||||||
|
|
||||||
if (vertices.size() > 0)
|
if (vertices.size() > 0)
|
||||||
{
|
{
|
||||||
bool isDynamic = false;
|
|
||||||
float mass = 0.f;
|
float mass = 0.f;
|
||||||
btTransform startTransform;
|
btTransform startTransform;
|
||||||
//can use a shift
|
//can use a shift
|
||||||
@@ -72,7 +71,8 @@ public:
|
|||||||
//this create an internal copy of the vertices
|
//this create an internal copy of the vertices
|
||||||
btCollisionShape* shape = new btConvexHullShape(&(vertices[0].getX()),vertices.size());
|
btCollisionShape* shape = new btConvexHullShape(&(vertices[0].getX()),vertices.size());
|
||||||
|
|
||||||
btRigidBody* body = m_demoApp->localCreateRigidBody(mass, startTransform,shape);
|
//btRigidBody* body = m_demoApp->localCreateRigidBody(mass, startTransform,shape);
|
||||||
|
m_demoApp->localCreateRigidBody(mass, startTransform,shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ void ConcaveDemo::initPhysics()
|
|||||||
|
|
||||||
m_dynamicsWorld = new btDiscreteDynamicsWorld();
|
m_dynamicsWorld = new btDiscreteDynamicsWorld();
|
||||||
|
|
||||||
bool isDynamic = false;
|
|
||||||
float mass = 0.f;
|
float mass = 0.f;
|
||||||
btTransform startTransform;
|
btTransform startTransform;
|
||||||
startTransform.setIdentity();
|
startTransform.setIdentity();
|
||||||
|
|||||||
@@ -186,13 +186,13 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDynamic = true;
|
|
||||||
float mass = 1.f;
|
float mass = 1.f;
|
||||||
btCollisionShape* convexShape = new btConvexTriangleMeshShape(trimesh);
|
btCollisionShape* convexShape = new btConvexTriangleMeshShape(trimesh);
|
||||||
btTransform trans;
|
btTransform trans;
|
||||||
trans.setIdentity();
|
trans.setIdentity();
|
||||||
trans.setOrigin(centroid);
|
trans.setOrigin(centroid);
|
||||||
btRigidBody* body = m_convexDemo->localCreateRigidBody( mass, trans,convexShape);
|
//btRigidBody* body = m_convexDemo->localCreateRigidBody( mass, trans,convexShape);
|
||||||
|
m_convexDemo->localCreateRigidBody( mass, trans,convexShape);
|
||||||
mBaseCount+=result.mHullVcount; // advance the 'base index' counter.
|
mBaseCount+=result.mHullVcount; // advance the 'base index' counter.
|
||||||
|
|
||||||
|
|
||||||
@@ -229,7 +229,6 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
btCollisionShape* convexShape = new btConvexTriangleMeshShape(trimesh);
|
btCollisionShape* convexShape = new btConvexTriangleMeshShape(trimesh);
|
||||||
bool isDynamic = true;
|
|
||||||
float mass = 1.f;
|
float mass = 1.f;
|
||||||
|
|
||||||
btTransform startTransform;
|
btTransform startTransform;
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ void UserCollisionAlgorithm::initPhysics()
|
|||||||
const int NUM_VERTS_X = 50;
|
const int NUM_VERTS_X = 50;
|
||||||
const int NUM_VERTS_Y = 50;
|
const int NUM_VERTS_Y = 50;
|
||||||
const int totalVerts = NUM_VERTS_X*NUM_VERTS_Y;
|
const int totalVerts = NUM_VERTS_X*NUM_VERTS_Y;
|
||||||
const int totalTriangles = 2*(NUM_VERTS_X-1)*(NUM_VERTS_Y-1);
|
|
||||||
|
|
||||||
btVector3* gVertices = new btVector3[totalVerts];
|
btVector3* gVertices = new btVector3[totalVerts];
|
||||||
|
|
||||||
@@ -90,7 +89,6 @@ void UserCollisionAlgorithm::initPhysics()
|
|||||||
|
|
||||||
btTriangleMesh* trimesh = new btTriangleMesh();
|
btTriangleMesh* trimesh = new btTriangleMesh();
|
||||||
|
|
||||||
int index=0;
|
|
||||||
for ( i=0;i<NUM_VERTS_X-1;i++)
|
for ( i=0;i<NUM_VERTS_X-1;i++)
|
||||||
{
|
{
|
||||||
for (int j=0;j<NUM_VERTS_Y-1;j++)
|
for (int j=0;j<NUM_VERTS_Y-1;j++)
|
||||||
@@ -115,7 +113,6 @@ void UserCollisionAlgorithm::initPhysics()
|
|||||||
|
|
||||||
m_dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase);
|
m_dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase);
|
||||||
|
|
||||||
bool isDynamic = false;
|
|
||||||
float mass = 0.f;
|
float mass = 0.f;
|
||||||
btTransform startTransform;
|
btTransform startTransform;
|
||||||
startTransform.setIdentity();
|
startTransform.setIdentity();
|
||||||
@@ -130,7 +127,8 @@ void UserCollisionAlgorithm::initPhysics()
|
|||||||
{
|
{
|
||||||
btCollisionShape* sphereShape = new btSphereShape(1);
|
btCollisionShape* sphereShape = new btSphereShape(1);
|
||||||
startTransform.setOrigin(btVector3(1,2*i,1));
|
startTransform.setOrigin(btVector3(1,2*i,1));
|
||||||
btRigidBody* body = localCreateRigidBody(1, startTransform,sphereShape);
|
//btRigidBody* body = localCreateRigidBody(1, startTransform,sphereShape);
|
||||||
|
localCreateRigidBody(1, startTransform,sphereShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -398,3 +398,4 @@ float resolveSingleFrictionEmpty(
|
|||||||
{
|
{
|
||||||
return 0.f;
|
return 0.f;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -779,3 +779,4 @@ void btDiscreteDynamicsWorld::setConstraintSolver(btConstraintSolver* solver)
|
|||||||
m_ownsConstraintSolver = false;
|
m_ownsConstraintSolver = false;
|
||||||
m_constraintSolver = solver;
|
m_constraintSolver = solver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user