Project

General

Profile

Download (21 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyMinx.java @ 9b1fe915

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.objectlib.objects;
21

    
22
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_DODECAHEDRON;
23
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_SPLIT_EDGE;
24
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.C2;
25
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.LEN;
26
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.SIN54;
27

    
28
import java.io.InputStream;
29

    
30
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32
import org.distorted.objectlib.touchcontrol.TouchControlDodecahedron;
33
import org.distorted.objectlib.helpers.ScrambleState;
34
import org.distorted.objectlib.main.ShapeDodecahedron;
35

    
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37

    
38
abstract class TwistyMinx extends ShapeDodecahedron
39
{
40
  static final int NUM_CORNERS = 20;
41
  static final int NUM_CENTERS = 12;
42
  static final int NUM_EDGES   = 30;
43

    
44
  static final float SIN18    = (SQ5-1)/4;
45
  static final float COS18    = (float)(0.25f*Math.sqrt(10.0f+2.0f*SQ5));
46
  static final float COS_HALFD= (float)(Math.sqrt(0.5f-0.1f*SQ5)); // cos(half the dihedral angle)
47
  static final float SIN_HALFD= (float)(Math.sqrt(0.5f+0.1f*SQ5)); // sin(half the dihedral angle)
48

    
49
  // the six rotation axis of a Minx. Must be normalized.
50
  static final Static3D[] ROT_AXIS = new Static3D[]
51
         {
52
           new Static3D(    C2/LEN, SIN54/LEN,    0      ),
53
           new Static3D(   -C2/LEN, SIN54/LEN,    0      ),
54
           new Static3D( 0        ,    C2/LEN, SIN54/LEN ),
55
           new Static3D( 0        ,   -C2/LEN, SIN54/LEN ),
56
           new Static3D( SIN54/LEN,    0     ,    C2/LEN ),
57
           new Static3D( SIN54/LEN,    0     ,   -C2/LEN )
58
         };
59

    
60
  private ScrambleState[] mStates;
61
  private int[] mBasicAngle;
62
  private int[] mFaceMap;
63
  private float[][] mCuts;
64
  Static4D[] mQuats;
65
  float[][] mCenterCoords;
66
  float[][] mCorners;
67
  int[] mQuatEdgeIndices;
68
  int[] mQuatCornerIndices;
69
  int[][] mEdgeMap;
70
  int[][] mCenterMap;
71
  Static4D[] mBasicCornerV, mCurrCornerV;
72

    
73
///////////////////////////////////////////////////////////////////////////////////////////////////
74

    
75
  TwistyMinx(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream)
76
    {
77
    super(numL, meshState, numL[0], quat, move, scale, stream);
78
    }
79

    
80
///////////////////////////////////////////////////////////////////////////////////////////////////
81

    
82
  public ScrambleState[] getScrambleStates()
83
    {
84
    if( mStates==null )
85
      {
86
      int[] numLayers = getNumLayers();
87
      initializeScrambleStates(numLayers[0]);
88
      }
89

    
90
    return mStates;
91
    }
92

    
93
///////////////////////////////////////////////////////////////////////////////////////////////////
94

    
95
  void initializeCornerV()
96
    {
97
    mBasicCornerV = new Static4D[3];
98
    mCurrCornerV  = new Static4D[3];
99

    
100
    mBasicCornerV[0] = new Static4D( (SQ5+1)*0.375f, (SQ5-1)*0.375f, -0.750f, 0.0f );
101
    mBasicCornerV[1] = new Static4D(-(SQ5+1)*0.375f, (SQ5-1)*0.375f, -0.750f, 0.0f );
102
    mBasicCornerV[2] = new Static4D(              0,        -1.500f,    0.0f, 0.0f );
103
    }
104

    
105
///////////////////////////////////////////////////////////////////////////////////////////////////
106
// the five vertices that form a given face. Order: the same as colors of the faces in TwistyMinx.
107

    
108
  void initializeCenterMap()
109
    {
110
    mCenterMap = new int[][]
111
         {
112
           { 0, 12,  4, 14,  2},
113
           { 0,  2, 18,  6, 16},
114
           { 6, 18, 11, 19,  7},
115
           { 3, 15,  9, 11, 19},
116
           { 4,  5, 15,  9, 14},
117
           { 1, 13,  5, 15,  3},
118
           { 1,  3, 19,  7, 17},
119
           {10, 16,  6,  7, 17},
120
           { 0, 12,  8, 10, 16},
121
           { 8, 13,  5,  4, 12},
122
           { 1, 13,  8, 10, 17},
123
           { 2, 14,  9, 11, 18},
124
         };
125
    }
126

    
127
///////////////////////////////////////////////////////////////////////////////////////////////////
128
// the quadruple ( corner1, corner2, face1, face2 ) defining an edge.
129
// In fact the 2 corners already define it, the faces only provide easy
130
// way to get to know the colors. Order: arbitrary. Face1 arbitrarily on
131
// the 'left' or right of vector corner1 --> corner2, according to Quat.
132

    
133
  void initializeEdgeMap()
134
    {
135
    mEdgeMap = new int[][]
136
         {
137
           {  0, 12,  0,  8}, //0
138
           { 12,  4,  0,  9},
139
           {  4, 14,  0,  4},
140
           { 14,  2,  0, 11},
141
           {  2,  0,  0,  1},
142
           { 14,  9, 11,  4}, //5
143
           {  9, 11, 11,  3},
144
           { 11, 18, 11,  2},
145
           { 18,  2, 11,  1},
146
           { 18,  6,  1,  2},
147
           {  6, 16,  1,  7}, //10
148
           { 16,  0,  1,  8},
149
           { 16, 10,  8,  7},
150
           { 10,  8,  8, 10},
151
           {  8, 12,  8,  9},
152
           {  8, 13,  9, 10}, //15
153
           { 13,  5,  9,  5},
154
           {  5,  4,  9,  4},
155
           {  5, 15,  4,  5},
156
           { 15,  9,  4,  3},
157
           { 11, 19,  2,  3}, //20
158
           { 19,  7,  2,  6},
159
           {  7,  6,  2,  7},
160
           {  7, 17,  7,  6},
161
           { 17, 10,  7, 10},
162
           { 17,  1, 10,  6}, //25
163
           {  1,  3,  5,  6},
164
           {  3, 19,  3,  6},
165
           {  1, 13, 10,  5},
166
           {  3, 15,  5,  3},
167
         };
168
    }
169

    
170
///////////////////////////////////////////////////////////////////////////////////////////////////
171

    
172
  void initializeQuatIndices()
173
    {
174
    mQuatEdgeIndices = new int[]
175
      {
176
        56, 40, 43, 59,  0, 19,  9, 54, 58, 49,
177
        48, 24, 52,  4, 16, 32, 20, 11, 21, 35,
178
        37, 30,  8, 28, 36, 44,  1, 46, 12, 47
179
      };
180
    mQuatCornerIndices = new int[]
181
      {
182
         0,  2,  3,  1, 40, 31, 41, 30, 39, 35,
183
        36, 34, 56, 32, 43, 21, 48, 28, 42, 23
184
      };
185
    }
186

    
187
///////////////////////////////////////////////////////////////////////////////////////////////////
188

    
189
  void initializeQuats()
190
    {
191
    mQuats = new Static4D[]
192
         {
193
         new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),  //0
194
         new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
195
         new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
196
         new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
197

    
198
         new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),  //4
199
         new Static4D(  0.5f,  0.5f, -0.5f,  0.5f ),
200
         new Static4D(  0.5f, -0.5f,  0.5f,  0.5f ),
201
         new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
202
         new Static4D( -0.5f,  0.5f,  0.5f,  0.5f ),
203
         new Static4D( -0.5f,  0.5f, -0.5f,  0.5f ),
204
         new Static4D( -0.5f, -0.5f,  0.5f,  0.5f ),
205
         new Static4D( -0.5f, -0.5f, -0.5f,  0.5f ),
206

    
207
         new Static4D(  0.5f, SIN54, SIN18,  0.0f ), // 12
208
         new Static4D(  0.5f, SIN54,-SIN18,  0.0f ),
209
         new Static4D(  0.5f,-SIN54, SIN18,  0.0f ),
210
         new Static4D(  0.5f,-SIN54,-SIN18,  0.0f ),
211
         new Static4D( SIN18,  0.5f, SIN54,  0.0f ),
212
         new Static4D( SIN18,  0.5f,-SIN54,  0.0f ),
213
         new Static4D(-SIN18,  0.5f, SIN54,  0.0f ),
214
         new Static4D(-SIN18,  0.5f,-SIN54,  0.0f ),
215
         new Static4D( SIN54, SIN18,  0.5f,  0.0f ),
216
         new Static4D( SIN54,-SIN18,  0.5f,  0.0f ),
217
         new Static4D(-SIN54, SIN18,  0.5f,  0.0f ),
218
         new Static4D(-SIN54,-SIN18,  0.5f,  0.0f ),
219

    
220
         new Static4D(  0.0f, SIN18, SIN54,  0.5f ), //24
221
         new Static4D(  0.0f, SIN18,-SIN54,  0.5f ),
222
         new Static4D(  0.0f,-SIN18, SIN54,  0.5f ),
223
         new Static4D(  0.0f,-SIN18,-SIN54,  0.5f ),
224
         new Static4D( SIN18, SIN54,  0.0f,  0.5f ),
225
         new Static4D( SIN18,-SIN54,  0.0f,  0.5f ),
226
         new Static4D(-SIN18, SIN54,  0.0f,  0.5f ),
227
         new Static4D(-SIN18,-SIN54,  0.0f,  0.5f ),
228
         new Static4D( SIN54,  0.0f, SIN18,  0.5f ),
229
         new Static4D( SIN54,  0.0f,-SIN18,  0.5f ),
230
         new Static4D(-SIN54,  0.0f, SIN18,  0.5f ),
231
         new Static4D(-SIN54,  0.0f,-SIN18,  0.5f ),
232

    
233
         new Static4D(  0.0f, SIN54,  0.5f, SIN18 ), //36
234
         new Static4D(  0.0f, SIN54, -0.5f, SIN18 ),
235
         new Static4D(  0.0f,-SIN54,  0.5f, SIN18 ),
236
         new Static4D(  0.0f,-SIN54, -0.5f, SIN18 ),
237
         new Static4D(  0.5f,  0.0f, SIN54, SIN18 ),
238
         new Static4D(  0.5f,  0.0f,-SIN54, SIN18 ),
239
         new Static4D( -0.5f,  0.0f, SIN54, SIN18 ),
240
         new Static4D( -0.5f,  0.0f,-SIN54, SIN18 ),
241
         new Static4D( SIN54,  0.5f,  0.0f, SIN18 ),
242
         new Static4D( SIN54, -0.5f,  0.0f, SIN18 ),
243
         new Static4D(-SIN54,  0.5f,  0.0f, SIN18 ),
244
         new Static4D(-SIN54, -0.5f,  0.0f, SIN18 ),
245

    
246
         new Static4D(  0.0f,  0.5f, SIN18, SIN54 ), //48
247
         new Static4D(  0.0f,  0.5f,-SIN18, SIN54 ),
248
         new Static4D(  0.0f, -0.5f, SIN18, SIN54 ),
249
         new Static4D(  0.0f, -0.5f,-SIN18, SIN54 ),
250
         new Static4D(  0.5f, SIN18,  0.0f, SIN54 ),
251
         new Static4D(  0.5f,-SIN18,  0.0f, SIN54 ),
252
         new Static4D( -0.5f, SIN18,  0.0f, SIN54 ),
253
         new Static4D( -0.5f,-SIN18,  0.0f, SIN54 ),
254
         new Static4D( SIN18,  0.0f,  0.5f, SIN54 ),
255
         new Static4D( SIN18,  0.0f, -0.5f, SIN54 ),
256
         new Static4D(-SIN18,  0.0f,  0.5f, SIN54 ),
257
         new Static4D(-SIN18,  0.0f, -0.5f, SIN54 ),
258
         };
259
    }
