Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyMirror.java @ 55fa6993

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 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.main.Movement.MOVEMENT_HEXAHEDRON;
23
import static org.distorted.objectlib.main.Movement.TYPE_NOT_SPLIT;
24

    
25
import android.content.res.Resources;
26

    
27
import org.distorted.library.main.DistortedEffects;
28
import org.distorted.library.main.DistortedTexture;
29
import org.distorted.library.mesh.MeshSquare;
30
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32

    
33
import org.distorted.objectlib.R;
34
import org.distorted.objectlib.main.ObjectControl;
35
import org.distorted.objectlib.main.ObjectType;
36
import org.distorted.objectlib.helpers.ObjectShape;
37
import org.distorted.objectlib.helpers.ObjectSticker;
38
import org.distorted.objectlib.helpers.ScrambleState;
39
import org.distorted.objectlib.main.Twisty6;
40

    
41
///////////////////////////////////////////////////////////////////////////////////////////////////
42

    
43
public class TwistyMirror extends Twisty6
44
{
45
  static final Static3D[] ROT_AXIS = new Static3D[]
46
         {
47
           new Static3D(1,0,0),
48
           new Static3D(0,1,0),
49
           new Static3D(0,0,1)
50
         };
51

    
52
  private static final int[] FACE_COLORS = new int[] { COLOR_WHITE };
53
  private static final float DX = 0.10f;
54
  private static final float DY = 0.25f;
55
  private static final float DZ = 0.40f;
56

    
57
  private static final float[][] SEQ2 = new float[][]
58
      {
59
          {1-DX,1-DY},{1+DX,1-DY},{1-DX,1+DY},{1+DX,1+DY},
60
          {1-DX,1-DZ},{1+DX,1-DZ},{1-DX,1+DZ},{1+DX,1+DZ},
61
          {1-DZ,1-DY},{1+DZ,1-DY},{1-DZ,1+DY},{1+DZ,1+DY},
62
      };
63

    
64
  private static final float[][] SEQ3 = new float[][]
65
      {
66
          {1   ,1   },{1-DX,1-DY},{1   ,1-DY},{1+DX,1-DY},{1-DX,1   },
67
          {1+DX,1   },{1-DX,1+DY},{1   ,1+DY},{1+DX,1+DY},{1-DX,1-DZ},
68
          {1   ,1-DZ},{1+DX,1-DZ},{1-DX,1   },{1+DX,1   },{1-DX,1+DZ},
69
          {1   ,1+DZ},{1+DX,1+DZ},{1-DZ,1-DY},{1   ,1-DY},{1+DZ,1-DY},
70
          {1-DZ,1   },{1+DZ,1   },{1-DZ,1+DY},{1   ,1+DY},{1+DZ,1+DY},
71
      };
72

    
73
  private ScrambleState[] mStates;
74
  private Static4D[] mQuats;
75
  private float[][] mCuts;
76
  private int[] mBasicAngle;
77
  private ObjectSticker[] mStickers;
78
  private float[][] mPositions;
79

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

    
82
  public TwistyMirror(int[] numL, Static4D quat, Static3D move, DistortedTexture texture,
83
                      MeshSquare mesh, DistortedEffects effects, Resources res, int surfaceW, int surfaceH)
84
    {
85
    super(numL, numL[0], quat, move, texture, mesh, effects, res, surfaceW, surfaceH);
86
    }
87

    
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89

    
90
  public ScrambleState[] getScrambleStates()
91
    {
92
    if( mStates==null )
93
      {
94
      int[] numLayers = getNumLayers();
95
      int[][] m = new int[16][];
96
      for(int i=1; i<16; i++) m[i] = createEdges(numLayers[0],i);
97

    
98
      mStates = new ScrambleState[]
99
        {
100
        new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ),  // 0
101
        new ScrambleState( new int[][] {  null, m[ 4], m[ 5] } ),  // x
102
        new ScrambleState( new int[][] { m[ 6],  null, m[ 7] } ),  // y
103
        new ScrambleState( new int[][] { m[ 8], m[ 8],  null } ),  // z
104
        new ScrambleState( new int[][] { m[10],  null, m[ 7] } ),  // xy
105
        new ScrambleState( new int[][] { m[11], m[ 9],  null } ),  // xz
106
        new ScrambleState( new int[][] {  null, m[12], m[ 5] } ),  // yx
107
        new ScrambleState( new int[][] { m[ 8], m[13],  null } ),  // yz
108
        new ScrambleState( new int[][] {  null, m[ 4], m[14] } ),  // zx
109
        new ScrambleState( new int[][] { m[ 6],  null, m[15] } ),  // zy
110
        new ScrambleState( new int[][] {  null,  null, m[ 5] } ),  // xyx
111
        new ScrambleState( new int[][] {  null, m[ 4],  null } ),  // xzx
112
        new ScrambleState( new int[][] {  null,  null, m[ 7] } ),  // yxy
113
        new ScrambleState( new int[][] { m[ 6],  null,  null } ),  // yzy
114
        new ScrambleState( new int[][] {  null, m[ 9],  null } ),  // zxz
115
        new ScrambleState( new int[][] { m[ 8],  null,  null } ),  // zyz
116
        };
117
      }
118

    
119
    return mStates;
120
    }
