commit ad73edd502cba152d9fe4dc98a030c6abb76eb01
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Jun 8 00:17:09 2020 +0100

    Minor speedup

diff --git a/src/main/java/org/distorted/objects/RubikObject.java b/src/main/java/org/distorted/objects/RubikObject.java
index ef51fad6..89020f12 100644
--- a/src/main/java/org/distorted/objects/RubikObject.java
+++ b/src/main/java/org/distorted/objects/RubikObject.java
@@ -161,34 +161,6 @@ public abstract class RubikObject extends DistortedNode
     setProjection(fov, 0.1f);
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void textureCubitMesh(MeshBase mesh, int cubit)
-    {
-    boolean belongs;
-    final Static4D[] maps = new Static4D[NUM_FACES];
-    final float ratio = 1.0f/(NUM_FACES+1);
-
-    if( 2*ROTATION_AXIS.length == NUM_FACES )  // i.e. there are faces on both ends of the axis (cube)
-      {
-      for(int i=0; i<NUM_FACES; i++)
-        {
-        belongs = isOnFace(cubit, i/2, i%2==0 ? mSize-1:0 );
-        maps[i] = new Static4D( (belongs?i:NUM_FACES)*ratio, 0.0f, ratio, 1.0f);
-        }
-      }
-    else if( ROTATION_AXIS.length == NUM_FACES )  // just a single face on the right end of an axis (pyraminx)
-      {
-      for(int i=0; i<NUM_FACES; i++)
-        {
-        belongs = isOnFace(cubit, i, 0 );
-        maps[i] = new Static4D( (belongs?i:NUM_FACES)*ratio, 0.0f, ratio, 1.0f);
-        }
-      }
-
-    mesh.setTextureMap(maps,NUM_FACES*cubit);
-    }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Cast centers of all Cubits on the first rotation Axis and compute the leftmost and rightmost
 // one. From there compute the 'start' (i.e. the leftmost) and 'step' (i.e. distance between two
@@ -439,9 +411,31 @@ public abstract class RubikObject extends DistortedNode
 
   public void resetAllTextureMaps()
     {
-    for(int i=0; i<NUM_CUBITS; i++)
+    boolean belongs;
+    final float ratio = 1.0f/(NUM_FACES+1);
+
+    for(int cubit=0; cubit<NUM_CUBITS; cubit++)
       {
-      textureCubitMesh( mMesh , i );
+      final Static4D[] maps = new Static4D[NUM_FACES];
+
+      if( 2*ROTATION_AXIS.length == NUM_FACES )  // i.e. there are faces on both ends of the axis (cube)
+        {
+        for(int i=0; i<NUM_FACES; i++)
+          {
+          belongs = isOnFace(cubit, i/2, i%2==0 ? mSize-1:0 );
+          maps[i] = new Static4D( (belongs?i:NUM_FACES)*ratio, 0.0f, ratio, 1.0f);
+          }
+        }
+      else if( ROTATION_AXIS.length == NUM_FACES )  // just a single face on the right end of an axis (pyraminx)
+        {
+        for(int i=0; i<NUM_FACES; i++)
+          {
+          belongs = isOnFace(cubit, i, 0 );
+          maps[i] = new Static4D( (belongs?i:NUM_FACES)*ratio, 0.0f, ratio, 1.0f);
+          }
+        }
+
+      mMesh.setTextureMap(maps,NUM_FACES*cubit);
       }
     }
 
