+ disable perturbation for btConvexPlaneCollisionAlgorithm, it introduces artifacts (additional points cause spheres/cylinders and other curved objects to move)

+ applied patch to mix double/single precision meshes independent from double/single precision Bullet build
Thanks to Ole for the patch, http://code.google.com/p/bullet/issues/detail?id=213
+ re-enable warming starting in constraint solver, it was disabled by accident
+ fix btConvexHullShape constructor, so accept vertices with non-16-byte striding
Thanks Shawn Baird for report and fix: http://code.google.com/p/bullet/issues/detail?id=204
This commit is contained in:
erwin.coumans
2009-05-06 19:13:11 +00:00
parent 77fac5e2ae
commit f3c3d2f156
7 changed files with 160 additions and 87 deletions

View File

@@ -25,18 +25,33 @@ subject to the following restrictions:
///Instead of the number of indices, we pass the number of triangles.
ATTRIBUTE_ALIGNED16( struct) btIndexedMesh
{
BT_DECLARE_ALIGNED_ALLOCATOR();
BT_DECLARE_ALIGNED_ALLOCATOR();
int m_numTriangles;
const unsigned char * m_triangleIndexBase;
int m_triangleIndexStride;
int m_numVertices;
const unsigned char * m_vertexBase;
int m_vertexStride;
// The index type is set when adding an indexed mesh to the
// btTriangleIndexVertexArray, do not set it manually
PHY_ScalarType m_indexType;
int pad;
int m_numTriangles;
const unsigned char * m_triangleIndexBase;
int m_triangleIndexStride;
int m_numVertices;
const unsigned char * m_vertexBase;
int m_vertexStride;
// The index type is set when adding an indexed mesh to the
// btTriangleIndexVertexArray, do not set it manually
PHY_ScalarType m_indexType;
// The vertex type has a default type similar to Bullet's precision mode (float or double)
// but can be set manually if you for example run Bullet with double precision but have
// mesh data in single precision..
PHY_ScalarType m_vertexType;
btIndexedMesh()
{
#ifdef BT_USE_DOUBLE_PRECISION
m_vertexType = PHY_DOUBLE;
#else // BT_USE_DOUBLE_PRECISION
m_vertexType = PHY_FLOAT;
#endif // BT_USE_DOUBLE_PRECISION
}
}
;
@@ -69,10 +84,10 @@ public:
//just to be backwards compatible
btTriangleIndexVertexArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride);
void addIndexedMesh(const btIndexedMesh& mesh, PHY_ScalarType indexType = PHY_INTEGER)
void addIndexedMesh(const btIndexedMesh& mesh, PHY_ScalarType indexType = PHY_INTEGER)
{
m_indexedMeshes.push_back(mesh);
m_indexedMeshes[m_indexedMeshes.size()-1].m_indexType = indexType;
m_indexedMeshes.push_back(mesh);
m_indexedMeshes[m_indexedMeshes.size()-1].m_indexType = indexType;
}