Disabled the culling until it's fixed
This commit is contained in:
@@ -101,13 +101,11 @@ public class Box
|
||||
public int color;
|
||||
public Map<Direction, int[][]> adjHeightAndDepth;
|
||||
public Map<Direction, boolean[]> culling;
|
||||
public long[] order;
|
||||
|
||||
|
||||
public Box()
|
||||
{
|
||||
box = new int[2][3];
|
||||
order = new long[32];
|
||||
//order = new long[32];
|
||||
colorMap = new HashMap()
|
||||
{{
|
||||
put(Direction.UP, new int[1]);
|
||||
@@ -165,11 +163,6 @@ public class Box
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < order.length; i++)
|
||||
{
|
||||
order[i] = 0;
|
||||
}
|
||||
|
||||
for (Direction direction : DIRECTIONS)
|
||||
{
|
||||
colorMap.get(direction)[0] = 0;
|
||||
@@ -190,16 +183,20 @@ public class Box
|
||||
|
||||
public void setUpCulling(int cullingDistance)
|
||||
{
|
||||
BlockPos playerPos = MinecraftWrapper.INSTANCE.getPlayer().blockPosition();
|
||||
Vector3d playerPos = MinecraftWrapper.INSTANCE.getPlayer().position();
|
||||
for (Direction direction : DIRECTIONS)
|
||||
{
|
||||
if(direction == Direction.DOWN)
|
||||
culling.get(direction)[0] = playerPos.get(direction.getAxis()) > getFacePos(direction) + cullingDistance;
|
||||
else if(direction == Direction.UP)
|
||||
culling.get(direction)[0] = playerPos.get(direction.getAxis()) < getFacePos(direction) - cullingDistance;
|
||||
else if(direction == Direction.WEST || direction == Direction.NORTH)
|
||||
else if(direction == Direction.WEST)
|
||||
culling.get(direction)[0] = -playerPos.get(direction.getAxis()) > getFacePos(direction) + cullingDistance;
|
||||
else if(direction == Direction.WEST || direction == Direction.NORTH)
|
||||
else if(direction == Direction.NORTH)
|
||||
culling.get(direction)[0] = -playerPos.get(direction.getAxis()) > getFacePos(direction) + cullingDistance;
|
||||
else if(direction == Direction.EAST)
|
||||
culling.get(direction)[0] = -playerPos.get(direction.getAxis()) < getFacePos(direction) - cullingDistance;
|
||||
else if(direction == Direction.SOUTH)
|
||||
culling.get(direction)[0] = -playerPos.get(direction.getAxis()) < getFacePos(direction) - cullingDistance;
|
||||
}
|
||||
}
|
||||
@@ -217,9 +214,9 @@ public class Box
|
||||
int maxY = getMaxY();
|
||||
for (Direction direction : ADJ_DIRECTIONS)
|
||||
{
|
||||
/*if(isCulled(direction)){
|
||||
continue;
|
||||
}*/
|
||||
//if(isCulled(direction)){
|
||||
// continue;
|
||||
//}
|
||||
|
||||
long[] dataPoint = adjData.get(direction);
|
||||
if (dataPoint == null || DataPointUtil.isItVoid(dataPoint[0]))
|
||||
@@ -233,6 +230,7 @@ public class Box
|
||||
|
||||
//We order the adj list
|
||||
/**TODO remove this if the order is maintained naturally*/
|
||||
/*
|
||||
order[0] = 0;
|
||||
for (int i = 0; i < dataPoint.length; i++)
|
||||
{
|
||||
@@ -242,7 +240,7 @@ public class Box
|
||||
j = j - 1;
|
||||
}
|
||||
order[j + 1] = dataPoint[i];
|
||||
}
|
||||
}*/
|
||||
|
||||
int i;
|
||||
int faceToDraw = 0;
|
||||
@@ -250,7 +248,7 @@ public class Box
|
||||
boolean toFinish = false;
|
||||
for (i = dataPoint.length - 1; i >= 0; i--)
|
||||
{
|
||||
long singleDataPoint = order[i];
|
||||
long singleDataPoint = dataPoint[i];
|
||||
height = DataPointUtil.getHeight(singleDataPoint);
|
||||
depth = DataPointUtil.getDepth(singleDataPoint);
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ public class CubicLodTemplate extends AbstractLodTemplate
|
||||
{
|
||||
for(Direction direction : Box.DIRECTIONS)
|
||||
{
|
||||
if(box.isCulled(direction))
|
||||
continue;
|
||||
//if(box.isCulled(direction))
|
||||
// continue;
|
||||
int adjIndex = 0;
|
||||
while(box.shouldContinue(direction, adjIndex))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user