Project

General

Profile

« Previous | Next » 

Revision a6d3b158

Added by Leszek Koltunski about 4 years ago

Progress with Pretty Patterns.

View differences:

src/main/java/org/distorted/magic/RubikSurfaceView.java
162 162

  
163 163
    private void setUpDragOrRotate(float x, float y)
164 164
      {
165
      Static4D touchPoint1 = new Static4D(x, y, 0, 0);
166
      Static4D rotatedTouchPoint1= rotateVectorByInvertedQuat(touchPoint1, mQuatAccumulated);
167
      Static4D rotatedCamera= rotateVectorByInvertedQuat(CAMERA_POINT, mQuatAccumulated);
165
      boolean rota = mRenderer.canRotate();
166
      boolean drag = mRenderer.canDrag();
168 167

  
169
      if( mMovement!=null && mMovement.faceTouched(rotatedTouchPoint1,rotatedCamera) )
168
      if( !rota && drag )
170 169
        {
171
        mDragging           = false;
172
        mBeginningRotation  = mRenderer.canRotate();
170
        mDragging           = true;
171
        mBeginningRotation  = false;
173 172
        mContinuingRotation = false;
174 173
        }
175 174
      else
176 175
        {
177
        mDragging           = mRenderer.canDrag();
178
        mBeginningRotation  = false;
179
        mContinuingRotation = false;
176
        Static4D touchPoint1 = new Static4D(x, y, 0, 0);
177
        Static4D rotatedTouchPoint1= rotateVectorByInvertedQuat(touchPoint1, mQuatAccumulated);
178
        Static4D rotatedCamera= rotateVectorByInvertedQuat(CAMERA_POINT, mQuatAccumulated);
179

  
180
        if( mMovement!=null && mMovement.faceTouched(rotatedTouchPoint1,rotatedCamera) )
181
          {
182
          mDragging           = false;
183
          mBeginningRotation  = rota;
184
          mContinuingRotation = false;
185
          }
186
        else
187
          {
188
          mDragging           = drag;
189
          mBeginningRotation  = false;
190
          mContinuingRotation = false;
191
          }
180 192
        }
181 193
      }
182 194

  

Also available in: Unified diff