commit c187cb6910131060b9fa9acc34fc1a7fb3fae141
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Dec 24 21:50:32 2021 +0100

    Initial commit

diff --git a/src/main/java/org/distorted/objectlib/helpers/ObjectShape.java b/src/main/java/org/distorted/objectlib/helpers/ObjectShape.java
index a279236c..7443297f 100644
--- a/src/main/java/org/distorted/objectlib/helpers/ObjectShape.java
+++ b/src/main/java/org/distorted/objectlib/helpers/ObjectShape.java
@@ -34,6 +34,7 @@ public class ObjectShape
   private final int[] mCenterIndices;
   private final int mNumComponents;
   private final float[] mConvexityCenter;
+  private final int mNumOutsideFaces;
 
   private float[][] mBands;
 
@@ -41,7 +42,7 @@ public class ObjectShape
 
   public ObjectShape(float[][] vertices, int[][] vertIndices, float[][] bands, int[] bandIndices,
                      float[][] corners, int[] cornIndices, float[][] centers, int[] centIndices,
-                     int numComponents, float[] convexityCenter)
+                     int numComponents, float[] convexityCenter, int numOutside)
     {
     mVertices        = vertices;
     mVertIndices     = vertIndices;
@@ -53,6 +54,7 @@ public class ObjectShape
     mCenterIndices   = centIndices;
     mNumComponents   = numComponents;
     mConvexityCenter = convexityCenter;
+    mNumOutsideFaces = numOutside;
 
     if( ObjectControl.isInIconMode() )
       {
@@ -138,4 +140,11 @@ public class ObjectShape
     {
     return mConvexityCenter;
     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getNumOutside()
+    {
+    return mNumOutsideFaces;
+    }
   }
diff --git a/src/main/java/org/distorted/objectlib/json/JsonReader.java b/src/main/java/org/distorted/objectlib/json/JsonReader.java
index 754d2047..465672ac 100644
--- a/src/main/java/org/distorted/objectlib/json/JsonReader.java
+++ b/src/main/java/org/distorted/objectlib/json/JsonReader.java
@@ -25,7 +25,6 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 
-import org.distorted.objectlib.touchcontrol.TouchControl;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java b/src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java
index 5eb26510..1ebe8526 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java
@@ -207,7 +207,7 @@ abstract class TwistyBandagedAbstract extends ShapeHexahedron
         {-0.5f*(X-1),-0.5f*(Y-1),-0.5f*(Z-1)}
       };
 
-    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 6);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java b/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
index e911f657..d072330b 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
@@ -266,7 +266,7 @@ public class TwistyCuboid extends ShapeHexahedron
     else if( variant==1 ) bandIndices = new int[] {1,1,1,0,1,0};
     else                  bandIndices = new int[] {2,2,2,2,0,2};
 
