osg: KdTree: encode original primitive index into _vertexIndices

This commit is contained in:
blobfish
2017-06-01 15:25:38 -04:00
parent b52bc2bcd1
commit bb804c2045
2 changed files with 14 additions and 8 deletions

View File

@@ -287,6 +287,7 @@ int BuildKdTree::divide(KdTree::BuildOptions& options, osg::BoundingBox& bb, int
for(int i=istart; i<=iend; ++i)
{
unsigned int primitiveIndex = _kdTree.getPrimitiveIndices()[_primitiveIndices[i]];
primitiveIndex++; //skip original Primitive index
unsigned int numPoints = _kdTree.getVertexIndices()[primitiveIndex++];
for(; numPoints>0; --numPoints)