Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyMirror.java @ 43a4ccff

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.mirr2;
129
      case 3: return R.raw.mirr3;
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
  protected int getFaceColor(int cubit, int cubitface, int[] numLayers)
217
    {
218
    int numL = numLayers[0];
219

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

    
323
    return 0;
324
    }
325

    
326
///////////////////////////////////////////////////////////////////////////////////////////////////
327

    
328
  private float returnStroke(float x, float y)
329
    {
330
    return 0.08f/(Math.max(x,y));
331
    }
332

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

    
335
  private float[] generateStrokes(int numLayers)
336
    {
337
    if( numLayers==2 )
338
      {
339
      int LEN = SEQ2.length;
340
      float[] tmp = new float[LEN];
341
      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ2[i][0],SEQ2[i][1]);
342
      return tmp;
343
      }
344
    else
345
      {
346
      int LEN = SEQ3.length;
347
      float[] tmp = new float[LEN];
348
      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ3[i][0],SEQ3[i][1]);
349
      return tmp;
350
      }
351
    }
352

    
353
///////////////////////////////////////////////////////////////////////////////////////////////////
354

    
355
  private float[] returnSticker(float x, float y)
356
    {
357
      float H = 0.5f;
358

    
359
      if( x<y ) { float D=H*x/y; return new float[] {-D,-H,+D,-H,+D,+H,-D,+H}; }
360
      else      { float D=H*y/x; return new float[] {-H,-D,+H,-D,+H,+D,-H,+D}; }
361
    }
362

    
363
///////////////////////////////////////////////////////////////////////////////////////////////////
364

    
365
  private float[][] generateStickers(int numLayers)
366
    {
367
    if( numLayers==2 )
368
      {
369
      int LEN = SEQ2.length;
370
      float[][] tmp = new float[LEN][];
371
      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ2[i][0],SEQ2[i][1]);
372
      return tmp;
373
      }
374
    else
375
      {
376
      int LEN = SEQ3.length;
377
      float[][] tmp = new float[LEN][];
378
      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ3[i][0],SEQ3[i][1]);
379
      return tmp;
380
      }
381
    }
382

    
383
///////////////////////////////////////////////////////////////////////////////////////////////////
384

    
385
  public ObjectSticker retSticker(int sticker)
386
    {
387
    if( mStickers==null )
388
      {
389
      int[] numLayers = getNumLayers();
390
      int numL = numLayers[0];
391
      final float[][] STICKERS = generateStickers(numL);
392
      final int NUM_STICKERS = STICKERS.length;
393
      final float radius = 0.10f;
394
      final float[] radii = {radius,radius,radius,radius};
395
      float[] STROKES = generateStrokes(numL);
396

    
397
      if( ObjectControl.isInIconMode() )
398
        {
399
        int len = STROKES.length;
400
        float mult = numL==2 ? 1.8f: 2.0f;
401
        for(int i=0; i<len; i++) STROKES[i]*=mult;
402
        }
403

    
404
      mStickers = new ObjectSticker[NUM_STICKERS];
405

    
406
      for(int i=0; i<NUM_STICKERS; i++)
407
        {
408
        mStickers[i] = new ObjectSticker(STICKERS[i],null,radii,STROKES[i]);
409
        }
410
      }
411

    
412
    return mStickers[sticker];
413
    }
414

    
415
///////////////////////////////////////////////////////////////////////////////////////////////////
416

    
417
  public int getNumStickerTypes(int[] numLayers)
418
    {
419
    return numLayers[0]==2 ? SEQ2.length : SEQ3.length;
420
    }
421

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

    
424
  private int getRow(int cubit, int numLayers, int dim)
425
    {
426
    return (int)(mPositions[cubit][dim] + 0.5f*(numLayers-1));
427
    }
428

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

    
431
  public ObjectShape getObjectShape(int variant)