260

    
261
///////////////////////////////////////////////////////////////////////////////////////////////////
262
// Coordinates of all 20 corners of a Minx
263

    
264
  void initializeCorners()
265
    {
266
    float cA = 1.5f;
267
    float cB = 3*C2;
268
    float cC = 3*SIN54;
269

    
270
    mCorners = new float[][]
271
         {
272
             {  0, cA, cB},
273
             {  0, cA,-cB},
274
             {  0,-cA, cB},
275
             {  0,-cA,-cB},
276
             { cB,  0, cA},
277
             { cB,  0,-cA},
278
             {-cB,  0, cA},
279
             {-cB,  0,-cA},
280
             { cA, cB,  0},
281
             { cA,-cB,  0},
282
             {-cA, cB,  0},
283
             {-cA,-cB,  0},
284
             { cC, cC, cC},
285
             { cC, cC,-cC},
286
             { cC,-cC, cC},
287
             { cC,-cC,-cC},
288
             {-cC, cC, cC},
289
             {-cC, cC,-cC},
290
             {-cC,-cC, cC},
291
             {-cC,-cC,-cC},
292
         };
293
    }
294

    
295
///////////////////////////////////////////////////////////////////////////////////////////////////
296

    
297
  void initializeCenterCoords()
298
    {
299
    if( mCorners==null ) initializeCorners();
300
    if( mCenterMap==null ) initializeCenterMap();
301

    
302
    mCenterCoords = new float[NUM_CENTERS][3];
303

    
304
    for(int center=0; center<NUM_CENTERS; center++)
305
      {
306
      int[] map = mCenterMap[center];
307

    
308
      float x = mCorners[map[0]][0] +
309
                mCorners[map[1]][0] +
310
                mCorners[map[2]][0] +
311
                mCorners[map[3]][0] +
312
                mCorners[map[4]][0] ;
313

    
314
      float y = mCorners[map[0]][1] +
315
                mCorners[map[1]][1] +
316
                mCorners[map[2]][1] +
317
                mCorners[map[3]][1] +
318
                mCorners[map[4]][1] ;
319

    
320
      float z = mCorners[map[0]][2] +
321
                mCorners[map[1]][2] +
322
                mCorners[map[2]][2] +
323
                mCorners[map[3]][2] +
324
                mCorners[map[4]][2] ;
325

    
326
      mCenterCoords[center][0] = x/5;
327
      mCenterCoords[center][1] = y/5;
328
      mCenterCoords[center][2] = z/5;
329
      }
330
    }