121

    
122
///////////////////////////////////////////////////////////////////////////////////////////////////
123

    
124
  protected int getResource(int[] numLayers)
125
    {
126
    switch(numLayers[0])
127
      {
128
      case 2: return R.raw.mirr_2;
129
      case 3: return R.raw.mirr_3;
130
      }
131

    
132
    return 0;
133
    }
134

    
135
///////////////////////////////////////////////////////////////////////////////////////////////////
136

    
137
  private int[] createEdges(int size, int vertex)
138
    {
139
    int[] ret = new int[9*size];
140

    
141
    for(int l=0; l<size; l++)
142
      {
143
      ret[9*l  ] = l;
144
      ret[9*l+1] =-1;
145
      ret[9*l+2] = vertex;
146
      ret[9*l+3] = l;
147
      ret[9*l+4] = 1;
148
      ret[9*l+5] = vertex;
149
      ret[9*l+6] = l;
150
      ret[9*l+7] = 2;
151
      ret[9*l+8] = vertex;
152
      }
153

    
154
    return ret;
155
    }
156

    
157
///////////////////////////////////////////////////////////////////////////////////////////////////
158

    
159
  private void initializeQuats()
160
    {
161
    mQuats = new Static4D[]
162
         {
163
         new Static4D(  0.0f,   0.0f,   0.0f,   1.0f),
164
         new Static4D(  1.0f,   0.0f,   0.0f,   0.0f),
165
         new Static4D(  0.0f,   1.0f,   0.0f,   0.0f),
166
         new Static4D(  0.0f,   0.0f,   1.0f,   0.0f),
167

    
168
         new Static4D( SQ2/2,  SQ2/2,  0.0f ,   0.0f),
169
         new Static4D( SQ2/2, -SQ2/2,  0.0f ,   0.0f),
170
         new Static4D( SQ2/2,   0.0f,  SQ2/2,   0.0f),
171
         new Static4D(-SQ2/2,   0.0f,  SQ2/2,   0.0f),
172
         new Static4D( SQ2/2,   0.0f,   0.0f,  SQ2/2),
173
         new Static4D( SQ2/2,   0.0f,   0.0f, -SQ2/2),
174
         new Static4D(  0.0f,  SQ2/2,  SQ2/2,   0.0f),
175
         new Static4D(  0.0f,  SQ2/2, -SQ2/2,   0.0f),
176
         new Static4D(  0.0f,  SQ2/2,   0.0f,  SQ2/2),
177
         new Static4D(  0.0f,  SQ2/2,   0.0f, -SQ2/2),
178
         new Static4D(  0.0f,   0.0f,  SQ2/2,  SQ2/2),
179
         new Static4D(  0.0f,   0.0f,  SQ2/2, -SQ2/2),
180

    
181
         new Static4D(  0.5f,   0.5f,   0.5f,   0.5f),
182
         new Static4D(  0.5f,   0.5f,  -0.5f,   0.5f),
183
         new Static4D(  0.5f,   0.5f,  -0.5f,  -0.5f),
184
         new Static4D(  0.5f,  -0.5f,   0.5f,  -0.5f),
185
         new Static4D( -0.5f,  -0.5f,  -0.5f,   0.5f),
186
         new Static4D( -0.5f,   0.5f,  -0.5f,  -0.5f),
187
         new Static4D( -0.5f,   0.5f,   0.5f,  -0.5f),
188
         new Static4D( -0.5f,   0.5f,   0.5f,   0.5f)
189
         };
190
    }