432
    {
433
    int extraI, extraV, num, numL = getNumLayers()[0];
434
    float height;
435

    
436
    switch(numL)
437
      {
438
      case 2 : num = 6; extraI = 2; extraV = 2; height = 0.045f; break;
439
      case 3 : num = 5; extraI = 2; extraV = 2; height = 0.045f; break;
440
      case 4 : num = 5; extraI = 1; extraV = 1; height = 0.045f; break;
441
      default: num = 5; extraI = 0; extraV = 0; height = 0.045f; break;
442
      }
443

    
444
    int xrow = getRow(variant,numL,0);  // cubit == variant
445
    int yrow = getRow(variant,numL,1);
446
    int zrow = getRow(variant,numL,2);
447

    
448
    float XL = -0.5f + (xrow==     0 ? DX : 0);
449
    float XR = +0.5f + (xrow==numL-1 ? DX : 0);
450
    float YL = -0.5f - (yrow==     0 ? DY : 0);
451
    float YR = +0.5f - (yrow==numL-1 ? DY : 0);
452
    float ZL = -0.5f - (zrow==     0 ? DZ : 0);
453
    float ZR = +0.5f - (zrow==numL-1 ? DZ : 0);
454

    
455
    double[][] vertices = new double[][]
456
          {
457
              { XR, YR, ZR },
458
              { XR, YR, ZL },
459
              { XR, YL, ZR },
460
              { XR, YL, ZL },
461
              { XL, YR, ZR },
462
              { XL, YR, ZL },
463
              { XL, YL, ZR },
464
              { XL, YL, ZL },
465
          };
466

    
467
    int[][] vert_indices = new int[][]
468
          {
469
              {2,3,1,0},
470
              {7,6,4,5},
471
              {4,0,1,5},
472
              {7,3,2,6},
473
              {6,2,0,4},
474
              {3,7,5,1}
475
          };
476

    
477
    float[][] bands     = new float[][] { {height,35,0.5f,0.7f,num,extraI,extraV} };
478
    int[] bandIndices   = new int[] { 0,0,0,0,0,0};
479
    float[][] corners   = new float[][] { {0.036f,0.12f} };
480
    int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0 };
481
    float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
482
    int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
483

    
484
    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
485
    }
486

    
487
///////////////////////////////////////////////////////////////////////////////////////////////////
488

    
489
  public Static4D getQuat(int cubit, int[] numLayers)
490
    {
491
    if( mQuats ==null ) initializeQuats();
492
    return mQuats[0];
493
    }
494

    
495
///////////////////////////////////////////////////////////////////////////////////////////////////
496

    
497
  public int getNumCubitVariants(int[] numLayers)
498
    {
499
    int numL = numLayers[0];
500
    return 6*numL*numL - 12*numL + 8;
501
    }
502

    
503
///////////////////////////////////////////////////////////////////////////////////////////////////
504

    
505
  public int getCubitVariant(int cubit, int[] numLayers)
506
    {
507
    return cubit;
508
    }
509

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

    
512
  protected int getColor(int face)
513
    {
514
    return FACE_COLORS[face];
515
    }
516

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

    
519
  public float[][] getCubitPositions(int[] numLayers)
520
    {
521
    if( mPositions==null )
522
      {
523
      int numL = numLayers[0];
524
      int numCubits = numL>1 ? 6*numL*numL - 12*numL + 8 : 1;
525
      mPositions = new float[numCubits][];
526

    
527
      float diff = 0.5f*(numL-1);
528
      int currentPosition = 0;
529

    
530
      for(int x = 0; x<numL; x++)
531
        for(int y = 0; y<numL; y++)
532
          for(int z = 0; z<numL; z++)
533
            if( x==0 || x==numL-1 || y==0 || y==numL-1 || z==0 || z==numL-1 )
534
              {
535
              mPositions[currentPosition++] = new float[] {x-diff,y-diff,z-diff};
536
              }
537
      }
538

    
539
    return mPositions;
540
    }
541

    
542
///////////////////////////////////////////////////////////////////////////////////////////////////
543

    
544
  public Static4D[] getQuats()
545
    {
546
    if( mQuats ==null ) initializeQuats();
547
    return mQuats;
548
    }
549

    
550
///////////////////////////////////////////////////////////////////////////////////////////////////
551

    
552
  protected int getNumFaceColors()
553
    {
554
    return 1;
555
    }
556

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

    
559
  public float[][] getCuts(int[] numLayers)
