Merge branch 'v3' of https://github.com/super626/cocos2d-x into merge-bundle

This commit is contained in:
lvlong 2014-08-18 20:22:56 +08:00
commit 2b70cf3dd8
2 changed files with 4 additions and 2 deletions

View File

@ -641,6 +641,8 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas)
} }
meshdatas.meshDatas.push_back(meshdata); meshdatas.meshDatas.push_back(meshdata);
return true;
} }
bool Bundle3D::loadMeshDatasJson(MeshDatas& meshdatas) bool Bundle3D::loadMeshDatasJson(MeshDatas& meshdatas)
{ {

View File

@ -252,9 +252,9 @@ void Mesh::buildSubMeshes()
//calculate aabb for sub mesh //calculate aabb for sub mesh
AABB aabb; AABB aabb;
int stride = _renderdata._vertexsizeBytes / sizeof(float); int stride = _renderdata._vertexsizeBytes / sizeof(float);
for(size_t i = 0; i < it.size(); i++) for(const auto& index : it)
{ {
Vec3 point = Vec3(_renderdata._vertexs[it[i * stride] ], _renderdata._vertexs[ it[i * stride + 1] ], _renderdata._vertexs[it[i * stride + 2] ]); Vec3 point = Vec3(_renderdata._vertexs[index * stride ], _renderdata._vertexs[ index * stride + 1], _renderdata._vertexs[index * stride + 2 ]);
aabb.updateMinMax(&point, 1); aabb.updateMinMax(&point, 1);
} }
subMesh->_aabb = aabb; subMesh->_aabb = aabb;