-    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
+    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null, 1);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java b/src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java
index 415f6927..bc38cea8 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java
@@ -415,7 +415,7 @@ public class TwistyDiamond extends ShapeOctahedron
       int[] cornerIndices = new int[] { 0,0,0,0,0,0 };
       float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { 0,0,0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     else
       {
@@ -427,7 +427,7 @@ public class TwistyDiamond extends ShapeOctahedron
       int[] cornerIndices = new int[] { 0,0,0,0 };
       float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { 0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyDino.java b/src/main/java/org/distorted/objectlib/objects/TwistyDino.java
index a56d0377..b4106224 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyDino.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyDino.java
@@ -202,7 +202,7 @@ abstract class TwistyDino extends ShapeHexahedron
     int[] cornerIndices = new int[] { 0,0,1,1 };
     float[][] centers   = new float[][] { {0.0f, -0.75f, -0.75f} };
     int[] centerIndices = new int[] { 0,0,0,0 };
-    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java b/src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java
index 26d752bf..5f7ca63e 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java
@@ -314,7 +314,7 @@ public class TwistyHelicopter extends ShapeHexahedron
       int[] cornerIndices = new int[] { 0,0,0,0,0 };
       float[][] centers   = new float[][] { {-0.75f, -0.75f, -0.75f} };
       int[] centerIndices = new int[] { 0,0,0,-1,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else
       {
@@ -340,7 +340,7 @@ public class TwistyHelicopter extends ShapeHexahedron
       int[] cornerIndices = new int[] { 0,0,0,-1 };
       float[][] centers   = new float[][] { {-0.25f, -0.25f, -0.75f} };
       int[] centerIndices = new int[] { 0,0,0,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyIvy.java b/src/main/java/org/distorted/objectlib/objects/TwistyIvy.java
index 51d99d44..a021cb47 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyIvy.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyIvy.java
@@ -336,7 +336,7 @@ public class TwistyIvy extends ShapeHexahedron
 
       float C = 1-SQ2/2;
       float[] convexCenter = new float[] {-C,-C,-C};
-      return new ObjectShape(vertices,vertIndices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), convexCenter);
+      return new ObjectShape(vertices,vertIndices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), convexCenter, 3);
       }
     else
       {
@@ -381,7 +381,7 @@ public class TwistyIvy extends ShapeHexahedron
           {-0.10f,45,0.5f,0.0f,2,0,0}
         };
 
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indexes,centers,indexes,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indexes,centers,indexes,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyJing.java b/src/main/java/org/distorted/objectlib/objects/TwistyJing.java
index 65b179d7..fb3099f2 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyJing.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyJing.java
@@ -276,7 +276,7 @@ public class TwistyJing extends ShapeTetrahedron
       int[] cornerIndices = new int[] { 0,1,1,-1,1,-1,-1,-1 };
       float[][] centers   = new float[][] { { 0.0f, Y, Z-F/2} };
       int[] centerIndices = new int[] { 0,0,0,-1,0,-1,-1,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else if( variant==1 )
       {
@@ -307,7 +307,7 @@ public class TwistyJing extends ShapeTetrahedron
       int[] cornerIndices = new int[] { 0,0,-1,0,0,0,-1,0 };
       float[][] centers   = new float[][] { { 0, F*SQ2/2, 0 } };
       int[] centerIndices = new int[] { 0,0,-1,0,0,0,-1,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     else
       {
@@ -335,7 +335,7 @@ public class TwistyJing extends ShapeTetrahedron
       int[] cornerIndices = new int[] { 0,0,0,-1,-1,-1 };
       float[][] centers   = new float[][] { { 0, -2*Y/3, 4*Z/3 } };
       int[] centerIndices = new int[] { 0,0,0,-1,-1,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java b/src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java
index 43fe22b7..4714d867 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java
@@ -360,7 +360,7 @@ public class TwistyKilominx extends TwistyMinx
       float[][] centers   = new float[][] { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
       int[] centerIndices = new int[] { 0,-1,-1,-1,-1,-1,-1,-1 };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     if( variant<numVariants-1 )
       {
@@ -429,7 +429,7 @@ public class TwistyKilominx extends TwistyMinx
       float[][] centers   = new float[][] { {0.0f, -width/2, (float)(-2*Z)} };
       int[] centerIndices = new int[] { 0,-1,-1,-1, 0,-1,-1,-1 };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     else
       {
@@ -482,7 +482,7 @@ public class TwistyKilominx extends TwistyMinx
       float[][] centers   = new float[][] { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
       int[] centerIndices = new int[] { 0, 0,-1, 0, 0,-1,-1,-1 };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java b/src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java
index 835def86..4852d9bb 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java
@@ -302,7 +302,7 @@ public class TwistyMegaminx extends TwistyMinx
       float[][] centers   = new float[][] { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
       int[] centerIndices = new int[] { 0,-1,-1,-1,-1,-1,-1,-1 };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     if( variant<numVariants-1 )
       {
@@ -350,7 +350,7 @@ public class TwistyMegaminx extends TwistyMinx
       float[][] centers   = new float[][] { {0.0f, 0.0f, (float)(-2*Z)} };
       int[] centerIndices = new int[] { -1,-1,-1,-1, -1,-1,-1,-1 };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     else
       {
@@ -400,7 +400,7 @@ public class TwistyMegaminx extends TwistyMinx
       float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { -1,-1,-1,-1, -1,-1 };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java b/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
index 73514980..56942b03 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
@@ -470,7 +470,7 @@ public class TwistyMirror extends ShapeHexahedron
     float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
     int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
 
-    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 6);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyPyraminx.java b/src/main/java/org/distorted/objectlib/objects/TwistyPyraminx.java
index 7284514a..dd6d4a4b 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyPyraminx.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyPyraminx.java
@@ -347,7 +347,7 @@ public class TwistyPyraminx extends ShapeTetrahedron
       int[] cornerIndices = new int[] { 0,0,0,0,0,0 };
       float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { 0,0,0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     else
       {
@@ -361,7 +361,7 @@ public class TwistyPyraminx extends ShapeTetrahedron
       int[] cornerIndices = new int[] { 0,0,0,0 };
       float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { 0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyRedi.java b/src/main/java/org/distorted/objectlib/objects/TwistyRedi.java
index fd84b327..7eb84bca 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyRedi.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyRedi.java
@@ -283,7 +283,7 @@ public class TwistyRedi extends ShapeHexahedron
       int[] cornerIndices = new int[]  { -1,0,-1,0,0,0,-1,-1 };
       float[][] centers   = new float[][] { { 0.0f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { -1,0,-1,0,0,0,-1,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else
       {
@@ -315,7 +315,7 @@ public class TwistyRedi extends ShapeHexahedron
       int[] cornerIndices = new int[] { 0,0,-1,-1,-1,-1,-1,-1 };
       float[][] centers   = new float[][] { { 0.0f,-0.75f,-0.75f} };
       int[] centerIndices = new int[] { 0,0,-1,-1,-1,-1,-1,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyRex.java b/src/main/java/org/distorted/objectlib/objects/TwistyRex.java
index 09f6ffd7..180e3ea3 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyRex.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyRex.java
@@ -275,7 +275,7 @@ public class TwistyRex extends ShapeHexahedron
       int[] bandIndices= new int[] { 0,1,1,1,1 };
       float[][] bands = { {+0.016f,10,G/3,0.5f,5,1,1},{ +0.0f,45,0.1f,0.1f,2,0,0} };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null, 1);
       }
     else if( variant==1 )
       {
@@ -286,7 +286,7 @@ public class TwistyRex extends ShapeHexahedron
       int[] bandIndices= new int[] { 0,1,1,1,1 };
       float[][] bands = { {0.025f,10,G/2,0.5f,5,0,0},{0.000f,45,G/2,0.0f,2,0,0} };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,null,indices,null,indices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,null,indices,null,indices,getNumCubitFaces(), null, 1);
       }
     else
       {
@@ -301,7 +301,7 @@ public class TwistyRex extends ShapeHexahedron
       int[] bandIndices= new int[] { 0,0,1,1 };
       float[][] bands = { {0.03f,27,F/3,0.8f,5,2,3},{0.01f,45,G/3,0.2f,3,1,2} };
 
-      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null, 2);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistySkewb.java b/src/main/java/org/distorted/objectlib/objects/TwistySkewb.java
index 4714d06a..4914b503 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistySkewb.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistySkewb.java
@@ -433,7 +433,7 @@ public class TwistySkewb extends ShapeHexahedron
       int[] cornerIndices = new int[] { 1,1,1,0,0 };
       float[][] centers   = new float[][] { {-0.5f, -0.5f, -0.5f} };
       int[] centerIndices = new int[] { 0,0,0,-1,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else if( variant==1 )
       {
@@ -447,7 +447,7 @@ public class TwistySkewb extends ShapeHexahedron
       int[] cornerIndices = new int[] { 0,0,1,1 };
       float[][] centers   = new float[][] { {0.0f, -0.5f, -0.5f} };
       int[] centerIndices = new int[] { 0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     else
       {
@@ -461,7 +461,7 @@ public class TwistySkewb extends ShapeHexahedron
       int[] cornerIndices = new int[] { 0,0,0,0,0 };
       float[][] centers   = new float[][] { {0,0,-0.4f} };
       int[] centerIndices = new int[] { 0,0,0,0,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistySquare1.java b/src/main/java/org/distorted/objectlib/objects/TwistySquare1.java
index 268db0a1..8083c732 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistySquare1.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistySquare1.java
@@ -108,7 +108,7 @@ public class TwistySquare1 extends TwistySquare
       float[][] centers   = new float[][] { { -0.75f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
 
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else if( variant==1 )
       {
@@ -125,8 +125,8 @@ public class TwistySquare1 extends TwistySquare
       int[][] vert_indices = new int[][]
         {
          {0,1,2},
-         {3,4,5},
          {3,4,1,0},
+         {3,4,5},
          {4,5,2,1},
          {5,3,0,2}
         };
@@ -138,7 +138,7 @@ public class TwistySquare1 extends TwistySquare
       float[][] centers   = new float[][] { { 0.0f, 0.0f,-0.5f} };
       int[] centerIndices = new int[] { 0,0,-1,0,0,-1 };
 
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     else
       {
@@ -170,7 +170,7 @@ public class TwistySquare1 extends TwistySquare
       float[][] centers   = new float[][] { { -0.5f, 0.0f,-0.5f} };
       int[] centerIndices = new int[] { -1,0,-1,-1,-1,0,-1,-1 };
 
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistySquare2.java b/src/main/java/org/distorted/objectlib/objects/TwistySquare2.java
index d5eac819..a5350dd2 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistySquare2.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistySquare2.java
@@ -116,7 +116,7 @@ public class TwistySquare2 extends TwistySquare
       int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0 };
       float[][] centers   = new float[][] { { -0.75f, 0.0f, 0.0f} };
       int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else if( variant==1 )
       {
@@ -133,8 +133,8 @@ public class TwistySquare2 extends TwistySquare
       int[][] vert_indices = new int[][]
         {
          {0,1,2},
-         {3,4,5},
          {3,4,1,0},
+         {3,4,5},
          {4,5,2,1},
          {5,3,0,2}
         };
@@ -145,7 +145,7 @@ public class TwistySquare2 extends TwistySquare
       int[] cornerIndices = new int[] { 0,0,-1,0,0,-1 };
       float[][] centers   = new float[][] { { 0.0f, 0.0f,-0.5f} };
       int[] centerIndices = new int[] { 0,0,-1,0,0,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     else
       {
@@ -161,8 +161,8 @@ public class TwistySquare2 extends TwistySquare
       int[][] vert_indices = new int[][]
         {
          {0,1,2},
-         {5,4,3},
          {3,4,1,0},
+         {5,4,3},
          {4,5,2,1},
          {5,3,0,2}
         };
@@ -173,7 +173,7 @@ public class TwistySquare2 extends TwistySquare
       int[] cornerIndices = new int[] { 0,0,-1,0,0,-1 };
       float[][] centers   = new float[][] { { 0.0f, 0.0f,-0.5f} };
       int[] centerIndices = new int[] { 0,0,-1,0,0,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
       }
     }
 
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java b/src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java
index 288568c8..b1d75245 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java
@@ -112,23 +112,23 @@ public class TwistyTrajber extends ShapeOctahedron
     {
     mQuats = new Static4D[]
          {
-         new Static4D(  0.0f,   0.0f,   0.0f,   1.0f),  // 0  nothing                 // OK
-         new Static4D( SQ2/2,   0.0f,  SQ2/2,   0.0f),  // 1  ( 1, 0,-1) 180          // OK
-         new Static4D(  0.0f,   1.0f,   0.0f,   0.0f),  // 2  ( 0, 1, 0) 180          // OK
-         new Static4D( SQ2/2,   0.0f, -SQ2/2,   0.0f),  // 3  ( 1, 0, 1) 180          // OK
+         new Static4D(  0.0f,   0.0f,   0.0f,   1.0f),  // 0  nothing
+         new Static4D( SQ2/2,   0.0f,  SQ2/2,   0.0f),  // 1  ( 1, 0,-1) 180
+         new Static4D(  0.0f,   1.0f,   0.0f,   0.0f),  // 2  ( 0, 1, 0) 180
+         new Static4D( SQ2/2,   0.0f, -SQ2/2,   0.0f),  // 3  ( 1, 0, 1) 180
 
          new Static4D(  0.5f,  SQ2/2,  -0.5f,   0.0f),  // 4 (0.5,SQ2/2,0.5) 180
          new Static4D(  0.5f, -SQ2/2,  -0.5f,   0.0f),  // 5 (0.5,-SQ2/2,-0.5) 180
          new Static4D(  1.0f,   0.0f,   0.0f,   0.0f),  // 6 (1,0,0) 180
          new Static4D(  0.0f,   0.0f,   1.0f,   0.0f),  // 7 (0,0,1) 180
-         new Static4D(  0.5f,   0.0f,   0.5f,  SQ2/2),  // 8  ( 1, 0, 1) +-90         // OK
-         new Static4D(  0.5f,   0.0f,   0.5f, -SQ2/2),  // 9  ( 1, 0, 1) -+90         // OK
+         new Static4D(  0.5f,   0.0f,   0.5f,  SQ2/2),  // 8  ( 1, 0, 1) +-90
+         new Static4D(  0.5f,   0.0f,   0.5f, -SQ2/2),  // 9  ( 1, 0, 1) -+90
          new Static4D(  0.5f,  SQ2/2,   0.5f,   0.0f),  // 10 (-0.5,-SQ2/2,-0.5) 180
          new Static4D(  0.5f, -SQ2/2,   0.5f,   0.0f),  // 11 (0.5,-SQ2/2,0.5) 180
-         new Static4D(  0.0f,  SQ2/2,   0.0f,  SQ2/2),  // 12  ( 0, 1, 0) +-90        // OK
-         new Static4D(  0.0f,  SQ2/2,   0.0f, -SQ2/2),  // 13  ( 0, 1, 0) -+90        // OK
-         new Static4D(  0.5f,   0.0f,  -0.5f, -SQ2/2),  // 15  ( 1, 0,-1) -+90        // OK
-         new Static4D(  0.5f,   0.0f,  -0.5f,  SQ2/2),  // 14  ( 1, 0,-1) +-90        // OK
+         new Static4D(  0.0f,  SQ2/2,   0.0f,  SQ2/2),  // 12  ( 0, 1, 0) +-90
+         new Static4D(  0.0f,  SQ2/2,   0.0f, -SQ2/2),  // 13  ( 0, 1, 0) -+90
+         new Static4D(  0.5f,   0.0f,  -0.5f, -SQ2/2),  // 15  ( 1, 0,-1) -+90
+         new Static4D(  0.5f,   0.0f,  -0.5f,  SQ2/2),  // 14  ( 1, 0,-1) +-90
 
          new Static4D( SQ2/2,   0.5f,   0.0f,   0.5f),  // 16 (+,+,0) +
          new Static4D(  0.0f,  -0.5f,  SQ2/2,  -0.5f),  // 17 (0,-,+) -
@@ -328,7 +328,7 @@ public class TwistyTrajber extends ShapeOctahedron
       int[] cornerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 };
       float[][] centers   = new float[][] { { LEN/2, 0.0f, -LEN/2} };
       int[] centerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,4);
       }
     if( variant==1 )
       {
@@ -364,7 +364,7 @@ public class TwistyTrajber extends ShapeOctahedron
       int[] cornerIndices = new int[] { 0,0,0,0,0,0,-1,-1 };
       float[][] centers   = new float[][] { { 0, 0, -B} };
       int[] centerIndices = new int[] { 0,0,0,0,0,0,-1,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,2);
       }
     else
       {
@@ -392,7 +392,7 @@ public class TwistyTrajber extends ShapeOctahedron
       int[] cornerIndices = new int[] { 0,0,0,-1 };
       float[][] centers   = new float[][] { {0, -(SQ2/3)*L,-2*L/3} };
       int[] centerIndices = new int[] { 0,0,0,-1 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,1);
       }
     }
 
@@ -438,7 +438,7 @@ public class TwistyTrajber extends ShapeOctahedron
 
     if( mEdgeColorMap==null)
       {
-      mEdgeColorMap = new int[][] { {3,0},{1,2},{4,7},{6,5},  {0,4},{5,1},{7,3},{2,6}, {1,0},{4,5},{3,2},{6,7} };
+      mEdgeColorMap = new int[][] { {3,0},{1,2},{4,7},{6,5}, {0,4},{5,1},{7,3},{2,6}, {1,0},{4,5},{3,2},{6,7} };
       }
 
     if( mCornerColorMap==null)
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java b/src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java
index f85b8902..a730c856 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java
@@ -151,7 +151,7 @@ public class TwistyUltimate extends ShapeDodecahedron
       int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 };
       float[][] centers   = new float[][] { { 0.0f,-1.0f, -(SQ5+3)/2 } };
       int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else if( variant==1 )
       {
@@ -182,7 +182,7 @@ public class TwistyUltimate extends ShapeDodecahedron
       int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 };
       float[][] centers   = new float[][] { { 0.0f,-1.0f, -(SQ5+3)/2 } };
       int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
       }
     else
       {
@@ -218,7 +218,7 @@ public class TwistyUltimate extends ShapeDodecahedron
       int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,-1 };
       float[][] centers   = new float[][] { { -(SQ5+1)/4, 0.5f, -(SQ5+5)/4 } };
       int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,0 };
-      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
+      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 4);
       }
     }
 
