commit cc448c5440495a6286a4c01f94d60412aa201674
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Sep 30 23:30:39 2021 +0200

    improvements to the Mirror Cube.

diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java b/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
index 8f5b1a4a..c71ce90e 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
@@ -59,6 +59,22 @@ public class TwistyMirror extends Twisty6
   private static final float DY = 0.25f;
   private static final float DZ = 0.40f;
 
+  private static final float[][] SEQ2 = new float[][]
+      {
+          {1-DX,1-DY},{1+DX,1-DY},{1-DX,1+DY},{1+DX,1+DY},
+          {1-DX,1-DZ},{1+DX,1-DZ},{1-DX,1+DZ},{1+DX,1+DZ},
+          {1-DZ,1-DY},{1+DZ,1-DY},{1-DZ,1+DY},{1+DZ,1+DY},
+      };
+
+  private static final float[][] SEQ3 = new float[][]
+      {
+          {1   ,1   },{1-DX,1-DY},{1   ,1-DY},{1+DX,1-DY},{1-DX,1   },
+          {1+DX,1   },{1-DX,1+DY},{1   ,1+DY},{1+DX,1+DY},{1-DX,1-DZ},
+          {1   ,1-DZ},{1+DX,1-DZ},{1-DX,1   },{1+DX,1   },{1-DX,1+DZ},
+          {1   ,1+DZ},{1+DX,1+DZ},{1-DZ,1-DY},{1   ,1-DY},{1+DZ,1-DY},
+          {1-DZ,1   },{1+DZ,1   },{1-DZ,1+DY},{1   ,1+DY},{1+DZ,1+DY},
+      };
+
   private ScrambleState[] mStates;
   private Static4D[] mQuats;
   private float[][] mCuts;
@@ -311,61 +327,20 @@ public class TwistyMirror extends Twisty6
   private float[] generateStrokes()
     {
     int num = getNumLayers();
-    final float A = 0.08f;
 
     if( num==2 )
       {
-      return new float[] {
-                           returnStroke(1-DX,1-DY),
-                           returnStroke(1+DX,1-DY),
-                           returnStroke(1-DX,1+DY),
-                           returnStroke(1+DX,1+DY),
-                           returnStroke(1-DX,1-DZ),
-                           returnStroke(1+DX,1-DZ),
-                           returnStroke(1-DX,1+DZ),
-                           returnStroke(1+DX,1+DZ),
-                           returnStroke(1-DZ,1-DY),
-                           returnStroke(1+DZ,1-DY),
-                           returnStroke(1-DZ,1+DY),
-                           returnStroke(1+DZ,1+DY),
-
-                           A/(1-DX), A/(1+DX), A/(1+DY), A/(1+DY),
-                           A/(1-DX), A/(1+DX), A/(1+DZ), A/(1+DZ),
-                           A/(1-DY), A/(1+DY), A/(1+DZ), A/(1+DZ),
-                         };
+      int LEN = SEQ2.length;
+      float[] tmp = new float[LEN];
+      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ2[i][0],SEQ2[i][1]);
+      return tmp;
       }
     else
       {
-      return new float[] {
-                           returnStroke(1   ,1   ),
-
-                           returnStroke(1-DX,1-DY),
-                           returnStroke(1   ,1-DY),
-                           returnStroke(1+DX,1-DY),
-                           returnStroke(1-DX,1   ),
-                           returnStroke(1+DX,1   ),
-                           returnStroke(1-DX,1+DY),
-                           returnStroke(1   ,1+DY),
-                           returnStroke(1+DX,1+DY),
-
-                           returnStroke(1-DX,1-DZ),
-                           returnStroke(1   ,1-DZ),
-                           returnStroke(1+DX,1-DZ),
-                           returnStroke(1-DX,1   ),
-                           returnStroke(1+DX,1   ),
-                           returnStroke(1-DX,1+DZ),
-                           returnStroke(1   ,1+DZ),
-                           returnStroke(1+DX,1+DZ),
-
-                           returnStroke(1-DZ,1-DY),
-                           returnStroke(1   ,1-DY),
-                           returnStroke(1+DZ,1-DY),
-                           returnStroke(1-DZ,1   ),
-                           returnStroke(1+DZ,1   ),
-                           returnStroke(1-DZ,1+DY),
-                           returnStroke(1   ,1+DY),
-                           returnStroke(1+DZ,1+DY),
-                         };
+      int LEN = SEQ3.length;
+      float[] tmp = new float[LEN];
+      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ3[i][0],SEQ3[i][1]);
+      return tmp;
       }
     }
 
@@ -387,55 +362,17 @@ public class TwistyMirror extends Twisty6
 
     if( num==2 )
       {
-      return new float[][]
-          {
-              returnSticker(1-DX,1-DY),
-              returnSticker(1+DX,1-DY),
-              returnSticker(1-DX,1+DY),
-              returnSticker(1+DX,1+DY),
-              returnSticker(1-DX,1-DZ),
-              returnSticker(1+DX,1-DZ),
-              returnSticker(1-DX,1+DZ),
-              returnSticker(1+DX,1+DZ),
-              returnSticker(1-DZ,1-DY),
-              returnSticker(1+DZ,1-DY),
-              returnSticker(1-DZ,1+DY),
-              returnSticker(1+DZ,1+DY),
-          };
+      int LEN = SEQ2.length;
+      float[][] tmp = new float[LEN][];
+      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ2[i][0],SEQ2[i][1]);
+      return tmp;
       }
     else
       {
-      return new float[][]
-          {
-              returnSticker(1   ,1   ),
-
-              returnSticker(1-DX,1-DY),
-              returnSticker(1   ,1-DY),
-              returnSticker(1+DX,1-DY),
-              returnSticker(1-DX,1   ),
-              returnSticker(1+DX,1   ),
-              returnSticker(1-DX,1+DY),
-              returnSticker(1   ,1+DY),
-              returnSticker(1+DX,1+DY),
-
-              returnSticker(1-DX,1-DZ),
-              returnSticker(1   ,1-DZ),
-              returnSticker(1+DX,1-DZ),
-              returnSticker(1-DX,1   ),
-              returnSticker(1+DX,1   ),
-              returnSticker(1-DX,1+DZ),
-              returnSticker(1   ,1+DZ),
-              returnSticker(1+DX,1+DZ),
-
-              returnSticker(1-DZ,1-DY),
-              returnSticker(1   ,1-DY),
-              returnSticker(1+DZ,1-DY),
-              returnSticker(1-DZ,1   ),
-              returnSticker(1+DZ,1   ),
-              returnSticker(1-DZ,1+DY),
-              returnSticker(1   ,1+DY),
-              returnSticker(1+DZ,1+DY),
-          };
+      int LEN = SEQ3.length;
+      float[][] tmp = new float[LEN][];
+      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ3[i][0],SEQ3[i][1]);
+      return tmp;
       }
     }
 
@@ -465,7 +402,7 @@ public class TwistyMirror extends Twisty6
 
   protected int getNumStickerTypes(int numLayers)
     {
-    return numLayers==2 ? 12 : 25;
+    return numLayers==2 ? SEQ2.length : SEQ3.length;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