331

    
332
///////////////////////////////////////////////////////////////////////////////////////////////////
333

    
334
  private int[] generateL(int numLayers, int index)
335
    {
336
    int rows = (numLayers-1)/2;
337
    int[] ret = new int[3*4*rows];
338

    
339
    for(int i=0; i<rows; i++)
340
      {
341
      ret[12*i   ] = i;
342
      ret[12*i+ 1] =-2;
343
      ret[12*i+ 2] = index;
344
      ret[12*i+ 3] = i;
345
      ret[12*i+ 4] =-1;
346
      ret[12*i+ 5] = index;
347
      ret[12*i+ 6] = i;
348
      ret[12*i+ 7] =+1;
349
      ret[12*i+ 8] = index;
350
      ret[12*i+ 9] = i;
351
      ret[12*i+10] =+2;
352
      ret[12*i+11] = index;
353
      }
354

    
355
    return ret;
356
    }
357

    
358
///////////////////////////////////////////////////////////////////////////////////////////////////
359

    
360
  private int[] generateR(int numLayers, int index)
361
    {
362
    int rows = (numLayers-1)/2;
363
    int[] ret = new int[3*4*rows];
364

    
365
    for(int i=0; i<rows; i++)
366
      {
367
      int lay = rows+i+1;
368

    
369
      ret[12*i   ] = lay;
370
      ret[12*i+ 1] =-2;
371
      ret[12*i+ 2] = index;
372
      ret[12*i+ 3] = lay;
373
      ret[12*i+ 4] =-1;
374
      ret[12*i+ 5] = index;
375
      ret[12*i+ 6] = lay;
376
      ret[12*i+ 7] =+1;
377
      ret[12*i+ 8] = index;
378
      ret[12*i+ 9] = lay;
379
      ret[12*i+10] =+2;
380
      ret[12*i+11] = index;
381
      }
382

    
383
    return ret;
384
    }
