Project

General

Profile

« Previous | Next » 

Revision a57e6870

Added by Leszek Koltunski over 2 years ago

make numLayers into an int[] (preparation for Cuboids)
Caution: because of previous changes to cubit order in cube, the Solver is broken!

View differences:

src/main/java/org/distorted/objectlib/main/ObjectControl.java
62 62
    private float mStartRotX, mStartRotY;
63 63
    private float mAxisX, mAxisY;
64 64
    private float mRotationFactor;
65
    private int mLastCubitColor, mLastCubitFace, mLastCubit;
65
    private int mLastCubitColor, mLastCubit;
66 66
    private int mCurrentAxis, mCurrentRow;
67 67
    private float mCurrentAngle, mCurrRotSpeed;
68 68
    private final float[] mLastX;
......
191 191
            if( down )
192 192
              {
193 193
              int color = mInterface.getCurrentColor();
194
              mLastCubitFace = mMovement.getTouchedFace();
195 194
              float[] point = mMovement.getTouchedPoint3D();
196 195
              mLastCubit = object.getCubit(point);
197
              mPreRender.setTextureMap( mLastCubit, mLastCubitFace, color );
198 196
              mLastCubitColor = mInterface.cubitIsLocked(object.getObjectType(),mLastCubit);
197
              mPreRender.setTextureMap( mLastCubit, mLastCubitColor>=0 ? 4 : mMovement.getTouchedFace(), color );
199 198
              }
200 199
            }
201 200
          }
......
297 296
      mStartRotY = y;
298 297

  
299 298
      TwistyObject object = mPreRender.getObject();
300
      int numLayers = object.getNumLayers();
299
      int[] numLayers = object.getNumLayers();
301 300

  
302 301
      Static4D touchPoint2 = new Static4D(x, y, 0, 0);
303 302
      Static4D rotatedTouchPoint2= QuatHelper.rotateVectorByInvertedQuat(touchPoint2, mQuat);
......
447 446

  
448 447
      if( mLastCubitColor>=0 )
449 448
        {
450
        mPreRender.setTextureMap( mLastCubit, mLastCubitFace, mLastCubitColor );
449
        mPreRender.setTextureMap( mLastCubit, 4, mLastCubitColor );
451 450
        mLastCubitColor = -1;
452 451
        }
453 452
      }

Also available in: Unified diff