commit 348dfe694c423bdda01d8ab20f4ccf6597cbc472
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Feb 15 01:02:39 2020 +0000

    Adjustment to Static's API.

diff --git a/src/main/java/org/distorted/effect/solve/SolveEffectSpin.java b/src/main/java/org/distorted/effect/solve/SolveEffectSpin.java
index 4e101f2b..96fd8928 100644
--- a/src/main/java/org/distorted/effect/solve/SolveEffectSpin.java
+++ b/src/main/java/org/distorted/effect/solve/SolveEffectSpin.java
@@ -33,15 +33,15 @@ public class SolveEffectSpin extends SolveEffect
   {
   private static Static4D quatMultiply( Static4D quat1, Static4D quat2 )
     {
-    float qx = quat1.get1();
-    float qy = quat1.get2();
-    float qz = quat1.get3();
-    float qw = quat1.get4();
+    float qx = quat1.get0();
+    float qy = quat1.get1();
+    float qz = quat1.get2();
+    float qw = quat1.get3();
 
-    float rx = quat2.get1();
-    float ry = quat2.get2();
-    float rz = quat2.get3();
-    float rw = quat2.get4();
+    float rx = quat2.get0();
+    float ry = quat2.get1();
+    float rz = quat2.get2();
+    float rw = quat2.get3();
 
     float tx = rw*qx - rz*qy + ry*qz + rx*qw;
     float ty = rw*qy + rz*qx + ry*qw - rx*qz;
@@ -56,10 +56,10 @@ public class SolveEffectSpin extends SolveEffect
 
   private static Static4D rotateVectorByInvertedQuat(Static4D vector, Static4D quat)
     {
-    float qx = quat.get1();
-    float qy = quat.get2();
-    float qz = quat.get3();
-    float qw = quat.get4();
+    float qx = quat.get0();
+    float qy = quat.get1();
+    float qz = quat.get2();
+    float qw = quat.get3();
 
     Static4D quatInverted= new Static4D(-qx,-qy,-qz,qw);
     Static4D tmp = quatMultiply(quatInverted,vector);
@@ -78,7 +78,7 @@ public class SolveEffectSpin extends SolveEffect
     Static4D tmpAxis    = new Static4D(0,1,0,0);                          // vert axis no matter
     Static4D rotated    = rotateVectorByInvertedQuat(tmpAxis,quaternion); // how cube is rotated
 
-    Static3D axis  = new Static3D(rotated.get1(), rotated.get2(), rotated.get3());
+    Static3D axis  = new Static3D(rotated.get0(), rotated.get1(), rotated.get2());
     Static3D center= new Static3D(0,0,0);
 
     Dynamic1D d = new Dynamic1D(duration/2, 1.0f);
diff --git a/src/main/java/org/distorted/magic/RubikSurfaceView.java b/src/main/java/org/distorted/magic/RubikSurfaceView.java
index 10273c0c..99f68f1e 100644
--- a/src/main/java/org/distorted/magic/RubikSurfaceView.java
+++ b/src/main/java/org/distorted/magic/RubikSurfaceView.java
@@ -73,15 +73,15 @@ public class RubikSurfaceView extends GLSurfaceView
 
     public static Static4D quatMultiply( Static4D quat1, Static4D quat2 )
       {
-      float qx = quat1.get1();
-      float qy = quat1.get2();
-      float qz = quat1.get3();
-      float qw = quat1.get4();
+      float qx = quat1.get0();
+      float qy = quat1.get1();
+      float qz = quat1.get2();
+      float qw = quat1.get3();
 
-      float rx = quat2.get1();
-      float ry = quat2.get2();
-      float rz = quat2.get3();
-      float rw = quat2.get4();
+      float rx = quat2.get0();
+      float ry = quat2.get1();
+      float rz = quat2.get2();
+      float rw = quat2.get3();
 
       float tx = rw*qx - rz*qy + ry*qz + rx*qw;
       float ty = rw*qy + rz*qx + ry*qw - rx*qz;
@@ -96,10 +96,10 @@ public class RubikSurfaceView extends GLSurfaceView
 
     public static Static4D rotateVectorByQuat(Static4D vector, Static4D quat)
       {
-      float qx = quat.get1();
-      float qy = quat.get2();
-      float qz = quat.get3();
-      float qw = quat.get4();
+      float qx = quat.get0();
+      float qy = quat.get1();
+      float qz = quat.get2();
+      float qw = quat.get3();
 
       Static4D quatInverted= new Static4D(-qx,-qy,-qz,qw);
       Static4D tmp = quatMultiply(quat,vector);
@@ -112,10 +112,10 @@ public class RubikSurfaceView extends GLSurfaceView
 
     public static Static4D rotateVectorByInvertedQuat(Static4D vector, Static4D quat)
       {
-      float qx = quat.get1();
-      float qy = quat.get2();
-      float qz = quat.get3();
-      float qw = quat.get4();
+      float qx = quat.get0();
+      float qy = quat.get1();
+      float qz = quat.get2();
+      float qw = quat.get3();
 
       Static4D quatInverted= new Static4D(-qx,-qy,-qz,qw);
       Static4D tmp = quatMultiply(quatInverted,vector);
@@ -393,7 +393,7 @@ public class RubikSurfaceView extends GLSurfaceView
                                            Static2D rot = mMovement.newRotation(rotatedTouchPoint2);
                                            RubikCube cube = mRenderer.getCube();
 
-                                           cube.addNewRotation( (int)rot.get1(), (int)(cube.getSize()*rot.get2()) );
+                                           cube.addNewRotation( (int)rot.get0(), (int)(cube.getSize()*rot.get1()) );
 
                                            mBeginningRotation = false;
                                            mContinuingRotation= true;
diff --git a/src/main/java/org/distorted/object/RubikCube.java b/src/main/java/org/distorted/object/RubikCube.java
index d1343d00..b1b82722 100644
--- a/src/main/java/org/distorted/object/RubikCube.java
+++ b/src/main/java/org/distorted/object/RubikCube.java
@@ -104,10 +104,10 @@ public class RubikCube extends DistortedNode
       {
       Static4D quat = mQuatScramble[i][j][k];
 
-      float x = quat.get1();
-      float y = quat.get2();
-      float z = quat.get3();
-      float w = quat.get4();
+      float x = quat.get0();
+      float y = quat.get1();
+      float z = quat.get2();
+      float w = quat.get3();
       float diff;
 
       for(float legal: LEGAL)
@@ -177,9 +177,9 @@ public class RubikCube extends DistortedNode
       {
       switch(vector)
         {
-        case VECTX: return mCurrentPosition[x][y][z].get1()==row;
-        case VECTY: return mCurrentPosition[x][y][z].get2()==row;
-        case VECTZ: return mCurrentPosition[x][y][z].get3()==row;
+        case VECTX: return mCurrentPosition[x][y][z].get0()==row;
+        case VECTY: return mCurrentPosition[x][y][z].get1()==row;
+        case VECTZ: return mCurrentPosition[x][y][z].get2()==row;
         }
 
       return false;
@@ -191,24 +191,24 @@ public class RubikCube extends DistortedNode
       {
       Static3D current = mCurrentPosition[x][y][z];
       float diff = 0.5f*(mSize-1);
-      float cubitCenterX = current.get1() - diff;
-      float cubitCenterY = current.get2() - diff;
-      float cubitCenterZ = current.get3() - diff;
+      float cubitCenterX = current.get0() - diff;
+      float cubitCenterY = current.get1() - diff;
+      float cubitCenterZ = current.get2() - diff;
 
       Static4D cubitCenter =  new Static4D(cubitCenterX, cubitCenterY, cubitCenterZ, 0);
       Static4D rotatedCenter = RubikSurfaceView.rotateVectorByQuat( cubitCenter, quat);
 
-      float rotatedX = rotatedCenter.get1() + diff;
-      float rotatedY = rotatedCenter.get2() + diff;
-      float rotatedZ = rotatedCenter.get3() + diff;
+      float rotatedX = rotatedCenter.get0() + diff;
+      float rotatedY = rotatedCenter.get1() + diff;
+      float rotatedZ = rotatedCenter.get2() + diff;
 
       int roundedX = (int)(rotatedX+0.1f);
       int roundedY = (int)(rotatedY+0.1f);
       int roundedZ = (int)(rotatedZ+0.1f);
 
-      mCurrentPosition[x][y][z].set1(roundedX);
-      mCurrentPosition[x][y][z].set2(roundedY);
-      mCurrentPosition[x][y][z].set3(roundedZ);
+      mCurrentPosition[x][y][z].set0(roundedX);
+      mCurrentPosition[x][y][z].set1(roundedY);
+      mCurrentPosition[x][y][z].set2(roundedZ);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -342,7 +342,7 @@ public class RubikCube extends DistortedNode
       mRotAxis = vector;
       mRotRow  = row;
 
-      mRotationAngleStatic.set1(0.0f);
+      mRotationAngleStatic.set0(0.0f);
 
       for(int x=0; x<mSize; x++)
         for(int y=0; y<mSize; y++)
@@ -361,7 +361,7 @@ public class RubikCube extends DistortedNode
 
     public void continueRotation(float angleInDegrees)
       {
-      mRotationAngleStatic.set1(angleInDegrees);
+      mRotationAngleStatic.set0(angleInDegrees);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -394,11 +394,11 @@ public class RubikCube extends DistortedNode
 
                   if( pointNum>=1 )
                     {
-                    float startingAngle = mRotationAngle[x][y][z].getPoint(pointNum-1).get1();
+                    float startingAngle = mRotationAngle[x][y][z].getPoint(pointNum-1).get0();
                     int nearestAngleInDegrees = computeNearestAngle(startingAngle);
-                    mRotationAngleStatic.set1(startingAngle);
-                    mRotationAngleFinal.set1(nearestAngleInDegrees);
-                    mRotationAngleMiddle.set1( nearestAngleInDegrees + (nearestAngleInDegrees-startingAngle)*0.2f );
+                    mRotationAngleStatic.set0(startingAngle);
+                    mRotationAngleFinal.set0(nearestAngleInDegrees);
+                    mRotationAngleMiddle.set0( nearestAngleInDegrees + (nearestAngleInDegrees-startingAngle)*0.2f );
                     }
                   else
                     {
@@ -562,10 +562,10 @@ public class RubikCube extends DistortedNode
       {
       Static4D q = mQuatScramble[0][0][0];
 
-      float x = q.get1();
-      float y = q.get2();
-      float z = q.get3();
-      float w = q.get4();
+      float x = q.get0();
+      float y = q.get1();
+      float z = q.get2();
+      float w = q.get3();
 
       for(int i = 0; i< mSize; i++)
         for(int j = 0; j< mSize; j++)
@@ -575,7 +575,7 @@ public class RubikCube extends DistortedNode
               {
               q = mQuatScramble[i][j][k];
 
-              if( q.get1()!=x || q.get2()!=y || q.get3()!=z || q.get4()!=w )
+              if( q.get0()!=x || q.get1()!=y || q.get2()!=z || q.get3()!=w )
                 {
                 return false;
                 }
@@ -610,7 +610,7 @@ public class RubikCube extends DistortedNode
       mRotAxis = vector;
       mRotRow  = row;
 
-      mRotationAngleStatic.set1(0.0f);
+      mRotationAngleStatic.set0(0.0f);
 
       for(int x=0; x<mSize; x++)
         for(int y=0; y<mSize; y++)
@@ -666,7 +666,7 @@ public class RubikCube extends DistortedNode
 
                   if( pointNum>=1 )
                     {
-                    float startingAngle = mRotationAngle[x][y][z].getPoint(pointNum-1).get1();
+                    float startingAngle = mRotationAngle[x][y][z].getPoint(pointNum-1).get0();
                     int nearestAngleInDegrees = computeNearestAngle(startingAngle);
                     double nearestAngleInRadians = nearestAngleInDegrees*Math.PI/180;
                     float sinA =-(float)Math.sin(nearestAngleInRadians*0.5);
@@ -687,6 +687,6 @@ public class RubikCube extends DistortedNode
                 }
               }
 
-      mRotationAngleStatic.set1(0);
+      mRotationAngleStatic.set0(0);
       }
 }
diff --git a/src/main/java/org/distorted/object/RubikCubeMovement.java b/src/main/java/org/distorted/object/RubikCubeMovement.java
index 5ef411a2..26a45f6c 100644
--- a/src/main/java/org/distorted/object/RubikCubeMovement.java
+++ b/src/main/java/org/distorted/object/RubikCubeMovement.java
@@ -160,13 +160,13 @@ public class RubikCubeMovement
       {
       float cubeHalfSize= RubikCube.CUBE_SCREEN_RATIO*0.5f;
 
-      mPoint[0]  = rotatedTouchPoint.get1();
-      mPoint[1]  = rotatedTouchPoint.get2();
-      mPoint[2]  = rotatedTouchPoint.get3();
+      mPoint[0]  = rotatedTouchPoint.get0();
+      mPoint[1]  = rotatedTouchPoint.get1();
+      mPoint[2]  = rotatedTouchPoint.get2();
 
-      mCamera[0] = rotatedCamera.get1();
-      mCamera[1] = rotatedCamera.get2();
-      mCamera[2] = rotatedCamera.get3();
+      mCamera[0] = rotatedCamera.get0();
+      mCamera[1] = rotatedCamera.get1();
+      mCamera[2] = rotatedCamera.get2();
 
       for( mLastTouchedFace=FRONT; mLastTouchedFace<=BOTTOM; mLastTouchedFace++)
         {
@@ -192,9 +192,9 @@ public class RubikCubeMovement
       {
       float cubeHalfSize= RubikCube.CUBE_SCREEN_RATIO*0.5f;
 
-      mPoint[0] = rotatedTouchPoint.get1();
-      mPoint[1] = rotatedTouchPoint.get2();
-      mPoint[2] = rotatedTouchPoint.get3();
+      mPoint[0] = rotatedTouchPoint.get0();
+      mPoint[1] = rotatedTouchPoint.get1();
+      mPoint[2] = rotatedTouchPoint.get2();
 
       castTouchPointOntoFace(mLastTouchedFace,cubeHalfSize,mDiff);
 
@@ -218,9 +218,9 @@ public class RubikCubeMovement
 
     public float continueRotation(Static4D rotatedTouchPoint)
       {
-      mDiff[0] = rotatedTouchPoint.get1()-mTouch[0];
-      mDiff[1] = rotatedTouchPoint.get2()-mTouch[1];
-      mDiff[2] = rotatedTouchPoint.get3()-mTouch[2];
+      mDiff[0] = rotatedTouchPoint.get0()-mTouch[0];
+      mDiff[1] = rotatedTouchPoint.get1()-mTouch[1];
+      mDiff[2] = rotatedTouchPoint.get2()-mTouch[2];
 
       int xAxis= retFaceXaxis(mLastTouchedFace);
       int yAxis= retFaceYaxis(mLastTouchedFace);
