mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +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);
|
int p = lookupParent(i, voids_for_zones);
|
||||||
if ((i % 1000) == 0) std::cout << i << std::endl;
|
if ((i % 1000) == 0) std::cout << i << std::endl;
|
||||||
|
|
||||||
|
if (p >= 0)
|
||||||
|
{
|
||||||
nodes[p].children.push_back(&nodes[i]);
|
nodes[p].children.push_back(&nodes[i]);
|
||||||
nodes[i].parent = &nodes[p];
|
nodes[i].parent = &nodes[p];
|
||||||
|
}
|
||||||
inserted++;
|
inserted++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +195,10 @@ public:
|
||||||
|
|
||||||
for (int i = 0; i < inserted; i++)
|
for (int i = 0; i < inserted; i++)
|
||||||
if (nodes[i].parent == 0)
|
if (nodes[i].parent == 0)
|
||||||
|
{
|
||||||
nodes[i].parent = rootNode;
|
nodes[i].parent = rootNode;
|
||||||
|
rootNode->children.push_back(&nodes[i]);
|
||||||
|
}
|
||||||
activeNodes = inserted;
|
activeNodes = inserted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue