commit e29d5c29e6b7cb6eef76bcb358795a7e703f0247
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Feb 15 12:41:40 2022 +0100

    Axis Cube: finish implementation

diff --git a/src/main/java/org/distorted/objectlib/main/ObjectConstants.java b/src/main/java/org/distorted/objectlib/main/ObjectConstants.java
index 2ef3f6f6..bd1e8aa4 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectConstants.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectConstants.java
@@ -66,4 +66,5 @@ public class ObjectConstants
   public static final int WIND_3 = ObjectType.WIND_3.ordinal();
   public static final int FISH_3 = ObjectType.FISH_3.ordinal();
   public static final int CONT_2 = ObjectType.CONT_2.ordinal();
+  public static final int AXIS_3 = ObjectType.AXIS_3.ordinal();
   }
diff --git a/src/main/java/org/distorted/objectlib/main/ObjectType.java b/src/main/java/org/distorted/objectlib/main/ObjectType.java
index e6918c17..e7c27d17 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectType.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectType.java
@@ -74,7 +74,7 @@ public enum ObjectType
   MIRR_3 ( TwistyMirror.class        , new int[] {3,3,3}      , 17, R.drawable.mirr_3, true),
   MIRR_4 ( TwistyMirror.class        , new int[] {4,4,4}      , 24, R.drawable.mirr_4, false),  // first 'downloadable' object:" MIRR_4.
   FISH_3 ( TwistyFisher.class        , new int[] {3,3,3}      , 24, R.drawable.fish_3, false),  // Do not re-arrange the order here as to
