Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualrnlf

Posted 17 December 2012 - 08:28 AM

You will overcome this problem by adding a check for the level of your current node. Quick example (please put it together with the rest of your code yourself):

[source lang="c++"]void create(std::shared_ptr<OcTree> _tree, int level) {... all the rest, test for intersections and stuff ... if(cnt <= 1 || level > max_level) { ... all the stuff you do in your original code, except that you may have a list of nodes instead of only one ... } else { .... create(..., level + 1) ... }}[/source]

Hope this is understandable, don't really have the time to go more in depth at the moment.

#1rnlf

Posted 17 December 2012 - 08:28 AM

You will overcome this problem by adding a check for the level of your current node. Quick example (please put it together with the rest of your code yourself):

[source lang="cpp"]void create(std::shared_ptr<OcTree> _tree, int level) {... all the rest, test for intersections and stuff ... if(cnt <= 1 || level > max_level) { ... all the stuff you do in your original code, except that you may have a list of nodes instead of only one ... } else { .... create(..., level + 1) ... }}[/source]

Hope this is understandable, don't really have the time to go more in depth at the moment.

PARTNERS