385

    
386
///////////////////////////////////////////////////////////////////////////////////////////////////
387

    
388
  private int[] generateB(int numLayers, int index)
389
    {
390
    int rows = (numLayers-1);
391
    int half = rows/2;
392
    int[] ret = new int[3*4*rows];
393

    
394
    for(int i=0; i<rows; i++)
395
      {
396
      int ind = i<half? index : index+1;
397
      int lay = i<half? i : i+1;
398

    
399
      ret[12*i   ] = lay;
400
      ret[12*i+ 1] =-2;
401
      ret[12*i+ 2] = ind;
402
      ret[12*i+ 3] = lay;
403
      ret[12*i+ 4] =-1;
404
      ret[12*i+ 5] = ind;
405
      ret[12*i+ 6] = lay;
406
      ret[12*i+ 7] =+1;
407
      ret[12*i+ 8] = ind;
408
      ret[12*i+ 9] = lay;
409
      ret[12*i+10] =+2;
410
      ret[12*i+11] = ind;
411
      }
412

    
413
    return ret;
414
    }
415

    
416
///////////////////////////////////////////////////////////////////////////////////////////////////
417

    
418
  private void initializeScrambleStates(int numLayers)
419
    {
420
    int[] LEFT0 = generateL(numLayers,1);
421
    int[] RIGH0 = generateR(numLayers,2);
422
    int[] LEFT1 = generateL(numLayers,3);
423
    int[] RIGH1 = generateR(numLayers,4);
424
    int[] LEFT2 = generateL(numLayers,5);
425
    int[] RIGH2 = generateR(numLayers,6);
426
    int[] LEFT3 = generateL(numLayers,7);
427
    int[] RIGH3 = generateR(numLayers,8);
428
    int[] LEFT4 = generateL(numLayers,9);
429
    int[] RIGH4 = generateR(numLayers,10);
430
    int[] LEFT5 = generateL(numLayers,11);
431
    int[] RIGH5 = generateR(numLayers,12);
432

    
433
    int[] BOTH1 = generateB(numLayers,1);
434
    int[] BOTH3 = generateB(numLayers,3);
435
    int[] BOTH5 = generateB(numLayers,5);
436
    int[] BOTH7 = generateB(numLayers,7);
437
    int[] BOTH9 = generateB(numLayers,9);
438
    int[] BOTH11= generateB(numLayers,11);
439

    
440
    mStates = new ScrambleState[]
441
      {
442
      new ScrambleState( new int[][] { BOTH1,BOTH3,BOTH5,BOTH7,BOTH9,BOTH11 } ), // beg
443
      new ScrambleState( new int[][] { {}   ,RIGH1,LEFT2,RIGH3,LEFT4,LEFT5  } ), // 0L
444
      new ScrambleState( new int[][] { {}   ,LEFT1,RIGH2,LEFT3,RIGH4,RIGH5  } ), // 0R
445
      new ScrambleState( new int[][] { RIGH0,{}   ,LEFT2,RIGH3,RIGH4,RIGH5  } ), // 1L
446
      new ScrambleState( new int[][] { LEFT0,{}   ,RIGH2,LEFT3,LEFT4,LEFT5  } ), // 1R
447
      new ScrambleState( new int[][] { LEFT0,LEFT1,{}   ,RIGH3,LEFT4,RIGH5  } ), // 2L
448
      new ScrambleState( new int[][] { RIGH0,RIGH1,{}   ,LEFT3,RIGH4,LEFT5  } ), // 2R
449
      new ScrambleState( new int[][] { RIGH0,RIGH1,RIGH2,{}   ,LEFT4,RIGH5  } ), // 3L
450
      new ScrambleState( new int[][] { LEFT0,LEFT1,LEFT2,{}   ,RIGH4,LEFT5  } ), // 3R
451
      new ScrambleState( new int[][] { LEFT0,RIGH1,LEFT2,LEFT3,{}   ,RIGH5  } ), // 4L
452
      new ScrambleState( new int[][] { RIGH0,LEFT1,RIGH2,RIGH3,{}   ,LEFT5  } ), // 4R
453
      new ScrambleState( new int[][] { LEFT0,RIGH1,RIGH2,RIGH3,RIGH4,{}     } ), // 5L
454
      new ScrambleState( new int[][] { RIGH0,LEFT1,LEFT2,LEFT3,LEFT4,{}     } ), // 5R
455
      };
456
    }
