mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
Fixed tree root
This commit is contained in:
parent
a969852064
commit
5f9e5eb5d8
1 changed files with 9 additions and 3 deletions
|
@ -181,8 +181,11 @@ public:
|
|||
int p = lookupParent(i, voids_for_zones);
|
||||
if ((i % 1000) == 0) std::cout << i << std::endl;
|
||||
|
||||
nodes[p].children.push_back(&nodes[i]);
|
||||
nodes[i].parent = &nodes[p];
|
||||
if (p >= 0)
|
||||
{
|
||||
nodes[p].children.push_back(&nodes[i]);
|
||||
nodes[i].parent = &nodes[p];
|
||||
}
|
||||
inserted++;
|
||||
}
|
||||
|
||||
|
@ -192,7 +195,10 @@ public:
|
|||
|
||||
for (int i = 0; i < inserted; i++)
|
||||
if (nodes[i].parent == 0)
|
||||
nodes[i].parent = rootNode;
|
||||
{
|
||||
nodes[i].parent = rootNode;
|
||||
rootNode->children.push_back(&nodes[i]);
|
||||
}
|
||||
activeNodes = inserted;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue