mirror of https://github.com/axmolengine/axmol.git
compute submesh aabb error
This commit is contained in:
parent
3fd122391c
commit
d6ed1af1f7
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue