fix more warnings in BulletCollision, and fix CMakeLists for Linux

This commit is contained in:
Erwin Coumans
2014-08-21 15:54:50 -07:00
parent 143c2da254
commit 5834547368
27 changed files with 1277 additions and 1246 deletions

View File

@@ -28,18 +28,14 @@ ATTRIBUTE_ALIGNED16(class) btCollisionShape
{
protected:
int m_shapeType;
void* m_userPointer;
int m_userIndex;
union
{
void* m_userPointer;
int m_userIndex;
};
public:
BT_DECLARE_ALIGNED_ALLOCATOR();
btCollisionShape() : m_shapeType (INVALID_SHAPE_PROXYTYPE), m_userPointer(0)
btCollisionShape() : m_shapeType (INVALID_SHAPE_PROXYTYPE), m_userPointer(0), m_userIndex(-1)
{
}
@@ -135,17 +131,17 @@ public:
{
return m_userPointer;
}
void setUserIndex(int index)
{
m_userIndex = index;
}
int getUserIndex() const
int getUserIndex() const
{
return m_userIndex;
}
virtual int calculateSerializeBufferSize() const;
///fills the dataBuffer and returns the struct name (and 0 on failure)

View File

@@ -303,7 +303,7 @@ void btCompoundShape::createAabbTreeFromChildren()
m_dynamicAabbTree = new(mem) btDbvt();
btAssert(mem==m_dynamicAabbTree);
for ( size_t index = 0; index < m_children.size(); index++ )
for ( int index = 0; index < m_children.size(); index++ )
{
btCompoundShapeChild &child = m_children[index];
@@ -312,7 +312,8 @@ void btCompoundShape::createAabbTreeFromChildren()
child.m_childShape->getAabb(child.m_transform,localAabbMin,localAabbMax);
const btDbvtVolume bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
child.m_node = m_dynamicAabbTree->insert(bounds, reinterpret_cast<void*>(index) );
size_t index2 = index;
child.m_node = m_dynamicAabbTree->insert(bounds, reinterpret_cast<void*>(index2) );
}
}
}

View File

@@ -274,7 +274,7 @@ void btConvexPolyhedron::initialize()
#endif
}
void btConvexPolyhedron::project(const btTransform& trans, const btVector3& dir, btScalar& minProj, btScalar& maxProj, btVector3& witnesPtMin,btVector3& witnesPtMax) const
void btConvexPolyhedron::project(const btTransform& trans, const btVector3& dir, btScalar& minProj, btScalar& maxProj, btVector3& witnesPtMin,btVector3& witnesPtMax) const
{
minProj = FLT_MAX;
maxProj = -FLT_MAX;

View File

@@ -56,7 +56,7 @@ ATTRIBUTE_ALIGNED16(class) btConvexPolyhedron
void initialize();
bool testContainment() const;
void project(const btTransform& trans, const btVector3& dir, btScalar& minProj, btScalar& maxProj, btVector3& witnesPtMin,btVector3& witnesPtMax) const;
void project(const btTransform& trans, const btVector3& dir, btScalar& minProj, btScalar& maxProj, btVector3& witnesPtMin,btVector3& witnesPtMax) const;
};

View File

@@ -365,13 +365,13 @@ void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback
{
//first triangle
getVertex(x,j,vertices[0]);
getVertex(x, j + 1, vertices[1]);
getVertex(x, j + 1, vertices[1]);
getVertex(x + 1, j + 1, vertices[2]);
callback->processTriangle(vertices,x,j);
//second triangle
// getVertex(x,j,vertices[0]);//already got this vertex before, thanks to Danny Chapman
getVertex(x+1,j+1,vertices[1]);
getVertex(x + 1, j, vertices[2]);
getVertex(x + 1, j, vertices[2]);
callback->processTriangle(vertices, x, j);
} else