mirror of https://github.com/axmolengine/axmol.git
fix bug on custom mesh
This commit is contained in:
parent
7ec104ab06
commit
08a1405bdc
|
@ -144,10 +144,7 @@ Mesh* Mesh::create(const std::vector<float>& vertices, int perVertexSizeInFloat,
|
||||||
meshdata.subMeshIndices.push_back(indices);
|
meshdata.subMeshIndices.push_back(indices);
|
||||||
meshdata.subMeshIds.push_back("");
|
meshdata.subMeshIds.push_back("");
|
||||||
auto meshvertexdata = MeshVertexData::create(meshdata);
|
auto meshvertexdata = MeshVertexData::create(meshdata);
|
||||||
auto indexbuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_SHORT_16, (int)indices.size());
|
auto indexData = meshvertexdata->getMeshIndexDataByIndex(0);
|
||||||
|
|
||||||
AABB aabb = MeshVertexData::calculateAABB(meshdata.vertex, meshdata.getPerVertexSize(), indices);
|
|
||||||
auto indexData = MeshIndexData::create("", meshvertexdata, indexbuffer, aabb);
|
|
||||||
|
|
||||||
return create("", indexData);
|
return create("", indexData);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue