Reformat & add .editorconfig

This commit is contained in:
dfsek
2020-11-06 15:21:42 -07:00
parent bfa55fdb5d
commit 4f40550465
33 changed files with 527 additions and 280 deletions

View File

@@ -27,6 +27,11 @@ public class Vector2 implements Cloneable {
return x;
}
public Vector2 setX(double x) {
this.x = x;
return this;
}
/**
* Get Z component
*
@@ -36,6 +41,11 @@ public class Vector2 implements Cloneable {
return z;
}
public Vector2 setZ(double z) {
this.z = z;
return this;
}
/**
* Multiply X and Z components by a value.
*
@@ -164,14 +174,4 @@ public class Vector2 implements Cloneable {
throw new Error(e);
}
}
public Vector2 setX(double x) {
this.x = x;
return this;
}
public Vector2 setZ(double z) {
this.z = z;
return this;
}
}

View File

@@ -6,13 +6,12 @@ import java.util.HashSet;
import java.util.Set;
public class Rectangle extends Polygon {
private Vector2 min;
private Vector2 max;
private final Vector2 min;
private final Vector2 max;
public Rectangle(Vector2 min, Vector2 max) {
this.max = new Vector2(Math.min(min.getX(), max.getX()), Math.min(min.getZ(), max.getZ()));
this.min = new Vector2(Math.max(min.getX(), max.getX()), Math.max(min.getZ(), max.getZ()));
;
}
public Rectangle(Vector2 center, double xRadius, double zRadius) {

View File

@@ -8,6 +8,11 @@ import java.util.List;
public abstract class VoxelGeometry {
public List<Vector> geometry = new ArrayList<>();
public static VoxelGeometry getBlank() {
return new VoxelGeometry() {
};
}
public List<Vector> getGeometry() {
return geometry;
}
@@ -19,9 +24,4 @@ public abstract class VoxelGeometry {
public void merge(VoxelGeometry other) {
geometry.addAll(other.geometry);
}
public static VoxelGeometry getBlank() {
return new VoxelGeometry() {
};
}
}