There is little to no documentation on how to use btConvexHullShape, but I assume you use it as a shape and add vertices using ->AddPoint() right? This code doesn't seem to work at ALL, the objects meet the ground plane, and collide successfully, but its like the collision area is a tiny sphere in the middle of the object, which means the object itself (mesh) clips the plane quite a bit
Code: Select all
btConvexHullShape* fallShape = new btConvexHullShape();
dbPerformCheckListForObjectLimbs(1001);
int limbCount = dbChecklistQuantity();
int totalVertexCount = 0;
for(int i = 0; i < limbCount; i++) {
int vertexCount = GetVertexCountForLimb(i);
for(int j = 0; i < vertexCount; i++) {
btVector3 position(dbGetVertexDataPositionX(j),dbGetVertexDataPositionY(j),dbGetVertexDataPositionZ(j));
fallShape->addPoint(position);
totalVertexCount++;
}
}
It has some of my own engine and DarkGDK code library implemented, but the code is pretty self-explanitory. Any reason the collision just isn't working? The "totalVertexCount" reaches like 2900, so I know vertices are actually being added.