mirror of
https://github.com/leozide/leocad
synced 2025-01-19 22:26:27 +01:00
Fix check for type of mesh index.
The index type does not only depend on the number of geometry vertices, but also on the number of conditional line vertices. Check the stored type, not the number of vertices.
This commit is contained in:
parent
57c4f2912d
commit
19bc2f4f90
1 changed files with 2 additions and 2 deletions
|
@ -1123,7 +1123,7 @@ lcMesh* lcLibraryMeshData::CreateMesh()
|
||||||
if (DstSection.Texture)
|
if (DstSection.Texture)
|
||||||
DstSection.Texture->AddRef();
|
DstSection.Texture->AddRef();
|
||||||
|
|
||||||
if (Mesh->mNumVertices < 0x10000)
|
if (Mesh->mIndexType == GL_UNSIGNED_SHORT)
|
||||||
{
|
{
|
||||||
DstSection.IndexOffset = NumIndices * 2;
|
DstSection.IndexOffset = NumIndices * 2;
|
||||||
|
|
||||||
|
@ -1294,7 +1294,7 @@ void lcLibraryMeshData::UpdateMeshBoundingBox(lcMesh* Mesh)
|
||||||
lcMeshSection& Section = Lod.Sections[SectionIdx];
|
lcMeshSection& Section = Lod.Sections[SectionIdx];
|
||||||
lcVector3 SectionMin(FLT_MAX, FLT_MAX, FLT_MAX), SectionMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);
|
lcVector3 SectionMin(FLT_MAX, FLT_MAX, FLT_MAX), SectionMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);
|
||||||
|
|
||||||
if (Mesh->mNumVertices < 0x10000)
|
if (Mesh->mIndexType == GL_UNSIGNED_SHORT)
|
||||||
UpdateMeshSectionBoundingBox<quint16>(Mesh, Section, SectionMin, SectionMax);
|
UpdateMeshSectionBoundingBox<quint16>(Mesh, Section, SectionMin, SectionMax);
|
||||||
else
|
else
|
||||||
UpdateMeshSectionBoundingBox<quint32>(Mesh, Section, SectionMin, SectionMax);
|
UpdateMeshSectionBoundingBox<quint32>(Mesh, Section, SectionMin, SectionMax);
|
||||||
|
|
Loading…
Reference in a new issue