Revision 9b1fe915
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/objects/TwistyJing.java | ||
---|---|---|
28 | 28 |
import org.distorted.library.type.Static4D; |
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
|
32 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron; |
33 | 32 |
import org.distorted.objectlib.main.ObjectControl; |
34 | 33 |
import org.distorted.objectlib.main.ObjectType; |
... | ... | |
58 | 57 |
private Static4D[] mQuats; |
59 | 58 |
private float[][] mCuts; |
60 | 59 |
private float[][] mCenters; |
61 |
private int[][] mFaceMap; |
|
62 | 60 |
|
63 | 61 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
64 | 62 |
|
... | ... | |
176 | 174 |
|
177 | 175 |
public boolean[][] getLayerRotatable(int[] numLayers) |
178 | 176 |
{ |
179 |
int numAxis = ROT_AXIS.length; |
|
180 |
boolean[][] layerRotatable = new boolean[numAxis][]; |
|
181 |
|
|
182 |
for(int i=0; i<numAxis; i++) |
|
183 |
{ |
|
184 |
layerRotatable[i] = new boolean[numLayers[i]]; |
|
185 |
for(int j=0; j<numLayers[i]; j++) layerRotatable[i][j] = true; |
|
186 |
} |
|
187 |
|
|
188 |
return layerRotatable; |
|
177 |
boolean[] tmp = {true,true}; |
|
178 |
return new boolean[][] { tmp,tmp,tmp,tmp }; |
|
189 | 179 |
} |
190 | 180 |
|
191 | 181 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
377 | 367 |
return cubit<4 ? 0 : (cubit<10?1:2); |
378 | 368 |
} |
379 | 369 |
|
380 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
381 |
|
|
382 |
public int getCubitFaceColor(int cubit, int face, int[] numLayers) |
|
383 |
{ |
|
384 |
if( mFaceMap==null ) |
|
385 |
{ |
|
386 |
mFaceMap = new int[][] |
|
387 |
{ |
|
388 |
{ 0, 3, 2, -1, -1, -1 }, |
|
389 |
{ 1, 2, 3, -1, -1, -1 }, |
|
390 |
{ 1, 0, 2, -1, -1, -1 }, |
|
391 |
{ 1, 3, 0, -1, -1, -1 }, |
|
392 |
|
|
393 |
{ 3, 2, -1, -1, -1, -1 }, |
|
394 |
{ 0, 2, -1, -1, -1, -1 }, |
|
395 |
{ 3, 0, -1, -1, -1, -1 }, |
|
396 |
{ 1, 2, -1, -1, -1, -1 }, |
|
397 |
{ 3, 1, -1, -1, -1, -1 }, |
|
398 |
{ 0, 1, -1, -1, -1, -1 }, |
|
399 |
|
|
400 |
{ 0, -1, -1, -1, -1, -1 }, |
|
401 |
{ 1, -1, -1, -1, -1, -1 }, |
|
402 |
{ 2, -1, -1, -1, -1, -1 }, |
|
403 |
{ 3, -1, -1, -1, -1, -1 }, |
|
404 |
}; |
|
405 |
} |
|
406 |
|
|
407 |
return mFaceMap[cubit][face]; |
|
408 |
} |
|
409 |
|
|
410 | 370 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
411 | 371 |
|
412 | 372 |
public float getStickerRadius() |
Also available in: Unified diff
Finally remove the 'getCubitFaceColor()' API