191

    
192
///////////////////////////////////////////////////////////////////////////////////////////////////
193
// we cannot do this the standard, automatic way because there's only 1 color in the FACE_COLORS
194
// table and retCubitSolvedStatus() always returns -1,-1 or 0.
195

    
196
  public int[] getSolvedQuats(int cubit, int[] numLayers)
197
    {
198
    if( numLayers[0]==3 )
199
      {
200
      switch(cubit)
201
        {
202
        case  4:
203
        case 21: return new int[] {1,8,9};
204
        case 10:
205
        case 15: return new int[] {2,12,13};
206
        case 12:
207
        case 13: return new int[] {3,14,15};
208
        }
209
      }
210

    
211
    return null;
212
    }
213

    
214
///////////////////////////////////////////////////////////////////////////////////////////////////
215

    
216
  public int getCubitFaceColor(int cubit, int face, int[] numLayers)
217
    {
218
    return 0;
219
    }
220

    
221
///////////////////////////////////////////////////////////////////////////////////////////////////
222

    
223
  public int getVariantFaceColor(int variant, int face, int[] numLayers)
224
    {
225
    int numL = numLayers[0];
226

    
227
    if( numL==2 )
228
      {
229
      switch(face)
230
        {
231
        case 0: if( variant==4 ) return 11;
232
                if( variant==5 ) return 10;
233
                if( variant==6 ) return  9;
234
                if( variant==7 ) return  8;
235
                return -1;
236
        case 1: if( variant==0 ) return 11;
237
                if( variant==1 ) return 10;
238
                if( variant==2 ) return  9;
239
                if( variant==3 ) return  8;
240
                return -1;
241
        case 2: if( variant==3 ) return  4;
242
                if( variant==7 ) return  5;
243
                if( variant==2 ) return  6;
244
                if( variant==6 ) return  7;
245
                return -1;
246
        case 3: if( variant==1 ) return  4;
247
                if( variant==5 ) return  5;
248
                if( variant==0 ) return  6;
249
                if( variant==4 ) return  7;
250
                return -1;
251
        case 4: if( variant==3 ) return  0;
252
                if( variant==7 ) return  1;
253
                if( variant==1 ) return  2;
254
                if( variant==5 ) return  3;
255
                return -1;
256
        case 5: if( variant==2 ) return  0;
257
                if( variant==6 ) return  1;
258
                if( variant==0 ) return  2;
259
                if( variant==4 ) return  3;
260
                return -1;
261
        }
262
      }
263
    if( numL==3 )
264
      {
265
      switch(face)
266
        {
267
        case 0: if( variant==17 ) return 24;
268
                if( variant==18 ) return 23;
269
                if( variant==19 ) return 22;
270
                if( variant==20 ) return 21;
271
                if( variant==21 ) return  0;
272
                if( variant==22 ) return 20;
273
                if( variant==23 ) return 19;
274
                if( variant==24 ) return 18;
275
                if( variant==25 ) return 17;
276
                return -1;
277
        case 1: if( variant== 0 ) return 24;
278
                if( variant== 1 ) return 23;
279
                if( variant== 2 ) return 22;
280
                if( variant== 3 ) return 21;
281
                if( variant== 4 ) return  0;
282
                if( variant== 5 ) return 20;
283
                if( variant== 6 ) return 19;
284
                if( variant== 7 ) return 18;
285
                if( variant== 8 ) return 17;
286
                return -1;
287
        case 2: if( variant== 6 ) return 14;
288
                if( variant==14 ) return  2; // theoretically should have been 15, but this must have gotten collapsed in the Factory
289
                if( variant==23 ) return 16;
290
                if( variant== 7 ) return 12;
291
                if( variant==15 ) return  0;
292
                if( variant==24 ) return 13;
293
                if( variant== 8 ) return  9;
294
                if( variant==16 ) return 20; // ditto, theoretically 10
295
                if( variant==25 ) return 11;
296
                return -1;
297
        case 3: if( variant== 0 ) return 14;
298
                if( variant== 9 ) return  2; // ditto, theoretically 15
299
                if( variant==17 ) return 16;
300
                if( variant== 1 ) return 12;
301
                if( variant==10 ) return  0;
302
                if( variant==18 ) return 13;
303
                if( variant== 2 ) return  9;
304
                if( variant==11 ) return 20; // ditto, theoretically 10
305
                if( variant==19 ) return 11;
306
                return -1;
307
        case 4: if( variant== 8 ) return  1;
308
                if( variant==16 ) return  2;
309
                if( variant==25 ) return  3;
310
                if( variant== 5 ) return  4;
311
                if( variant==13 ) return  0;
312
                if( variant==22 ) return  5;
313
                if( variant== 2 ) return  6;
314
                if( variant==11 ) return  7;
315
                if( variant==19 ) return  8;
316
                return -1;
317
        case 5: if( variant== 6 ) return  1;
318
                if( variant==14 ) return  2;
319
                if( variant==23 ) return  3;
320
                if( variant== 3 ) return  4;
321
                if( variant==12 ) return  0;
322
                if( variant==20 ) return  5;
323
                if( variant== 0 ) return  6;
324
                if( variant== 9 ) return  7;
325
                if( variant==17 ) return  8;
326
                return -1;
327
        }
328
      }
329

    
330
    return 0;
331
    }