-  AXIS_3 ( TwistyAxis.class          , new int[] {3,3,3}      , 24, R.drawable.fish_3, true ),  // mix the 'pre-MIRR_4' objects with the
+  AXIS_3 ( TwistyAxis.class          , new int[] {3,3,3}      , 24, R.drawable.axis_3, false),  // mix the 'pre-MIRR_4' objects with the
   CONT_2 ( TwistyContainer.class     , new int[] {2,2,2,2}    , 12, R.drawable.cont_2, false),  // 'post-MIRR_4' ones lest we screw up the
   MORP_2 ( TwistyMorphix.class       , new int[] {2,2,2}      , 12, R.drawable.morp_2, false),  // 'wasDownloadableButNowIsBuiltIn()' function.
   ;
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyAxis.java b/src/main/java/org/distorted/objectlib/objects/TwistyAxis.java
index 3c8dd0e1..15b1ba9a 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyAxis.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyAxis.java
@@ -63,7 +63,7 @@ public class TwistyAxis extends ShapeHexahedron
   @Override
   public int getInternalColor()
     {
-    return 0xff333333;
+    return 0xff222222;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -159,7 +159,6 @@ public class TwistyAxis extends ShapeHexahedron
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// TODO
 
   public float[][] getCubitPositions(int[] numLayers)
     {
@@ -167,7 +166,37 @@ public class TwistyAxis extends ShapeHexahedron
       {
       mCenters = new float[][]
          {
-             {0,0,0}
+             { 1.50f, 1.50f, 0.75f},
+             {-0.75f, 1.50f,-1.50f},
+             { 1.50f,-0.75f,-1.50f},
+             {-1.50f, 0.75f, 1.50f},
+             { 0.75f,-1.50f, 1.50f},
+             {-1.50f,-1.50f,-0.75f},
+
+             {0.375f, 1.50f,-0.375f},
+             {0.375f,0.375f,-1.50f },
+             { 1.50f,0.375f,-0.375f},
+             {-0.375f,-0.375f,1.50f},
+             {-0.375f,-1.50f,0.375f},
+             {-1.50f,-0.375f,0.375f},
+
+             { 0.00f, 1.50f, 1.50f},
+             {-1.50f, 0.00f,-1.50f},
+             { 1.50f,-1.50f, 0.00f},
+
+             {-1.50f, 1.50f, 0.00f},
+             { 0.00f,-1.50f,-1.50f},
+             { 1.50f, 0.00f, 1.50f},
+
+             { 1.50f, 1.50f,-1.50f},
+             {-1.50f,-1.50f, 1.50f},
+
+             {-0.5f, 1.5f, 0.5f},
+             { 0.5f,-1.5f,-0.5f},
+             { 1.5f,-0.5f, 0.5f},
+             {-1.5f, 0.5f,-0.5f},
+             { 0.5f, 0.5f, 1.5f},
+             {-0.5f,-0.5f,-1.5f},
          };
       }
 
@@ -175,11 +204,11 @@ public class TwistyAxis extends ShapeHexahedron
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// TODO
 
   public Static4D getCubitQuats(int cubit, int[] numLayers)
     {
-    return mObjectQuats[0];
+    if( mQuatIndex==null ) mQuatIndex = new int[] {0,22,10,17,14,19, 0,22,10,17,14,19, 0,22,10, 0,22,10, 0,14, 0,14,10,19,17,22 };
+    return mObjectQuats[mQuatIndex[cubit]];
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -219,12 +248,12 @@ public class TwistyAxis extends ShapeHexahedron
       {
       float[][] vertices =
           {
-              {-0.50f, 0.00f, -1.25f },
-              { 1.00f, 0.00f,  0.25f },
-              {-1.00f, 0.00f, -0.25f },
-              { 0.00f, 0.00f,  0.75f },
-              {  -2*T,  -2*T, 1.25f*T},
-              { 0.00f,-1.00f, -0.25f }
+              {-0.375f  , 0.0f, -1.125f  },
+              { 1.125f  , 0.0f,  0.375f  },
+              {-0.875f  , 0.0f, -0.125f  },
+              { 0.125f  , 0.0f,  0.875f  },
+              {-1.625f*T, -2*T,  1.625f*T},
+              { 0.125f  ,-1.0f, -0.125f  }
           };
 
       int[][] indices =
@@ -337,7 +366,7 @@ public class TwistyAxis extends ShapeHexahedron
     {
     if( variant==0 )
       {
-      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.01f,20,0.2f,0.4f,5,1,0} };
+      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
       int[] bandIndices = { 0,0,1,1,1,1,1 };
       float[][] corners = { {0.04f,0.09f} };
       int[] indices     = { 0,0,0,0,-1,-1,-1,-1 };
@@ -346,16 +375,16 @@ public class TwistyAxis extends ShapeHexahedron
       }
     else if( variant==1 )
       {
-      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.01f,20,0.2f,0.4f,5,1,0} };
+      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
       int[] bandIndices = { 0,1,1,1,1 };
       float[][] corners = { {0.04f,0.09f} };
       int[] indices     = { 0,0,0,0,-1,-1 };
-      float[][] centers = { {-1.0f/6, -5.0f/12, 1.0f/24 } };
+      float[][] centers = { { -5.0f/24, -5.0f/6, 5.0f/24} };
       return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
       }
     else if( variant==2 )
       {
-      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.01f,20,0.2f,0.4f,5,1,0} };
+      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
       int[] bandIndices = { 0,0,1,1,1,1 };
       float[][] corners = { {0.04f,0.09f} };
       int[] indices     = { 0,0,0,0,-1,-1 };
@@ -364,7 +393,7 @@ public class TwistyAxis extends ShapeHexahedron
       }
     else if( variant==3 )
       {
-      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.01f,20,0.2f,0.4f,5,1,0} };
+      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
       int[] bandIndices = { 0,0,1,1,1,1 };
       float[][] corners = { {0.04f,0.09f} };
       int[] indices     = { 0,0,0,0,-1,-1 };
@@ -373,7 +402,7 @@ public class TwistyAxis extends ShapeHexahedron
       }
     else if( variant==4 )
       {
-      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.01f,20,0.2f,0.4f,5,1,0} };
+      float[][] bands   = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
       int[] bandIndices = { 0,0,0,1,1,1 };
       float[][] corners = { {0.03f,0.08f} };
       int[] indices     = { 0,0,0,0,-1 };
@@ -399,11 +428,16 @@ public class TwistyAxis extends ShapeHexahedron
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// TODO
 
   public int getCubitVariant(int cubit, int[] numLayers)
     {
-    return cubit<12 ? 0 : (cubit<24 ? 1:2);
+    if( cubit<6 ) return 0;
+    if( cubit<12) return 1;
+    if( cubit<15) return 2;
+    if( cubit<18) return 3;
+    if( cubit<20) return 4;
+
+    return 5;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
