In create function
_tree->vNode.clear();
for(std::size_t i = 0; i < 8; ++i)
{
child[i] = std::shared_ptr<OcTree>(new OcTree(_tree->pSmgr, subdivide(_tree, i)));
create(child[i], curr_level + 1);
}
Should be:
_tree->vNode.clear();
for(std::size_t i = 0; i < 8; ++i)
{
_tree->child[i] = std::shared_ptr<OcTree>(new OcTree(_tree->pSmgr, subdivide(_tree, i)));
create(_tree->child[i], curr_level + 1);
}
Damn recursive functions, should step back and learn again about them better.