332

    
333
///////////////////////////////////////////////////////////////////////////////////////////////////
334

    
335
  private float returnStroke(float x, float y)
336
    {
337
    return 0.08f/(Math.max(x,y));
338
    }
339

    
340
///////////////////////////////////////////////////////////////////////////////////////////////////
341

    
342
  private float[] generateStrokes(int numLayers)
343
    {
344
    if( numLayers==2 )
345
      {
346
      int LEN = SEQ2.length;
347
      float[] tmp = new float[LEN];
348
      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ2[i][0],SEQ2[i][1]);
349
      return tmp;
350
      }
351
    else
352
      {
353
      int LEN = SEQ3.length;
354
      float[] tmp = new float[LEN];
355
      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ3[i][0],SEQ3[i][1]);
356
      return tmp;
357
      }
358
    }
359

    
360
///////////////////////////////////////////////////////////////////////////////////////////////////
361

    
362
  private float[] returnSticker(float x, float y)
363
    {
364
      float H = 0.5f;
365

    
366
      if( x<y ) { float D=H*x/y; return new float[] {-D,-H,+D,-H,+D,+H,-D,+H}; }
367
      else      { float D=H*y/x; return new float[] {-H,-D,+H,-D,+H,+D,-H,+D}; }
368
    }
369

    
370
///////////////////////////////////////////////////////////////////////////////////////////////////
371

    
372
  private float[][] generateStickers(int numLayers)
