Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualbelfegor

Posted 18 December 2012 - 12:25 PM

Found where the bug was. Posted Image

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.

#2belfegor

Posted 18 December 2012 - 12:25 PM

Found where the bug was. Posted Image

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)
  {
   [b]_tree->[/b]child[i] = std::shared_ptr<OcTree>(new OcTree(_tree->pSmgr, subdivide(_tree, i)));
   create([b]_tree->[/b]child[i], curr_level + 1);
  }

Damn recursive functions, should step back and learn again about them better.

#1belfegor

Posted 18 December 2012 - 12:25 PM

Found where the bug was. Posted Image

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)
  {
   [b]_tree->[/b]child[i] = std::shared_ptr<OcTree>(new OcTree(_tree->pSmgr, subdivide(_tree, i)));
   create([b]_tree->[/b]child[i], curr_level + 1);
  }

Damn recursive functions, should step back and learn again about them better.

PARTNERS