Added a few more set methods to (Block/Cuboid)Coord

This commit is contained in:
Chicken-Bomes committed 2013-12-18 12:25:04 +10:00
1 parent 9e6ac47eba
commit 16d43f287d
2 files changed
+26 -3

No files matched your search

+6 -1
View File
@@ -71,7 +71,7 @@ public class BlockCoord implements Comparable<BlockCoord>
return this;
}
public double mag_()
public double mag()
{
return Math.sqrt(x*x+y*y+z*z);
}
@@ -177,6 +177,11 @@ public class BlockCoord implements Comparable<BlockCoord>
{
return set(coord.x, coord.y, coord.z);
}
public BlockCoord set(int[] ia)
{
return set(ia[0], ia[1], ia[2]);
}
public int toSide()
{
+20 -2
View File
@@ -107,7 +107,25 @@ public class CuboidCoord
public void set(BlockCoord min, BlockCoord max)
{
this.min = min;
this.max = max;
this.min.set(min);
this.max.set(max);
}
public CuboidCoord set(int x1, int y1, int z1, int x2, int y2, int z2)
{
min.set(x1, y1, z1);
max.set(x2, y2, z2);
return this;
}
public CuboidCoord set(BlockCoord coord) {
min.set(coord);
max.set(coord);
return this;
}
public CuboidCoord set(int[] ia)
{
return set(ia[0], ia[1], ia[2], ia[3], ia[4], ia[5]);
}
}