457

    
458
///////////////////////////////////////////////////////////////////////////////////////////////////
459

    
460
  public int[] getSolvedQuats(int cubit, int[] numLayers)
461
    {
462
    if( mQuats==null ) initializeQuats();
463
    if( mFaceMap==null ) mFaceMap = new int[] {8,10,3,7,1,9,11,2,4,0,5,6};
464
    int status = retCubitSolvedStatus(cubit,numLayers);
465
    return status<0 ? null : buildSolvedQuats(TouchControlDodecahedron.FACE_AXIS[mFaceMap[status]],mQuats);
466
    }
467

    
468
///////////////////////////////////////////////////////////////////////////////////////////////////
469

    
470
  public Static4D[] getQuats()
471
    {
472
    if( mQuats==null ) initializeQuats();
473
    return mQuats;
474
    }
475

    
476
///////////////////////////////////////////////////////////////////////////////////////////////////
477

    
478
  float[][] genericGetCuts(int numLayers, float dist)
479
    {
480
    if( mCuts==null )
481
      {
482
      mCuts = new float[6][numLayers-1];
483
      float D = numLayers* TouchControlDodecahedron.DIST3D;
484
      float X = 2*D/(2+SIN18);  // height of the 'upper' part of a dodecahedron, i.e. put it on a table,
485
                                // its height is then 2D, it has one 'lower' part of height X, one
486
                                // 'middle' part of height Y and one upper part of height X again.
487
      int num = (numLayers-1)/2;
488
      float G = X*dist/num;     // height of one Layer
489

    
490
      for(int i=0; i<num; i++)
491
        {
492
        float cut = -D + (i+0.85f)*G;  // 0.85? not fully correct; attempt to make it
493
                                       // easier to rotate the outer layers
494
        int j = 2*num-1-i;
495
        mCuts[0][i] = +cut;
496
        mCuts[0][j] = -cut;
497
        mCuts[1][i] = +cut;
498
        mCuts[1][j] = -cut;
499
        mCuts[2][i] = +cut;
500
        mCuts[2][j] = -cut;
501
        mCuts[3][i] = +cut;
502
        mCuts[3][j] = -cut;
503
        mCuts[4][i] = +cut;
504
        mCuts[4][j] = -cut;
505
        mCuts[5][i] = +cut;
506
        mCuts[5][j] = -cut;
507
        }
508
      }
509

    
510
    return mCuts;
511
    }