560
    {
561
    if( mCuts==null )
562
      {
563
      int numL = numLayers[0];
564
      mCuts = new float[3][numL-1];
565

    
566
      for(int i=0; i<numL-1; i++)
567
        {
568
        float cut = (2-numL)*0.5f + i;
569
        mCuts[0][i] = cut;
570
        mCuts[1][i] = cut;
571
        mCuts[2][i] = cut;
572
        }
573
      }
574

    
575
    return mCuts;
576
    }
577

    
578
///////////////////////////////////////////////////////////////////////////////////////////////////
579

    
580
  public boolean[][] getLayerRotatable(int[] numLayers)
581
    {
582
    int numAxis = ROT_AXIS.length;
583
    boolean[][] layerRotatable = new boolean[numAxis][];
584

    
585
    for(int i=0; i<numAxis; i++)
586
      {
587
      layerRotatable[i] = new boolean[numLayers[i]];
588
      for(int j=0; j<numLayers[i]; j++) layerRotatable[i][j] = true;
589
      }
590

    
591
    return layerRotatable;
592
    }
593

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

    
596
  public int getMovementType()
597
    {
598
    return MOVEMENT_HEXAHEDRON;
599
    }
600

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

    
603
  public int getMovementSplit()
604
    {
605
    return TYPE_NOT_SPLIT;
606
    }
607

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

    
610
  public int[][][] getEnabled()
611
    {
612
    return new int[][][]
613
      {
614
          {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}},
615
      };
616
    }
617

    
618
///////////////////////////////////////////////////////////////////////////////////////////////////
619

    
620
  public float[] getDist3D(int[] numLayers)
621
    {
622
    return null;
623
    }
624

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

    
627
  public int getSolvedFunctionIndex()
628
    {
629
    return 0;
630
    }
631

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

    
634
  protected int getNumCubitFaces()
635
    {
636
    return 6;
637
    }
638

    
639
///////////////////////////////////////////////////////////////////////////////////////////////////
640
// PUBLIC API
641

    
642
  public Static3D[] getRotationAxis()
643
    {
644
    return ROT_AXIS;
645
    }
646

    
647
///////////////////////////////////////////////////////////////////////////////////////////////////
648

    
649
  public int[] getBasicAngle()
650
    {
651
    if( mBasicAngle==null ) mBasicAngle = new int[] { 4,4,4 };
652
    return mBasicAngle;
653
    }
654

    
655
///////////////////////////////////////////////////////////////////////////////////////////////////
656

    
657
  public ObjectType intGetObjectType(int[] numLayers)
658
    {
659
    switch(numLayers[0])
660
      {
661
      case 2: return ObjectType.MIRR_2;
662
      case 3: return ObjectType.MIRR_3;
663
      }
664

    
665
    return ObjectType.MIRR_2;
666
    }
667

    
668
///////////////////////////////////////////////////////////////////////////////////////////////////
669

    
670
  public int getObjectName(int[] numLayers)
671
    {
672
    switch(numLayers[0])
673
      {
674
      case 2: return R.string.mirr2;
675
      case 3: return R.string.mirr3;
676
      }
677
    return R.string.mirr3;
678
    }
679

    
680
///////////////////////////////////////////////////////////////////////////////////////////////////
681

    
682
  public int getInventor(int[] numLayers)
683
    {
684
    switch(numLayers[0])
685
      {
686
      case 2: return R.string.mirr2_inventor;
687
      case 3: return R.string.mirr3_inventor;
688
      }
689
    return R.string.mirr3_inventor;
690
    }
691

    
692
///////////////////////////////////////////////////////////////////////////////////////////////////
693

    
694
  public int getYearOfInvention(int[] numLayers)
695
    {
696
    switch(numLayers[0])
697
      {
698
      case 2: return 2007;
699
      case 3: return 2006;
700
      }
701
    return 2006;
702
    }
703

    
704
///////////////////////////////////////////////////////////////////////////////////////////////////
705

    
706
  public int getComplexity(int[] numLayers)
707
    {
708
    switch(numLayers[0])
709
      {
710
      case 2: return 5;
711
      case 3: return 7;
712
      }
713
    return 7;
714
    }
715
}
(17-17/25)