From 63094dfd92847d92856061d5c2d450d6dda27a44 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Tue, 27 Oct 2015 18:34:29 +0100 Subject: [PATCH] Fix issue in ConcaveMeshShape (AABB calculation) --- src/collision/shapes/ConcaveMeshShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/collision/shapes/ConcaveMeshShape.cpp b/src/collision/shapes/ConcaveMeshShape.cpp index ed7ae968..e3f8977e 100644 --- a/src/collision/shapes/ConcaveMeshShape.cpp +++ b/src/collision/shapes/ConcaveMeshShape.cpp @@ -134,10 +134,10 @@ void ConcaveMeshShape::recalculateBounds() { // Get the index of the current vertex in the triangle int vertexIndex; 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) { - vertexIndex = ((unsigned short*)(indicesStart + j * indexStride))[k]; + vertexIndex = ((unsigned short*)(indicesStart + j * 3 * indexStride))[k]; } Vector3 vertex;