Revision efa81f0c
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyIvy.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
35 | 35 |
|
36 |
public class TwistyIvy extends TwistyObject
|
|
36 |
public class TwistyIvy extends Twisty6
|
|
37 | 37 |
{ |
38 |
// the four rotation axis of a RubikIvy. Must be normalized. |
|
39 | 38 |
static final Static3D[] ROT_AXIS = new Static3D[] |
40 | 39 |
{ |
41 | 40 |
new Static3D(+SQ3/3,+SQ3/3,+SQ3/3), |
... | ... | |
44 | 43 |
new Static3D(+SQ3/3,-SQ3/3,-SQ3/3) |
45 | 44 |
}; |
46 | 45 |
|
47 |
private static final int[] FACE_COLORS = new int[] |
|
48 |
{ |
|
49 |
COLOR_YELLOW, COLOR_WHITE, |
|
50 |
COLOR_BLUE , COLOR_GREEN, |
|
51 |
COLOR_RED , COLOR_ORANGE |
|
52 |
}; |
|
53 |
|
|
54 | 46 |
private static final int NUM_STICKERS = 2; |
55 | 47 |
public static final float IVY_D = 0.006f; |
56 | 48 |
private static final int IVY_N = 8; |
57 |
private static final int FACES_PER_CUBIT =6; |
|
58 | 49 |
|
59 | 50 |
private ScrambleState[] mStates; |
60 | 51 |
private int[] mBasicAngle; |
... | ... | |
69 | 60 |
MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth) |
70 | 61 |
{ |
71 | 62 |
super(size, size, quat, texture, mesh, effects, moves, ObjectList.IVY, res, scrWidth); |
72 |
|
|
73 |
int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 }; |
|
74 |
|
|
75 |
mStates = new ScrambleState[] |
|
76 |
{ |
|
77 |
new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} ) |
|
78 |
}; |
|
79 | 63 |
} |
80 | 64 |
|
81 | 65 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
126 | 110 |
return status<0 ? null : buildSolvedQuats(MovementIvy.FACE_AXIS[status],mQuats); |
127 | 111 |
} |
128 | 112 |
|
129 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
130 |
|
|
131 |
float getScreenRatio() |
|
132 |
{ |
|
133 |
return 0.5f; |
|
134 |
} |
|
135 |
|
|
136 | 113 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
137 | 114 |
|
138 | 115 |
Static4D[] getQuats() |
... | ... | |
141 | 118 |
return mQuats; |
142 | 119 |
} |
143 | 120 |
|
144 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
145 |
|
|
146 |
int getNumFaceColors() |
|
147 |
{ |
|
148 |
return FACE_COLORS.length; |
|
149 |
} |
|
150 |
|
|
151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
152 |
|
|
153 |
boolean shouldResetTextureMaps() |
|
154 |
{ |
|
155 |
return false; |
|
156 |
} |
|
157 |
|
|
158 | 121 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
159 | 122 |
|
160 | 123 |
int getSolvedFunctionIndex() |
... | ... | |
181 | 144 |
|
182 | 145 |
int getNumCubitFaces() |
183 | 146 |
{ |
184 |
return FACES_PER_CUBIT;
|
|
147 |
return 6;
|
|
185 | 148 |
} |
186 | 149 |
|
187 | 150 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
427 | 390 |
return mFaceMap[cubit][cubitface]; |
428 | 391 |
} |
429 | 392 |
|
430 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
431 |
|
|
432 |
int getColor(int face) |
|
433 |
{ |
|
434 |
return FACE_COLORS[face]; |
|
435 |
} |
|
436 |
|
|
437 | 393 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
438 | 394 |
|
439 | 395 |
ObjectSticker retSticker(int face) |
... | ... | |
452 | 408 |
return mStickers[face/NUM_FACE_COLORS]; |
453 | 409 |
} |
454 | 410 |
|
455 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
456 |
|
|
457 |
float returnMultiplier() |
|
458 |
{ |
|
459 |
return 2.0f; |
|
460 |
} |
|
461 |
|
|
462 | 411 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
463 | 412 |
// PUBLIC API |
464 | 413 |
|
Also available in: Unified diff
Introduce abstract 4,6,8 adn 12 classes.