Revision 9b1fe915
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java | ||
---|---|---|
27 | 27 |
import org.distorted.objectlib.main.ObjectControl; |
28 | 28 |
import org.distorted.objectlib.main.ObjectType; |
29 | 29 |
import org.distorted.objectlib.main.ShapeOctahedron; |
30 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
|
31 | 30 |
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron; |
32 | 31 |
|
33 | 32 |
import java.io.InputStream; |
... | ... | |
53 | 52 |
|
54 | 53 |
private static final int[] mQuatIndices = new int[] {13,12,8,9,0,1, 15,10,14,11, 0,1,3,2, 8,9,5,4, 0,8,9,1,15,2,3,6}; |
55 | 54 |
|
56 |
private int[][] mFaceColorMap, mEdgeColorMap, mCornerColorMap; |
|
57 | 55 |
private ScrambleState[] mStates; |
58 | 56 |
private int[] mBasicAngle; |
59 | 57 |
private int[] mFaceMap; |
... | ... | |
418 | 416 |
return cubit<6 ? 0 : cubit<18 ? 1 : 2; |
419 | 417 |
} |
420 | 418 |
|
421 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
422 |
|
|
423 |
public int getCubitFaceColor(int cubit, int face, int[] numLayers) |
|
424 |
{ |
|
425 |
int variant = getCubitVariant(cubit,numLayers); |
|
426 |
|
|
427 |
if( mFaceColorMap==null) |
|
428 |
{ |
|
429 |
mFaceColorMap = new int[][] { {1,5,4,0},{3,7,6,2},{1,0,3,2},{4,5,6,7},{0,4,7,3},{5,1,2,6} }; |
|
430 |
} |
|
431 |
|
|
432 |
if( mEdgeColorMap==null) |
|
433 |
{ |
|
434 |
mEdgeColorMap = new int[][] { {3,0},{1,2},{4,7},{6,5}, {0,4},{5,1},{7,3},{2,6}, {1,0},{4,5},{3,2},{6,7} }; |
|
435 |
} |
|
436 |
|
|
437 |
if( mCornerColorMap==null) |
|
438 |
{ |
|
439 |
mCornerColorMap = new int[][] { {0},{1},{4},{5},{3},{2},{7},{6} }; |
|
440 |
} |
|
441 |
|
|
442 |
switch(variant) |
|
443 |
{ |
|
444 |
case 0: return face<4 ? mFaceColorMap[cubit][face] :-1; |
|
445 |
case 1: return face<2 ? mEdgeColorMap[cubit-6][face] :-1; |
|
446 |
case 2: return face<1 ? mCornerColorMap[cubit-18][face]:-1; |
|
447 |
} |
|
448 |
|
|
449 |
return 0; |
|
450 |
} |
|
451 |
|
|
452 | 419 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
453 | 420 |
|
454 | 421 |
public float getStickerRadius() |
Also available in: Unified diff
Finally remove the 'getCubitFaceColor()' API