Revision 722b2512
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/objects/TwistyObject.java | ||
---|---|---|
406 | 406 |
// a) is a corner or edge and the quaternions are the same |
407 | 407 |
// b) is inside one of the faces and after rotations by both quats it ends up on the same face. |
408 | 408 |
|
409 |
boolean thereIsNoVisibleDifference(Cubit cubit, int quatIndex)
|
|
409 |
boolean thereIsVisibleDifference(Cubit cubit, int quatIndex) |
|
410 | 410 |
{ |
411 |
if ( cubit.mQuatIndex == quatIndex ) return true;
|
|
411 |
if ( cubit.mQuatIndex == quatIndex ) return false;
|
|
412 | 412 |
|
413 | 413 |
int belongsToHowManyFaces = 0; |
414 | 414 |
int lastLayer = getNumLayers()-1; |
... | ... | |
422 | 422 |
|
423 | 423 |
switch(belongsToHowManyFaces) |
424 | 424 |
{ |
425 |
case 0 : return true ; // 'inside' cubit that does not lie on any face
|
|
425 |
case 0 : return false; // 'inside' cubit that does not lie on any face
|
|
426 | 426 |
case 1 : // cubit that lies inside one of the faces |
427 | 427 |
Static3D orig = cubit.getOrigPosition(); |
428 | 428 |
Static4D quat1 = QUATS[quatIndex]; |
... | ... | |
445 | 445 |
row1 = computeRow(x1,y1,z1,i); |
446 | 446 |
row2 = computeRow(x2,y2,z2,i); |
447 | 447 |
|
448 |
if( (row1==0 && row2==0) || (row1==lastLayer && row2==lastLayer) ) return true;
|
|
448 |
if( (row1==0 && row2==0) || (row1==lastLayer && row2==lastLayer) ) return false;
|
|
449 | 449 |
} |
450 |
return false;
|
|
450 |
return true;
|
|
451 | 451 |
|
452 |
default: return false; // edge or corner
|
|
452 |
default: return true; // edge or corner
|
|
453 | 453 |
} |
454 | 454 |
} |
455 | 455 |
|
Also available in: Unified diff
Simplifications.