512

    
513
///////////////////////////////////////////////////////////////////////////////////////////////////
514

    
515
  public boolean[][] getLayerRotatable(int[] numLayers)
516
    {
517
    int numAxis = ROT_AXIS.length;
518
    boolean[][] layerRotatable = new boolean[numAxis][];
519

    
520
    for(int i=0; i<numAxis; i++)
521
      {
522
      layerRotatable[i] = new boolean[numLayers[i]];
523
      for(int j=0; j<numLayers[i]; j++) layerRotatable[i][j] = true;
524
      layerRotatable[i][numLayers[i]/2] = false;
525
      }
526

    
527
    return layerRotatable;
528
    }
529

    
530
///////////////////////////////////////////////////////////////////////////////////////////////////
531

    
532
  public int getTouchControlType()
533
    {
534
    return TC_DODECAHEDRON;
535
    }
536

    
537
///////////////////////////////////////////////////////////////////////////////////////////////////
538

    
539
  public int getTouchControlSplit()
540
    {
541
    return TYPE_SPLIT_EDGE;
542
    }
543

    
544
///////////////////////////////////////////////////////////////////////////////////////////////////
545

    
546
  public int[][][] getEnabled()
547
    {
548
    return new int[][][]
549
      {
550
          {{2,3},{3,5},{1,5},{1,4},{2,4}},
551
          {{0,5},{2,5},{2,3},{3,4},{0,4}},
552
          {{2,3},{2,5},{0,5},{0,4},{3,4}},
553
          {{1,5},{3,5},{2,3},{2,4},{1,4}},
554
          {{0,3},{0,4},{4,5},{1,5},{1,3}},
555
          {{1,2},{1,4},{4,5},{0,5},{0,2}},
556
          {{4,5},{1,4},{1,2},{0,2},{0,5}},
557
          {{4,5},{0,4},{0,3},{1,3},{1,5}},
558
          {{0,2},{0,1},{1,3},{3,5},{2,5}},
559
          {{3,4},{2,4},{1,2},{0,1},{0,3}},
560
          {{2,4},{3,4},{0,3},{0,1},{1,2}},
561
          {{1,3},{0,1},{0,2},{2,5},{3,5}},
562
      };
563
    }
564

    
565
///////////////////////////////////////////////////////////////////////////////////////////////////
566

    
567
  public float[] getDist3D(int[] numLayers)
568
    {
569
    return TouchControlDodecahedron.D3D;
570
    }
571

    
572
///////////////////////////////////////////////////////////////////////////////////////////////////
573

    
574
  public Static3D[] getFaceAxis()
575
    {
576
    return TouchControlDodecahedron.FACE_AXIS;
577
    }
578

    
579
///////////////////////////////////////////////////////////////////////////////////////////////////
580

    
581
  public int getSolvedFunctionIndex()
582
    {
583
    return 0;
584
    }
585

    
586
///////////////////////////////////////////////////////////////////////////////////////////////////
587
// PUBLIC API
588

    
589
  public Static3D[] getRotationAxis()
590
    {
591
    return ROT_AXIS;
592
    }
593

    
594
///////////////////////////////////////////////////////////////////////////////////////////////////
595

    
596
  public int[] getBasicAngle()
597
    {
598
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 5,5,5,5,5,5 };
599
    return mBasicAngle;
600
    }
601
}
(16-16/26)