mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Math fixes
This commit is contained in:
parent
1726d6f59e
commit
e19ae7af59
@ -216,11 +216,11 @@ public class PregeneratorJob implements PregenListener {
|
||||
}
|
||||
|
||||
private Position2 getMax() {
|
||||
return task.getCenter().add(task.getRadius(), task.getRadius()).topLeftChunkOfRegion();
|
||||
return task.getCenter().add(task.getRadius(), task.getRadius()).regionToChunk();
|
||||
}
|
||||
|
||||
private Position2 getMin() {
|
||||
return task.getCenter().add(-task.getRadius(), -task.getRadius()).topLeftChunkOfRegion();
|
||||
return task.getCenter().add(-task.getRadius(), -task.getRadius()).regionToChunk();
|
||||
}
|
||||
|
||||
private boolean paused() {
|
||||
|
@ -57,24 +57,9 @@ public class Position2 {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Position2 topLeftChunkOfRegion()
|
||||
public Position2 regionToChunk()
|
||||
{
|
||||
return new Position2((x >> 5) << 5, (z >> 5) << 5);
|
||||
}
|
||||
|
||||
public Position2 bottomRightChunkOfRegion()
|
||||
{
|
||||
return new Position2((((x >> 5)+1) << 5) - 1, (((z >> 5)+1) << 5) - 1);
|
||||
}
|
||||
|
||||
public Position2 topRightChunkOfRegion()
|
||||
{
|
||||
return new Position2((((x >> 5)+1) << 5) - 1, (z >> 5) << 5);
|
||||
}
|
||||
|
||||
public Position2 bottomLeftChunkOfRegion()
|
||||
{
|
||||
return new Position2((x >> 5) << 5, (((z >> 5)+1) << 5) - 1);
|
||||
return new Position2(x << 5, z << 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user