Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyMirror.java @ 1bb09f88

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
  protected 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
  protected int getStickerIndex(int face)
418
    {
419
    return face/NUM_FACE_COLORS;
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
  protected ObjectShape getObjectShape(int cubit, int[] numLayers)
439
    {
440
    int extraI, extraV, num;
441
    float height;
442
    int numL = numLayers[0];
443

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

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

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

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

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

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

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

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

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

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

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

    
511
///////////////////////////////////////////////////////////////////////////////////////////////////
512

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

    
518
///////////////////////////////////////////////////////////////////////////////////////////////////
519

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

    
525
///////////////////////////////////////////////////////////////////////////////////////////////////
526

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

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

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

    
547
    return mPositions;
548
    }
549

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

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

    
558
///////////////////////////////////////////////////////////////////////////////////////////////////
559

    
560
  protected int getNumFaceColors()
561
    {
562
    return 1;
563
    }
564

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

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

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

    
583
    return mCuts;
584
    }
585

    
586
///////////////////////////////////////////////////////////////////////////////////////////////////
587

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

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

    
599
    return layerRotatable;
600
    }
601

    
602
///////////////////////////////////////////////////////////////////////////////////////////////////
603

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

    
609
///////////////////////////////////////////////////////////////////////////////////////////////////
610

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

    
616
///////////////////////////////////////////////////////////////////////////////////////////////////
617

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

    
626
///////////////////////////////////////////////////////////////////////////////////////////////////
627

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

    
633
///////////////////////////////////////////////////////////////////////////////////////////////////
634

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

    
640
///////////////////////////////////////////////////////////////////////////////////////////////////
641

    
642
  protected int getNumCubitFaces()
643
    {
644
    return 6;
645
    }
646

    
647
///////////////////////////////////////////////////////////////////////////////////////////////////
648
// PUBLIC API
649

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

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

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

    
663
///////////////////////////////////////////////////////////////////////////////////////////////////
664

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

    
673
    return ObjectType.MIRR_2;
674
    }
675

    
676
///////////////////////////////////////////////////////////////////////////////////////////////////
677

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

    
688
///////////////////////////////////////////////////////////////////////////////////////////////////
689

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

    
700
///////////////////////////////////////////////////////////////////////////////////////////////////
701

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

    
712
///////////////////////////////////////////////////////////////////////////////////////////////////
713

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