added new classes for the quadTree
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.seibel.lod.core.objects.lod.quadtree;
|
||||
|
||||
import com.seibel.lod.core.util.DetailDistanceUtil;
|
||||
|
||||
public class LodQuadTree
|
||||
{
|
||||
public LodSection[][][] quadTreeStructure;
|
||||
public QuadTreeProperties properties;
|
||||
|
||||
public LodQuadTree()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,8 @@ public class LodSection
|
||||
public final int detail;
|
||||
|
||||
//level position of this section
|
||||
public final int levelPosX;
|
||||
public final int levelPosZ;
|
||||
public final int sectionPosX;
|
||||
public final int sectionPosZ;
|
||||
|
||||
//horizontal size of this section
|
||||
public final int horizontalSize;
|
||||
@@ -59,8 +59,8 @@ public class LodSection
|
||||
public LodSection(int detail, int horizontalSize, int verticalSize, int levelPosX, int levelPosZ, byte generationMode, boolean avoidPregeneratedChunk, int idPerLod)
|
||||
{
|
||||
this.detail = detail;
|
||||
this.levelPosX = levelPosX;
|
||||
this.levelPosZ = levelPosZ;
|
||||
this.sectionPosX = levelPosX;
|
||||
this.sectionPosZ = levelPosZ;
|
||||
this.horizontalSize = horizontalSize;
|
||||
this.verticalSize = verticalSize;
|
||||
this.generationMode = generationMode;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.seibel.lod.core.objects.lod.quadtree;
|
||||
|
||||
import com.seibel.lod.core.util.DetailDistanceUtil;
|
||||
|
||||
public class QuadTreeMover
|
||||
{
|
||||
public static void move(LodQuadTree lqt, RenderQuadTree rqt, int centerX, int centerZ)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.seibel.lod.core.objects.lod.quadtree;
|
||||
|
||||
import com.seibel.lod.core.util.DetailDistanceUtil;
|
||||
|
||||
public class QuadTreeProperties
|
||||
{
|
||||
public int MAX_NUMBER_OF_DETAIL=23;
|
||||
public int SECTION_SIZE=128;
|
||||
public int[] absoluteDetailCircleSize = new int[MAX_NUMBER_OF_DETAIL];
|
||||
public int[] relativeDetailCircleSize = new int[MAX_NUMBER_OF_DETAIL];
|
||||
public int[] generationModeOfDetail = new int[MAX_NUMBER_OF_DETAIL];
|
||||
|
||||
public LodQuadTree lodQuadTree;
|
||||
public RenderQuadTree renderQuadTree;
|
||||
|
||||
public void update()
|
||||
{
|
||||
for(int detail = 0; detail < MAX_NUMBER_OF_DETAIL; detail++)
|
||||
{
|
||||
//Compute circle distance for this detail in term of blocks
|
||||
absoluteDetailCircleSize[detail] = DetailDistanceUtil.getDrawDistanceFromDetail(detail);
|
||||
//Compute circle distance in terms of number of section
|
||||
relativeDetailCircleSize[detail] = (int) Math.ceil(absoluteDetailCircleSize[detail]/(SECTION_SIZE*2^detail));
|
||||
}
|
||||
updateGridSize();
|
||||
}
|
||||
|
||||
private void updateGridSize()
|
||||
{
|
||||
for(int detail = 0; detail < MAX_NUMBER_OF_DETAIL; detail++)
|
||||
{
|
||||
//Use this value to change to update the size of the matrices
|
||||
//relativeDetailCircleSize[detail];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.seibel.lod.core.objects.lod.quadtree;
|
||||
|
||||
import com.seibel.lod.core.util.DetailDistanceUtil;
|
||||
|
||||
public class RenderQuadTree
|
||||
{
|
||||
//public RenderSection[][][] quadTreeStructure;
|
||||
public QuadTreeProperties properties;
|
||||
|
||||
public RenderQuadTree()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user