commit 1b32d001684b7f04a4caff7bc5bc3ab5d9c9ec4b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Sep 16 00:27:52 2021 +0200

    Make the Ultimate standard size (dodecahedron size=2, i.e. equal to numLayers so that DIST2D and DIST3D are standard)

diff --git a/src/main/java/org/distorted/objects/MovementUltimate.java b/src/main/java/org/distorted/objects/MovementUltimate.java
index 294b221f..2ee90146 100644
--- a/src/main/java/org/distorted/objects/MovementUltimate.java
+++ b/src/main/java/org/distorted/objects/MovementUltimate.java
@@ -31,8 +31,8 @@ import static org.distorted.objects.TwistyObject.SQ5;
 
 class MovementUltimate extends Movement
 {
-  static final float DIST3D = (float)Math.sqrt(0.625f+0.275f*SQ5)/2;
-  static final float DIST2D = (0.5f*SIN54/COS54)/2;
+  static final float DIST3D = (float)Math.sqrt(0.625f+0.275f*SQ5);
+  static final float DIST2D = (SIN54/COS54)/2;
 
   static final Static3D[] FACE_AXIS = new Static3D[]
          {
diff --git a/src/main/java/org/distorted/objects/TwistyUltimate.java b/src/main/java/org/distorted/objects/TwistyUltimate.java
index b8ac82bd..e7ac8fde 100644
--- a/src/main/java/org/distorted/objects/TwistyUltimate.java
+++ b/src/main/java/org/distorted/objects/TwistyUltimate.java
@@ -144,14 +144,14 @@ class TwistyUltimate extends TwistyObject
       {
       double[][] vertices = new double[][]
          {
-           { 0.0       ,  0.0      , 0.0       },
-           { -0.5*E    , 0.5*E+0.25, -0.25     },
-           {-0.25      , -E/2      , (-2*E-1)/4},
-           { 0.5*E+0.25, 0.25      , -E/2      },
-           { 0.0       , 0.5       , -E-0.5    },
-           { 0.0       , 0.5       , 0.0       },
-           { -0.5*E    ,-0.5*E+0.25, -0.25     },
-           {  0.5*E    ,-0.5*E+0.25, -0.25     }
+           { 0.0  , 0.0  , 0.0   },
+           { -E   , E+0.5, -0.5  },
+           {-0.5  , -E   , -E-0.5},
+           { E+0.5, 0.5  , -E    },
+           { 0.0  , 1    , -2*E-1},
+           { 0.0  , 1    , 0.0   },
+           { -E   ,-E+0.5, -0.5  },
+           {  E   ,-E+0.5, -0.5  }
          };
       int[][] vert_indices = new int[][]
          {
@@ -165,9 +165,9 @@ class TwistyUltimate extends TwistyObject
 
       float[][] bands     = new float[][] { {0.03f,17,0.5f,0.2f,5,2,2}, {0.01f, 1,0.5f,0.2f,5,2,2} };
       int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
-      float[][] corners   = new float[][] {  { 0.013f, 0.08f } };
+      float[][] corners   = new float[][] {  { 0.013f, 0.16f } };
       int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 };
-      float[][] centers   = new float[][] { { 0.0f,-0.5f, -(SQ5+3)/4 } };
+      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);
       }
@@ -175,14 +175,14 @@ class TwistyUltimate extends TwistyObject
       {
       double[][] vertices = new double[][]
          {
-            {         0.000,         0.000,         0.000},
-            {       - 0.250,-SQ5/8 - 0.125,-SQ5/8 - 0.375},
-            { SQ5/8 + 0.125,-SQ5/8 - 0.375,       + 0.250},
-            { SQ5/8 + 0.375,       + 0.250,-SQ5/8 - 0.125},
-            { SQ5/4 + 0.250,-SQ5/4 - 0.250,-SQ5/4 - 0.250},
-            { SQ5/8 - 0.125,       + 0.250,-SQ5/8 - 0.125},
-            {       - 0.250,-SQ5/8 - 0.125,-SQ5/8 + 0.125},
-            { SQ5/8 + 0.125,-SQ5/8 + 0.125,       + 0.250}
+            {         0.00,         0.00,         0.00},
+            {       - 0.50,-SQ5/4 - 0.25,-SQ5/4 - 0.75},
+            { SQ5/4 + 0.25,-SQ5/4 - 0.75,       + 0.50},
+            { SQ5/4 + 0.75,       + 0.50,-SQ5/4 - 0.25},
+            { SQ5/2 + 0.50,-SQ5/2 - 0.50,-SQ5/2 - 0.50},
+            { SQ5/4 - 0.25,       + 0.50,-SQ5/4 - 0.25},
+            {       - 0.50,-SQ5/4 - 0.25,-SQ5/4 + 0.25},
+            { SQ5/4 + 0.25,-SQ5/4 + 0.25,       + 0.50}
          };
       int[][] vert_indices  = new int[][]
          {
@@ -196,9 +196,9 @@ class TwistyUltimate extends TwistyObject
 
       float[][] bands     = new float[][] { {0.03f,17,0.5f,0.2f,5,2,2}, {0.01f, 1,0.5f,0.2f,5,2,2} };
       int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
-      float[][] corners   = new float[][] {  { 0.013f, 0.08f } };
+      float[][] corners   = new float[][] {  { 0.013f, 0.16f } };
       int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 };
-      float[][] centers   = new float[][] { { 0.0f,-0.5f, -(SQ5+3)/4 } };
+      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);
       }
