add zero and unit vectors

This commit is contained in:
Zoë Gidiere
2023-10-26 11:08:36 -06:00
parent 6f08908bb4
commit 5d12a560f1
3 changed files with 7 additions and 7 deletions

View File

@@ -14,8 +14,9 @@ import com.dfsek.terra.api.util.MathUtil;
* oh yeah
*/
public class Vector2 {
protected double x;
protected double z;
private static final Vector2 ZERO = new Vector2(0, 0);
private static final Vector2 UNIT = new Vector2(0, 1);
protected double x, z;
/**
* Create a vector with a given X and Z component

View File

@@ -9,8 +9,7 @@ import com.dfsek.terra.api.util.Rotation;
public class Vector2Int {
private static final Vector2Int ZERO = new Vector2Int(0, 0);
private static final Vector2Int UNIT = new Vector2Int(0, 1);
protected int x;
protected int z;
protected int x, z;
protected Vector2Int(int x, int z) {
this.x = x;

View File

@@ -13,9 +13,9 @@ import com.dfsek.terra.api.util.MathUtil;
public class Vector3 {
protected double x;
protected double y;
protected double z;
private static final Vector3 ZERO = new Vector3(0, 0, 0);
private static final Vector3 UNIT = new Vector3(0, 1, 0);
protected double x, y, z;
private Vector3(double x, double y, double z) {
this.x = x;