Revision efa81f0c
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyDiamond.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
35 | 35 |
|
36 |
public class TwistyDiamond extends TwistyObject
|
|
36 |
public class TwistyDiamond extends Twisty8
|
|
37 | 37 |
{ |
38 | 38 |
// the four rotation axis of a Diamond. Must be normalized. |
39 | 39 |
static final Static3D[] ROT_AXIS = new Static3D[] |
... | ... | |
44 | 44 |
new Static3D( 0,-SQ3/3,+SQ6/3) |
45 | 45 |
}; |
46 | 46 |
|
47 |
private static final int[] FACE_COLORS = new int[] |
|
48 |
{ |
|
49 |
COLOR_ORANGE, COLOR_VIOLET, |
|
50 |
COLOR_WHITE , COLOR_BLUE , |
|
51 |
COLOR_YELLOW, COLOR_RED , |
|
52 |
COLOR_GREEN , COLOR_GREY |
|
53 |
}; |
|
54 |
|
|
55 |
private static final int FACES_PER_CUBIT =8; |
|
56 |
|
|
57 | 47 |
private ScrambleState[] mStates; |
58 | 48 |
private int[] mBasicAngle; |
59 | 49 |
private int[] mFaceMap; |
... | ... | |
127 | 117 |
return status<0 ? null : buildSolvedQuats(MovementDiamond.FACE_AXIS[mFaceMap[status]],mQuats); |
128 | 118 |
} |
129 | 119 |
|
130 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
131 |
|
|
132 |
float getScreenRatio() |
|
133 |
{ |
|
134 |
return 0.65f; |
|
135 |
} |
|
136 |
|
|
137 | 120 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
138 | 121 |
|
139 | 122 |
Static4D[] getQuats() |
... | ... | |
142 | 125 |
return mQuats; |
143 | 126 |
} |
144 | 127 |
|
145 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
146 |
|
|
147 |
int getNumFaceColors() |
|
148 |
{ |
|
149 |
return FACE_COLORS.length; |
|
150 |
} |
|
151 |
|
|
152 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
153 |
|
|
154 |
boolean shouldResetTextureMaps() |
|
155 |
{ |
|
156 |
return false; |
|
157 |
} |
|
158 |
|
|
159 | 128 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
160 | 129 |
|
161 | 130 |
int getSolvedFunctionIndex() |
... | ... | |
201 | 170 |
|
202 | 171 |
int getNumCubitFaces() |
203 | 172 |
{ |
204 |
return FACES_PER_CUBIT;
|
|
173 |
return 8;
|
|
205 | 174 |
} |
206 | 175 |
|
207 | 176 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
481 | 450 |
} |
482 | 451 |
} |
483 | 452 |
|
484 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
485 |
|
|
486 |
int getColor(int face) |
|
487 |
{ |
|
488 |
return FACE_COLORS[face]; |
|
489 |
} |
|
490 |
|
|
491 | 453 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
492 | 454 |
|
493 | 455 |
ObjectSticker retSticker(int face) |
... | ... | |
505 | 467 |
return mStickers[face/NUM_FACE_COLORS]; |
506 | 468 |
} |
507 | 469 |
|
508 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
509 |
|
|
510 |
float returnMultiplier() |
|
511 |
{ |
|
512 |
return 1.5f; |
|
513 |
} |
|
514 |
|
|
515 | 470 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
516 | 471 |
// PUBLIC API |
517 | 472 |
|
Also available in: Unified diff
Introduce abstract 4,6,8 adn 12 classes.