feat(rendering): update Box
@@ -10,9 +10,6 @@ import org.joml.Vector3fc;
import org.joml.Vector4f;
import org.lwjgl.BufferUtils;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-
public class Box implements Renderable {
private Vector3fc from;
@@ -21,6 +18,16 @@ public class Box implements Renderable {
private VertexArrayObject mesh;
+ public Box(Vector3fc center, float size, Color color) {
+ this(center, size, size, size, color);
+ }
+
+ public Box(Vector3fc center, float xLength, float yLength, float zLength, Color color) {
+ this(new Vector3f(center).sub(xLength / 2, yLength / 2, zLength / 2),
+ new Vector3f(center).add(xLength / 2, yLength / 2, zLength / 2),
+ color);
+ }
+
public Box(Vector3fc from, Vector3fc to, Color color) {
this.from = from;
this.to = to;