373
    {
374
    if( numLayers==2 )
375
      {
376
      int LEN = SEQ2.length;
377
      float[][] tmp = new float[LEN][];
378
      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ2[i][0],SEQ2[i][1]);
379
      return tmp;
380
      }
381
    else
382
      {
383
      int LEN = SEQ3.length;
384
      float[][] tmp = new float[LEN][];
385
      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ3[i][0],SEQ3[i][1]);
386
      return tmp;
387
      }
388
    }
389

    
390
///////////////////////////////////////////////////////////////////////////////////////////////////
391

    
392
  public ObjectSticker retSticker(int sticker)
393
    {
394
    if( mStickers==null )
395
      {
396
      int[] numLayers = getNumLayers();
397
      int numL = numLayers[0];
398
      final float[][] STICKERS = generateStickers(numL);
399
      final int NUM_STICKERS = STICKERS.length;
400
      final float radius = 0.10f;
401
      final float[] radii = {radius,radius,radius,radius};
402
      float[] STROKES = generateStrokes(numL);
403

    
404
      if( ObjectControl.isInIconMode() )
405
        {
406
        int len = STROKES.length;
407
        float mult = numL==2 ? 1.8f: 2.0f;
408
        for(int i=0; i<len; i++) STROKES[i]*=mult;
409
        }
410

    
411
      mStickers = new ObjectSticker[NUM_STICKERS];
412

    
413
      for(int i=0; i<NUM_STICKERS; i++)
414
        {
415
        mStickers[i] = new ObjectSticker(STICKERS[i],null,radii,STROKES[i]);
416
        }
417
      }
418

    
419
    return mStickers[sticker];
420
    }
421

    
422
///////////////////////////////////////////////////////////////////////////////////////////////////
423

    
424
  public int getNumStickerTypes(int[] numLayers)
425
    {
426
    return numLayers[0]==2 ? SEQ2.length : SEQ3.length;
427
    }
428

    
429
///////////////////////////////////////////////////////////////////////////////////////////////////
430

    
431
  private int getRow(int cubit, int numLayers, int dim)
432
    {
433
    return (int)(mPositions[cubit][dim] + 0.5f*(numLayers-1));
434
    }
435

    
436
///////////////////////////////////////////////////////////////////////////////////////////////////
437

    
438
  public ObjectShape getObjectShape(int variant)
439
    {
440
    int extraI, extraV, num, numL = getNumLayers()[0];
441
    float height;
442

    
443
    switch(numL)
444
      {
445
      case 2 : num = 6; extraI = 2; extraV = 2; height = 0.045f; break;
446
      case 3 : num = 5; extraI = 2; extraV = 2; height = 0.045f; break;
447
      case 4 : num = 5; extraI = 1; extraV = 1; height = 0.045f; break;
448
      default: num = 5; extraI = 0; extraV = 0; height = 0.045f; break;
449
      }
450

    
451
    int xrow = getRow(variant,numL,0);  // cubit == variant
452
    int yrow = getRow(variant,numL,1);
453
    int zrow = getRow(variant,numL,2);
454

    
455
    float XL = -0.5f + (xrow==     0 ? DX : 0);
456
    float XR = +0.5f + (xrow==numL-1 ? DX : 0);
457
    float YL = -0.5f - (yrow==     0 ? DY : 0);
458
    float YR = +0.5f - (yrow==numL-1 ? DY : 0);
459
    float ZL = -0.5f - (zrow==     0 ? DZ : 0);
460
    float ZR = +0.5f - (zrow==numL-1 ? DZ : 0);
461

    
462
    double[][] vertices = new double[][]
463
          {
464
              { XR, YR, ZR },
465
              { XR, YR, ZL },
466
              { XR, YL, ZR },
467
              { XR, YL, ZL },
468
              { XL, YR, ZR },
469
              { XL, YR, ZL },
470
              { XL, YL, ZR },
471
              { XL, YL, ZL },
472
          };
473

    
474
    int[][] vert_indices = new int[][]
475
          {
476
              {2,3,1,0},
477
              {7,6,4,5},
478
              {4,0,1,5},
479
              {7,3,2,6},
480
              {6,2,0,4},
481
              {3,7,5,1}
482
          };
483

    
484
    float[][] bands     = new float[][] { {height,35,0.5f,0.7f,num,extraI,extraV} };
485
    int[] bandIndices   = new int[] { 0,0,0,0,0,0};
486
    float[][] corners   = new float[][] { {0.036f,0.12f} };
487
    int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0 };
