Revision d99f3a48
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/main/RubikSurfaceView.java | ||
---|---|---|
305 | 305 |
} |
306 | 306 |
else |
307 | 307 |
{ |
308 |
Static4D touchPoint1 = new Static4D(x, y, 0, 0);
|
|
309 |
Static4D rotatedTouchPoint1= rotateVectorByInvertedQuat(touchPoint1, mQuat);
|
|
308 |
Static4D touchPoint = new Static4D(x, y, 0, 0); |
|
309 |
Static4D rotatedTouchPoint= rotateVectorByInvertedQuat(touchPoint, mQuat);
|
|
310 | 310 |
Static4D rotatedCamera= rotateVectorByInvertedQuat(CAMERA_POINT, mQuat); |
311 | 311 |
|
312 |
if( mMovement!=null && mMovement.faceTouched(rotatedTouchPoint1,rotatedCamera) )
|
|
312 |
if( mMovement!=null && mMovement.faceTouched(rotatedTouchPoint,rotatedCamera) ) |
|
313 | 313 |
{ |
314 | 314 |
mDragging = false; |
315 | 315 |
mContinuingRotation = false; |
... | ... | |
331 | 331 |
TwistyObject object = mPreRender.getObject(); |
332 | 332 |
mLastCubit = object.getCubit(point); |
333 | 333 |
mPreRender.setTextureMap( mLastCubit, mLastCubitFace, color ); |
334 |
mLastCubitColor = SolverMain.cubitIsLocked(object.getObjectList(), object.getSize(), mLastCubit);
|
|
334 |
mLastCubitColor = SolverMain.cubitIsLocked(object.getObjectList(), object.getNumLayers(), mLastCubit);
|
|
335 | 335 |
} |
336 | 336 |
} |
337 | 337 |
} |
... | ... | |
461 | 461 |
mStartRotY = y; |
462 | 462 |
|
463 | 463 |
TwistyObject object = mPreRender.getObject(); |
464 |
int size = object.getSize();
|
|
464 |
int numLayers = object.getNumLayers();
|
|
465 | 465 |
|
466 | 466 |
Static4D touchPoint2 = new Static4D(x, y, 0, 0); |
467 | 467 |
Static4D rotatedTouchPoint2= rotateVectorByInvertedQuat(touchPoint2, mQuat); |
468 |
Static2D res = mMovement.newRotation(size,rotatedTouchPoint2);
|
|
468 |
Static2D res = mMovement.newRotation(numLayers,rotatedTouchPoint2);
|
|
469 | 469 |
|
470 | 470 |
mCurrentAxis = (int)res.get0(); |
471 | 471 |
mCurrentRow = (int)res.get1(); |
472 | 472 |
|
473 | 473 |
computeCurrentAxis( mMovement.getCastedRotAxis(mCurrentAxis) ); |
474 |
mRotationFactor = mMovement.returnRotationFactor(size,mCurrentRow);
|
|
474 |
mRotationFactor = mMovement.returnRotationFactor(numLayers,mCurrentRow);
|
|
475 | 475 |
|
476 | 476 |
object.beginNewRotation( mCurrentAxis, mCurrentRow ); |
477 | 477 |
|
Also available in: Unified diff
Spearate the concept of number of layers of an object and its size.
In case of the Skewb family, this is no longer the same (Master Skewb has 3 layers but it's twice bigger than the 2-layered Skewb)