Fix issue in ConcaveMeshShape (AABB calculation)

This commit is contained in:
Daniel Chappuis 2015-10-27 18:34:29 +01:00
parent e135d4b592
commit 63094dfd92

View File

@ -134,10 +134,10 @@ void ConcaveMeshShape::recalculateBounds() {
// Get the index of the current vertex in the triangle // Get the index of the current vertex in the triangle
int vertexIndex; int vertexIndex;
if (indexType == TriangleVertexArray::INDEX_INTEGER_TYPE) { if (indexType == TriangleVertexArray::INDEX_INTEGER_TYPE) {
vertexIndex = ((unsigned int*)(indicesStart + j * indexStride))[k]; vertexIndex = ((unsigned int*)(indicesStart + j * 3 * indexStride))[k];
} }
else if (indexType == TriangleVertexArray::INDEX_SHORT_TYPE) { else if (indexType == TriangleVertexArray::INDEX_SHORT_TYPE) {
vertexIndex = ((unsigned short*)(indicesStart + j * indexStride))[k]; vertexIndex = ((unsigned short*)(indicesStart + j * 3 * indexStride))[k];
} }
Vector3 vertex; Vector3 vertex;