From 08a1405bdc627f344db267b0729da57e1ab848e1 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 4 Sep 2014 14:26:23 +0800 Subject: [PATCH] fix bug on custom mesh --- cocos/3d/CCMesh.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index 0c524e4af2..f683caf684 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -144,10 +144,7 @@ Mesh* Mesh::create(const std::vector& vertices, int perVertexSizeInFloat, meshdata.subMeshIndices.push_back(indices); meshdata.subMeshIds.push_back(""); auto meshvertexdata = MeshVertexData::create(meshdata); - auto indexbuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_SHORT_16, (int)indices.size()); - - AABB aabb = MeshVertexData::calculateAABB(meshdata.vertex, meshdata.getPerVertexSize(), indices); - auto indexData = MeshIndexData::create("", meshvertexdata, indexbuffer, aabb); + auto indexData = meshvertexdata->getMeshIndexDataByIndex(0); return create("", indexData); }