fix bug on custom mesh

This commit is contained in:
yangxiao 2014-09-04 14:26:23 +08:00
parent 7ec104ab06
commit 08a1405bdc
1 changed files with 1 additions and 4 deletions

View File

@ -144,10 +144,7 @@ Mesh* Mesh::create(const std::vector<float>& 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);
}