reformatting / commenting

This commit is contained in:
James Seibel
2021-10-08 22:13:20 -05:00
parent 5872dc3be5
commit c0a9e3061c
3 changed files with 12 additions and 11 deletions
@@ -18,16 +18,17 @@
package com.seibel.lod.builders.bufferBuilding.lodTemplates;
import java.util.Map;
import com.seibel.lod.enums.DebugMode;
import com.seibel.lod.util.DataPointUtil;
import com.seibel.lod.util.LodUtil;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.texture.NativeImage;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import java.util.Map;
/**
* Builds LODs as rectangular prisms.
*
@@ -59,10 +59,10 @@ public class DetailDistanceUtil
return maxDistance;
int distanceUnit = LodConfig.CLIENT.worldGenerator.horizontalScale.get().distanceUnit;
switch (LodConfig.CLIENT.worldGenerator.horizontalQuality.get()){
case LINEAR:;
return (detail * distanceUnit);
switch (LodConfig.CLIENT.worldGenerator.horizontalQuality.get())
{
case LINEAR:
return (detail * distanceUnit);
default:
double base = LodConfig.CLIENT.worldGenerator.horizontalQuality.get().quadraticBase;
return (int) (Math.pow(base, detail) * distanceUnit);
@@ -365,7 +365,7 @@ public class LodUtil
int xRegionSign = (int) Math.signum(regionPosX);
int zRegionSign = (int) Math.signum(regionPosZ);
//we first find the center of the circle which is one of the following X position in the center region
// we first find the center of the circle which is one of the following X position in the center region
/*
X - X - X
| |
@@ -386,17 +386,17 @@ public class LodUtil
long memoryUse = 0;
for (byte detailLevel = BLOCK_DETAIL_LEVEL; detailLevel <= REGION_DETAIL_LEVEL; detailLevel++)
{
//We find now the inner and outer detail of this area
// Find the inner and outer detail of this area
innerRadius = DetailDistanceUtil.getDrawDistanceFromDetail(detailLevel);
outerRadius = DetailDistanceUtil.getDrawDistanceFromDetail(detailLevel + 1);
//we skip if the region does not intersect the two circles.
// skip this region if it does not intersect the two circles.
minDistance = LevelPosUtil.minDistance(REGION_DETAIL_LEVEL, regionPosX, regionPosZ, circleCenterX, circleCenterZ);
maxDistance = LevelPosUtil.maxDistance(REGION_DETAIL_LEVEL, regionPosX, regionPosZ, circleCenterX, circleCenterZ);
if (innerRadius > maxDistance || minDistance > outerRadius)
continue;
//we proceed to count all the position in the region that fall between these two circle
// count every position in the region that falls between the two circles
size = 1 << (REGION_DETAIL_LEVEL - detailLevel);
count = 0;
for (int x = 0; x < size; x++)
@@ -409,7 +409,7 @@ public class LodUtil
}
}
//we multiply the data with the max vertical data of this detail level
// we multiply the data with the max vertical data of this detail level
int maxVerticalData = DetailDistanceUtil.getMaxVerticalData(detailLevel);
count *= maxVerticalData;