The lodQuadTree is now correctly converted to use LodDataPoint and DistanceGenerationMode

This commit is contained in:
Leonardo
2021-07-13 15:38:20 +02:00
parent 2c719c41d9
commit 3cc78c62a0
10 changed files with 44 additions and 46 deletions
@@ -81,7 +81,7 @@ public class LodQuadTreeNode {
centerX = startX + width/2;
centerZ = startZ + width/2;
lodDataPoint = new LodDataPoint();
complexity = null;
complexity = DistanceGenerationMode.NONE;
dirty = true;
voidNode = true;
}
@@ -221,11 +221,11 @@ public class LodQuadTreeNode {
//the new complexity equal to the lowest complexity of the list
DistanceGenerationMode minComplexity = DistanceGenerationMode.SERVER;
dataList.forEach(x -> {
if (minComplexity.compareTo(x.complexity) < 0){
minComplexity = x.complexity;
for(LodQuadTreeNode node: dataList){
if (minComplexity.compareTo(node.complexity) < 0){
minComplexity = node.complexity;
}
});
}
complexity = minComplexity;
voidNode = dataList.stream().filter(x -> !x.voidNode).count() == 0;