
A lot of times my collision model is missing triangles. In this case, the triangles on the top half of the right block are missing, as evidence by the lacking green debug lines. Which triangles it is missing depends on how many triangles are in the model in total, but it seems to just cut out after a bit. Whole sections of the model can be missing sometimes. I'm certain that the problem isn't one of not passing my entire triangle array - I've verified that I am passing all of the triangles in. Here's how I create the thing:
Code: Select all
m_apCollisionMeshes[iModel].m_pIndexVertexArray = new btTriangleIndexVertexArray(iTriangles, aiIndices.data(), sizeof(int)*3, avecVertices.size(), &avecVertices[0].x, sizeof(Vector));
m_apCollisionMeshes[iModel].m_pCollisionShape = new btBvhTriangleMeshShape(m_apCollisionMeshes[iModel].m_pIndexVertexArray, true);
Can anybody help? Do I just need to make sure I split non-continuous meshes into different groups? Or I forgot to set some flag or something? Or maybe I should be using a different approach for my world collision?