@@ -206,17 +206,17 @@ class TwistyUltimate extends TwistyObject
       {
       double[][] vertices = new double[][]
          {
-           {-E/2     ,-E/2+0.25,     0.25},
-           { E/2     , E/2-0.25,    -0.25},
-           {-E       ,     0.00,     0.00},
-           {     0.25, E/2     ,-E/2-0.25},
-           {-E/2     ,-E/2-0.25,     0.25},
-           { E/2+0.25,    -0.25,-E/2     },
-           {-E       ,    -0.50,     0.00},
-           {     0.50,     0.00,-E       },
-           {-E  +0.25, E/2     ,-E/2-0.25},
-           {     0.25,-E/2-0.50,-E/2+0.25},
-           {-E/2     ,-E/2-0.25,-E  -0.25}
+           {  -E    ,-E+0.5,     0.5},
+           {   E    , E-0.5,    -0.5},
+           {-2*E    ,   0.0,     0.0},
+           {     0.5, E    ,  -E-0.5},
+           {  -E    ,-E-0.5,     0.5},
+           {   E+0.5,  -0.5,  -E    },
+           {-2*E    ,  -1.0,     0.0},
+           {     1.0,   0.0,-2*E    },
+           {-2*E+0.5, E    ,  -E-0.5},
+           {     0.5,-E-1.0,  -E+0.5},
+           {  -E    ,-E-0.5,-2*E-0.5}
          };
       int[][] vert_indices = new int[][]
          {
@@ -232,9 +232,9 @@ class TwistyUltimate extends TwistyObject
 
       float[][] bands     = new float[][] { {0.04f,17,0.5f,0.2f,5,2,2}, {0.03f,17,0.5f,0.2f,5,2,2}, {0.01f, 1,0.5f,0.2f,5,2,2} };
       int[] bandIndices   = new int[] { 0,0,1,1,2,2,2,2 };
-      float[][] corners   = new float[][] { { 0.013f, 0.08f } };
+      float[][] corners   = new float[][] { { 0.013f, 0.16f } };
       int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,-1 };
-      float[][] centers   = new float[][] { { -(SQ5+1)/8, 0.25f, -(SQ5+5)/8 } };
+      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);
       }
@@ -271,22 +271,22 @@ class TwistyUltimate extends TwistyObject
       {
       mCenters = new float[][]
          {
-           { 0.0f,-0.5f,    G },
-           {    E,   -E,   -E },
-           {   -G, 0.0f,-0.5f },
-           { 0.5f,    G, 0.0f },
-
-           {   -E,    E,    E },
-           {    G, 0.0f, 0.5f },
-           {-0.5f,   -G, 0.0f },
-           { 0.0f, 0.5f,   -G },
-
-           {        E/2, (E+0.5f)/2,    (E+G)/2 },
-           {   -(E+G)/2,       -E/2, (E+0.5f)/2 },
-           { (E+0.5f)/2,   -(E+G)/2,        E/2 },
-           {       -E/2,-(E+0.5f)/2,   -(E+G)/2 },
-           {    (E+G)/2,        E/2,-(E+0.5f)/2 },
-           {-(E+0.5f)/2,    (E+G)/2,       -E/2 }
+           {   0,  -1, 2*G },
+           { 2*E,-2*E,-2*E },
+           {-2*G,   0,  -1 },
+           {   1, 2*G,   0 },
+
+           {-2*E,  2*E, 2*E },
+           { 2*G,    0,   1 },
+           {  -1, -2*G,   0 },
+           {   0,    1,-2*G },
+
+           {        E, (E+0.5f),    (E+G) },
+           {   -(E+G),       -E, (E+0.5f) },
+           { (E+0.5f),   -(E+G),        E },
+           {       -E,-(E+0.5f),   -(E+G) },
+           {    (E+G),        E,-(E+0.5f) },
+           {-(E+0.5f),    (E+G),       -E }
          };
       }
 
@@ -422,7 +422,7 @@ class TwistyUltimate extends TwistyObject
 
   float getScreenRatio()
     {
-    return 0.67f;
+    return 0.33f;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/res/raw/ulti.dmesh b/src/main/res/raw/ulti.dmesh
index 5eaf146a..27bfde0c 100644
Binary files a/src/main/res/raw/ulti.dmesh and b/src/main/res/raw/ulti.dmesh differ