488
    float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
489
    int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
490

    
491
    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
492
    }
493

    
494
///////////////////////////////////////////////////////////////////////////////////////////////////
495

    
496
  public Static4D getQuat(int cubit, int[] numLayers)
497
    {
498
    if( mQuats ==null ) initializeQuats();
499
    return mQuats[0];
500
    }
501

    
502
///////////////////////////////////////////////////////////////////////////////////////////////////
503

    
504
  public int getNumCubitVariants(int[] numLayers)
505
    {
506
    int numL = numLayers[0];
507
    return 6*numL*numL - 12*numL + 8;
508
    }
509

    
510
///////////////////////////////////////////////////////////////////////////////////////////////////
511

    
512
  public int getCubitVariant(int cubit, int[] numLayers)
513
    {
514
    return cubit;
515
    }
516

    
517
///////////////////////////////////////////////////////////////////////////////////////////////////
518

    
519
  protected int getColor(int face)
520
    {
521
    return FACE_COLORS[face];
522
    }
523

    
524
///////////////////////////////////////////////////////////////////////////////////////////////////
525

    
526
  public float[][] getCubitPositions(int[] numLayers)
527
    {
528
    if( mPositions==null )
529
      {
530
      int numL = numLayers[0];
531
      int numCubits = numL>1 ? 6*numL*numL - 12*numL + 8 : 1;
532
      mPositions = new float[numCubits][];
533

    
534
      float diff = 0.5f*(numL-1);
535
      int currentPosition = 0;
536

    
537
      for(int x = 0; x<numL; x++)
538
        for(int y = 0; y<numL; y++)
539
          for(int z = 0; z<numL; z++)
540
            if( x==0 || x==numL-1 || y==0 || y==numL-1 || z==0 || z==numL-1 )
541
              {
542
              mPositions[currentPosition++] = new float[] {x-diff,y-diff,z-diff};
543
              }
544
      }
545

    
546
    return mPositions;
547
    }
548

    
549
///////////////////////////////////////////////////////////////////////////////////////////////////
550

    
551
  public Static4D[] getQuats()
552
    {
553
    if( mQuats ==null ) initializeQuats();
554
    return mQuats;
555
    }
556

    
557
///////////////////////////////////////////////////////////////////////////////////////////////////
558

    
559
  public int getNumFaceColors()
560
    {
561
    return 1;
562
    }
563

    
564
///////////////////////////////////////////////////////////////////////////////////////////////////
565

    
566
  public float[][] getCuts(int[] numLayers)
567
    {
568
    if( mCuts==null )
569
      {
570
      int numL = numLayers[0];
571
      mCuts = new float[3][numL-1];
572

    
573
      for(int i=0; i<numL-1; i++)
574
        {
575
        float cut = (2-numL)*0.5f + i;
576
        mCuts[0][i] = cut;
577
        mCuts[1][i] = cut;
578
        mCuts[2][i] = cut;
579
        }
580
      }
581

    
582
    return mCuts;
583
    }
584

    
585
///////////////////////////////////////////////////////////////////////////////////////////////////
586

    
587
  public boolean[][] getLayerRotatable(int[] numLayers)
