Attempt to improve mesher just a small ammount
This commit is contained in:
@@ -98,7 +98,8 @@ public class DistanceTracker {
|
|||||||
for (int y = this.minYSection >> capRing; y <= this.maxYSection >> capRing; y++) {
|
for (int y = this.minYSection >> capRing; y <= this.maxYSection >> capRing; y++) {
|
||||||
this.tracker.removeCache(capRing, x, y, z);
|
this.tracker.removeCache(capRing, x, y, z);
|
||||||
}
|
}
|
||||||
});*/
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTerminatingRing) {
|
if (isTerminatingRing) {
|
||||||
|
|||||||
@@ -11,30 +11,25 @@ public class QuadEncoder {
|
|||||||
if (Mesher2D.getW(encodedMeshedData) > 16 || Mesher2D.getH(encodedMeshedData) > 16) {
|
if (Mesher2D.getW(encodedMeshedData) > 16 || Mesher2D.getH(encodedMeshedData) > 16) {
|
||||||
throw new IllegalStateException("Width or height > 16");
|
throw new IllegalStateException("Width or height > 16");
|
||||||
}
|
}
|
||||||
int out = face;
|
int dat = face;
|
||||||
out |= switch (face >> 1) {
|
dat |= ((Mesher2D.getW(encodedMeshedData) - 1) << 7) |
|
||||||
case 0 ->
|
((Mesher2D.getH(encodedMeshedData) - 1) << 3);
|
||||||
|
|
||||||
|
if (face>>1 == 0) {
|
||||||
|
return dat |
|
||||||
(Mesher2D.getX(encodedMeshedData) << 21) |
|
(Mesher2D.getX(encodedMeshedData) << 21) |
|
||||||
(otherAxis << 16) |
|
(otherAxis << 16) |
|
||||||
(Mesher2D.getZ(encodedMeshedData) << 11) |
|
(Mesher2D.getZ(encodedMeshedData) << 11);
|
||||||
((Mesher2D.getW(encodedMeshedData)-1) << 7) |
|
}
|
||||||
((Mesher2D.getH(encodedMeshedData)-1) << 3);
|
if (face>>1 == 1) {
|
||||||
|
return dat |
|
||||||
case 1 ->
|
|
||||||
(Mesher2D.getX(encodedMeshedData) << 21) |
|
(Mesher2D.getX(encodedMeshedData) << 21) |
|
||||||
(Mesher2D.getZ(encodedMeshedData) << 16) |
|
(Mesher2D.getZ(encodedMeshedData) << 16) |
|
||||||
(otherAxis << 11) |
|
(otherAxis << 11);
|
||||||
((Mesher2D.getW(encodedMeshedData)-1) << 7) |
|
}
|
||||||
((Mesher2D.getH(encodedMeshedData)-1) << 3);
|
return dat |
|
||||||
|
|
||||||
case 2 ->
|
|
||||||
(otherAxis << 21) |
|
(otherAxis << 21) |
|
||||||
(Mesher2D.getX(encodedMeshedData) << 16) |
|
(Mesher2D.getX(encodedMeshedData) << 16) |
|
||||||
(Mesher2D.getZ(encodedMeshedData) << 11) |
|
(Mesher2D.getZ(encodedMeshedData) << 11);
|
||||||
((Mesher2D.getW(encodedMeshedData)-1) << 7) |
|
|
||||||
((Mesher2D.getH(encodedMeshedData)-1) << 3);
|
|
||||||
default -> throw new IllegalStateException("Unexpected value: " + (face >> 1));
|
|
||||||
};
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import java.util.Random;
|
|||||||
|
|
||||||
//TODO: redo this so that it works as you are inserting data into it maybe? since it should be much faster??
|
//TODO: redo this so that it works as you are inserting data into it maybe? since it should be much faster??
|
||||||
|
|
||||||
public class Mesher2D {
|
public final class Mesher2D {
|
||||||
private final int size;
|
private final int size;
|
||||||
private final int maxSize;
|
private final int maxSize;
|
||||||
private final long[] data;
|
private final long[] data;
|
||||||
|
|||||||
Reference in New Issue
Block a user