Revision efa81f0c
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyCube.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
35 | 35 |
|
36 |
class TwistyCube extends TwistyObject
|
|
36 |
class TwistyCube extends Twisty6
|
|
37 | 37 |
{ |
38 | 38 |
static final Static3D[] ROT_AXIS = new Static3D[] |
39 | 39 |
{ |
... | ... | |
42 | 42 |
new Static3D(0,0,1) |
43 | 43 |
}; |
44 | 44 |
|
45 |
private static final int[] FACE_COLORS = new int[] |
|
46 |
{ |
|
47 |
COLOR_YELLOW, COLOR_WHITE, |
|
48 |
COLOR_BLUE , COLOR_GREEN, |
|
49 |
COLOR_RED , COLOR_ORANGE |
|
50 |
}; |
|
51 |
|
|
52 | 45 |
private ScrambleState[] mStates; |
53 | 46 |
private Static4D[] mQuats; |
54 | 47 |
private int[] mBasicAngle; |
... | ... | |
232 | 225 |
return 0; |
233 | 226 |
} |
234 | 227 |
|
235 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
236 |
|
|
237 |
int getColor(int face) |
|
238 |
{ |
|
239 |
return FACE_COLORS[face]; |
|
240 |
} |
|
241 |
|
|
242 | 228 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
243 | 229 |
|
244 | 230 |
ObjectSticker retSticker(int face) |
... | ... | |
285 | 271 |
return mQuats; |
286 | 272 |
} |
287 | 273 |
|
288 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
289 |
|
|
290 |
boolean shouldResetTextureMaps() |
|
291 |
{ |
|
292 |
return false; |
|
293 |
} |
|
294 |
|
|
295 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
296 |
|
|
297 |
int getNumFaceColors() |
|
298 |
{ |
|
299 |
return FACE_COLORS.length; |
|
300 |
} |
|
301 |
|
|
302 | 274 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
303 | 275 |
|
304 | 276 |
float[][] getCuts(int numLayers) |
... | ... | |
334 | 306 |
|
335 | 307 |
int getNumCubitFaces() |
336 | 308 |
{ |
337 |
return FACE_COLORS.length; |
|
338 |
} |
|
339 |
|
|
340 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
341 |
|
|
342 |
float getScreenRatio() |
|
343 |
{ |
|
344 |
return 0.5f; |
|
309 |
return 6; |
|
345 | 310 |
} |
346 | 311 |
|
347 | 312 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
351 | 316 |
return CUBITS[cubit].mRotationRow[cubitface/2] == (cubitface%2==0 ? (1<<(numLayers-1)):1) ? cubitface : NUM_TEXTURES; |
352 | 317 |
} |
353 | 318 |
|
354 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
355 |
|
|
356 |
float returnMultiplier() |
|
357 |
{ |
|
358 |
return getNumLayers(); |
|
359 |
} |
|
360 |
|
|
361 | 319 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
362 | 320 |
// PUBLIC API |
363 | 321 |
|
Also available in: Unified diff
Introduce abstract 4,6,8 adn 12 classes.