588
    {
589
    int numAxis = ROT_AXIS.length;
590
    boolean[][] layerRotatable = new boolean[numAxis][];
591

    
592
    for(int i=0; i<numAxis; i++)
593
      {
594
      layerRotatable[i] = new boolean[numLayers[i]];
595
      for(int j=0; j<numLayers[i]; j++) layerRotatable[i][j] = true;
596
      }
597

    
598
    return layerRotatable;
599
    }
600

    
601
///////////////////////////////////////////////////////////////////////////////////////////////////
602

    
603
  public int getMovementType()
604
    {
605
    return MOVEMENT_HEXAHEDRON;
606
    }
607

    
608
///////////////////////////////////////////////////////////////////////////////////////////////////
609

    
610
  public int getMovementSplit()
611
    {
612
    return TYPE_NOT_SPLIT;
613
    }
614

    
615
///////////////////////////////////////////////////////////////////////////////////////////////////
616

    
617
  public int[][][] getEnabled()
618
    {
619
    return new int[][][]
620
      {
621
          {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}},
622
      };
623
    }
624

    
625
///////////////////////////////////////////////////////////////////////////////////////////////////
626

    
627
  public float[] getDist3D(int[] numLayers)
628
    {
629
    return null;
630
    }
631

    
632
///////////////////////////////////////////////////////////////////////////////////////////////////
633

    
634
  public int getSolvedFunctionIndex()
635
    {
636
    return 0;
637
    }
638

    
639
///////////////////////////////////////////////////////////////////////////////////////////////////
640

    
641
  public int getNumCubitFaces()
642
    {
643
    return 6;
644
    }
645

    
646
///////////////////////////////////////////////////////////////////////////////////////////////////
647
// PUBLIC API
648

    
649
  public Static3D[] getRotationAxis()
650
    {
651
    return ROT_AXIS;
652
    }
653

    
654
///////////////////////////////////////////////////////////////////////////////////////////////////
655

    
656
  public int[] getBasicAngle()
657
    {
658
    if( mBasicAngle==null ) mBasicAngle = new int[] { 4,4,4 };
659
    return mBasicAngle;
660
    }
661

    
662
///////////////////////////////////////////////////////////////////////////////////////////////////
663

    
664
  public ObjectType intGetObjectType(int[] numLayers)
665
    {
666
    switch(numLayers[0])
667
      {
668
      case 2: return ObjectType.MIRR_2;
669
      case 3: return ObjectType.MIRR_3;
670
      }
671

    
672
    return ObjectType.MIRR_2;
673
    }
674

    
675
///////////////////////////////////////////////////////////////////////////////////////////////////
676

    
677
  public int getObjectName(int[] numLayers)
678
    {
679
    switch(numLayers[0])
680
      {
681
      case 2: return R.string.mirr2;
682
      case 3: return R.string.mirr3;
683
      }
684
    return R.string.mirr3;
685
    }
686

    
687
///////////////////////////////////////////////////////////////////////////////////////////////////
688

    
689
  public int getInventor(int[] numLayers)
690
    {
691
    switch(numLayers[0])
692
      {
693
      case 2: return R.string.mirr2_inventor;
694
      case 3: return R.string.mirr3_inventor;
695
      }
696
    return R.string.mirr3_inventor;
697
    }
698

    
699
///////////////////////////////////////////////////////////////////////////////////////////////////
700

    
701
  public int getYearOfInvention(int[] numLayers)
702
    {
703
    switch(numLayers[0])
704
      {
705
      case 2: return 2007;
706
      case 3: return 2006;
707
      }
708
    return 2006;
709
    }
710

    
711
///////////////////////////////////////////////////////////////////////////////////////////////////
712

    
713
  public int getComplexity(int[] numLayers)
714
    {
715
    switch(numLayers[0])
716
      {
717
      case 2: return 5;
718
      case 3: return 7;
719
      }
720
    return 7;
721
    }
722
}
(17-17/25)