mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-25 02:51:43 +00:00
fix: account for possible zero items when building aabb trees
This commit is contained in:
@@ -662,7 +662,7 @@ namespace xmodel
|
|||||||
options.maxs[leafIndex][2] = bounds.m_maxs.z();
|
options.maxs[leafIndex][2] = bounds.m_maxs.z();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto nodeCount = aabbTreeBuilder.BuildAabbTree(&options);
|
const auto nodeCount = options.itemCount > 0 ? aabbTreeBuilder.BuildAabbTree(&options) : 0;
|
||||||
|
|
||||||
tree->nodes.resize(nodeCount);
|
tree->nodes.resize(nodeCount);
|
||||||
for (auto nodeIndex = 0; nodeIndex < nodeCount; ++nodeIndex)
|
for (auto nodeIndex = 0; nodeIndex < nodeCount; ++nodeIndex)
|
||||||
|
|||||||
Reference in New Issue
Block a user