From 9b640643a01ad9835f1baf4ca37cd25c558dfb6f Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 7 Oct 2020 19:50:28 +0200 Subject: Add getters for translating relative coordinates to world --- .../alignment/enumerable/ExtendedFacing.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java index 2a93bcc540..5949b432df 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java +++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java @@ -128,6 +128,7 @@ public enum ExtendedFacing { private static final Map NAME_LOOKUP = stream(VALUES).collect(toMap(ExtendedFacing::getName2, (extendedFacing) -> extendedFacing)); private final ForgeDirection direction; + private final ForgeDirection a,b,c; private final Rotation rotation; private final Flip flip; @@ -206,6 +207,9 @@ public enum ExtendedFacing { default: throw new RuntimeException("More impossible..."); } + this.a=a; + this.b=b; + this.c=c; integerAxisSwap =new IntegerAxisSwap(a,b,c); } @@ -327,4 +331,28 @@ public enum ExtendedFacing { public IntegerAxisSwap getIntegerAxisSwap() { return integerAxisSwap; } + + public ForgeDirection getRelativeLeftInWorld() { + return a; + } + + public ForgeDirection getRelativeRightInWorld() { + return a.getOpposite(); + } + + public ForgeDirection getRelativeDownInWorld() { + return b; + } + + public ForgeDirection getRelativeUpInWorld() { + return b.getOpposite(); + } + + public ForgeDirection getRelativeBackInWorld() { + return c; + } + + public ForgeDirection getRelativeForwardInWorld() { + return c.getOpposite(); + } } -- cgit