Project

General

Profile

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

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

1 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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.TYPE_NOT_SPLIT;
23
24
import android.content.res.Resources;
25
26
import org.distorted.library.main.DistortedEffects;
27
import org.distorted.library.main.DistortedTexture;
28
import org.distorted.library.mesh.MeshSquare;
29
import org.distorted.library.type.Static3D;
30
import org.distorted.library.type.Static4D;
31
32
import org.distorted.objectlib.R;
33
import org.distorted.objectlib.main.Movement;
34
import org.distorted.objectlib.main.Movement6;
35
import org.distorted.objectlib.main.ObjectList;
36
import org.distorted.objectlib.main.ObjectShape;
37
import org.distorted.objectlib.main.ObjectSticker;
38
import org.distorted.objectlib.main.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[][][] ENABLED = new int[][][]
53
      {
54
          {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}},
55
      };
56
57
  private static final int[] FACE_COLORS = new int[] { COLOR_WHITE };
58
  private static final float DX = 0.10f;
59
  private static final float DY = 0.25f;
60
  private static final float DZ = 0.40f;
61
62 cc448c54 Leszek Koltunski
  private static final float[][] SEQ2 = new float[][]
63
      {
64
          {1-DX,1-DY},{1+DX,1-DY},{1-DX,1+DY},{1+DX,1+DY},
65
          {1-DX,1-DZ},{1+DX,1-DZ},{1-DX,1+DZ},{1+DX,1+DZ},
66
          {1-DZ,1-DY},{1+DZ,1-DY},{1-DZ,1+DY},{1+DZ,1+DY},
67
      };
68
69
  private static final float[][] SEQ3 = new float[][]
70
      {
71
          {1   ,1   },{1-DX,1-DY},{1   ,1-DY},{1+DX,1-DY},{1-DX,1   },
72
          {1+DX,1   },{1-DX,1+DY},{1   ,1+DY},{1+DX,1+DY},{1-DX,1-DZ},
73
          {1   ,1-DZ},{1+DX,1-DZ},{1-DX,1   },{1+DX,1   },{1-DX,1+DZ},
74
          {1   ,1+DZ},{1+DX,1+DZ},{1-DZ,1-DY},{1   ,1-DY},{1+DZ,1-DY},
75
          {1-DZ,1   },{1+DZ,1   },{1-DZ,1+DY},{1   ,1+DY},{1+DZ,1+DY},
76
      };
77
78 29b82486 Leszek Koltunski
  private ScrambleState[] mStates;
79
  private Static4D[] mQuats;
80
  private float[][] mCuts;
81
  private boolean[][] mLayerRotatable;
82
  private int[] mBasicAngle;
83
  private ObjectSticker[] mStickers;
84
  private float[][] mPositions;
85
  private Movement mMovement;
86
87
///////////////////////////////////////////////////////////////////////////////////////////////////
88
89
  public TwistyMirror(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
90
                      DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
91
    {
92
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.MIRR, res, scrWidth);
93
    }
94
95
///////////////////////////////////////////////////////////////////////////////////////////////////
96
97
  protected ScrambleState[] getScrambleStates()
98
    {
99
    if( mStates==null )
100
      {
101
      int size = getNumLayers();
102
      int[][] m = new int[16][];
103
      for(int i=1; i<16; i++) m[i] = createEdges(size,i);
104
105
      mStates = new ScrambleState[]
106
        {
107
        new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ),  // 0
108
        new ScrambleState( new int[][] {  null, m[ 4], m[ 5] } ),  // x
109
        new ScrambleState( new int[][] { m[ 6],  null, m[ 7] } ),  // y
110
        new ScrambleState( new int[][] { m[ 8], m[ 8],  null } ),  // z
111
        new ScrambleState( new int[][] { m[10],  null, m[ 7] } ),  // xy
112
        new ScrambleState( new int[][] { m[11], m[ 9],  null } ),  // xz
113
        new ScrambleState( new int[][] {  null, m[12], m[ 5] } ),  // yx
114
        new ScrambleState( new int[][] { m[ 8], m[13],  null } ),  // yz
115
        new ScrambleState( new int[][] {  null, m[ 4], m[14] } ),  // zx
116
        new ScrambleState( new int[][] { m[ 6],  null, m[15] } ),  // zy
117
        new ScrambleState( new int[][] {  null,  null, m[ 5] } ),  // xyx
118
        new ScrambleState( new int[][] {  null, m[ 4],  null } ),  // xzx
119
        new ScrambleState( new int[][] {  null,  null, m[ 7] } ),  // yxy
120
        new ScrambleState( new int[][] { m[ 6],  null,  null } ),  // yzy
121
        new ScrambleState( new int[][] {  null, m[ 9],  null } ),  // zxz
122
        new ScrambleState( new int[][] { m[ 8],  null,  null } ),  // zyz
123
        };
124
      }
125
126
    return mStates;
127
    }
128
129
///////////////////////////////////////////////////////////////////////////////////////////////////
130
131
  private int[] createEdges(int size, int vertex)
132
    {
133
    int[] ret = new int[9*size];
134
135
    for(int l=0; l<size; l++)
136
      {
137
      ret[9*l  ] = l;
138
      ret[9*l+1] =-1;
139
      ret[9*l+2] = vertex;
140
      ret[9*l+3] = l;
141
      ret[9*l+4] = 1;
142
      ret[9*l+5] = vertex;
143
      ret[9*l+6] = l;
144
      ret[9*l+7] = 2;
145
      ret[9*l+8] = vertex;
146
      }
147
148
    return ret;
149
    }
150
151
///////////////////////////////////////////////////////////////////////////////////////////////////
152
153
  private void initializeQuats()
154
    {
155
    mQuats = new Static4D[]
156
         {
157
         new Static4D(  0.0f,   0.0f,   0.0f,   1.0f),
158
         new Static4D(  1.0f,   0.0f,   0.0f,   0.0f),
159
         new Static4D(  0.0f,   1.0f,   0.0f,   0.0f),
160
         new Static4D(  0.0f,   0.0f,   1.0f,   0.0f),
161
162
         new Static4D( SQ2/2,  SQ2/2,  0.0f ,   0.0f),
163
         new Static4D( SQ2/2, -SQ2/2,  0.0f ,   0.0f),
164
         new Static4D( SQ2/2,   0.0f,  SQ2/2,   0.0f),
165
         new Static4D(-SQ2/2,   0.0f,  SQ2/2,   0.0f),
166
         new Static4D( SQ2/2,   0.0f,   0.0f,  SQ2/2),
167
         new Static4D( SQ2/2,   0.0f,   0.0f, -SQ2/2),
168
         new Static4D(  0.0f,  SQ2/2,  SQ2/2,   0.0f),
169
         new Static4D(  0.0f,  SQ2/2, -SQ2/2,   0.0f),
170
         new Static4D(  0.0f,  SQ2/2,   0.0f,  SQ2/2),
171
         new Static4D(  0.0f,  SQ2/2,   0.0f, -SQ2/2),
172
         new Static4D(  0.0f,   0.0f,  SQ2/2,  SQ2/2),
173
         new Static4D(  0.0f,   0.0f,  SQ2/2, -SQ2/2),
174
175
         new Static4D(  0.5f,   0.5f,   0.5f,   0.5f),
176
         new Static4D(  0.5f,   0.5f,  -0.5f,   0.5f),
177
         new Static4D(  0.5f,   0.5f,  -0.5f,  -0.5f),
178
         new Static4D(  0.5f,  -0.5f,   0.5f,  -0.5f),
179
         new Static4D( -0.5f,  -0.5f,  -0.5f,   0.5f),
180
         new Static4D( -0.5f,   0.5f,  -0.5f,  -0.5f),
181
         new Static4D( -0.5f,   0.5f,   0.5f,  -0.5f),
182
         new Static4D( -0.5f,   0.5f,   0.5f,   0.5f)
183
         };
184
    }
185
186
///////////////////////////////////////////////////////////////////////////////////////////////////
187
// we cannot do this the standard, automatic way because there's only 1 color in the FACE_COLORS
188
// table and retCubitSolvedStatus() always returns -1,-1 or 0.
189
190
  protected int[] getSolvedQuats(int cubit, int numLayers)
191
    {
192
    if( numLayers==3 )
193
      {
194
      switch(cubit)
195
        {
196
        case  4:
197
        case 21: return new int[] {1,8,9};
198
        case 10:
199
        case 15: return new int[] {2,12,13};
200
        case 12:
201
        case 13: return new int[] {3,14,15};
202
        }
203
      }
204
205
    return null;
206
    }
207
208
///////////////////////////////////////////////////////////////////////////////////////////////////
209
210
  protected int getFaceColor(int cubit, int cubitface, int numLayers)
211
    {
212
    if( numLayers==2 )
213
      {
214
      switch(cubitface)
215
        {
216
        case 0: if( cubit==4 ) return 11;
217
                if( cubit==5 ) return 10;
218
                if( cubit==6 ) return  9;
219
                if( cubit==7 ) return  8;
220
                return NUM_TEXTURES;
221
        case 1: if( cubit==0 ) return 11;
222
                if( cubit==1 ) return 10;
223
                if( cubit==2 ) return  9;
224
                if( cubit==3 ) return  8;
225
                return NUM_TEXTURES;
226
        case 2: if( cubit==3 ) return  4;
227
                if( cubit==7 ) return  5;
228
                if( cubit==2 ) return  6;
229
                if( cubit==6 ) return  7;
230
                return NUM_TEXTURES;
231
        case 3: if( cubit==1 ) return  4;
232
                if( cubit==5 ) return  5;
233
                if( cubit==0 ) return  6;
234
                if( cubit==4 ) return  7;
235
                return NUM_TEXTURES;
236
        case 4: if( cubit==3 ) return  0;
237
                if( cubit==7 ) return  1;
238
                if( cubit==1 ) return  2;
239
                if( cubit==5 ) return  3;
240
                return NUM_TEXTURES;
241
        case 5: if( cubit==2 ) return  0;
242
                if( cubit==6 ) return  1;
243
                if( cubit==0 ) return  2;
244
                if( cubit==4 ) return  3;
245
                return NUM_TEXTURES;
246
        }
247
      }
248
    if( numLayers==3 )
249
      {
250
      switch(cubitface)
251
        {
252
        case 0: if( cubit==17 ) return 24;
253
                if( cubit==18 ) return 23;
254
                if( cubit==19 ) return 22;
255
                if( cubit==20 ) return 21;
256
                if( cubit==21 ) return  0;
257
                if( cubit==22 ) return 20;
258
                if( cubit==23 ) return 19;
259
                if( cubit==24 ) return 18;
260
                if( cubit==25 ) return 17;
261
                return NUM_TEXTURES;
262
        case 1: if( cubit== 0 ) return 24;
263
                if( cubit== 1 ) return 23;
264
                if( cubit== 2 ) return 22;
265
                if( cubit== 3 ) return 21;
266
                if( cubit== 4 ) return  0;
267
                if( cubit== 5 ) return 20;
268
                if( cubit== 6 ) return 19;
269
                if( cubit== 7 ) return 18;
270
                if( cubit== 8 ) return 17;
271
                return NUM_TEXTURES;
272
        case 2: if( cubit== 6 ) return 14;
273
                if( cubit==14 ) return  2; // theoretically should have been 15, but this must have gotten collapsed in the Factory
274
                if( cubit==23 ) return 16;
275
                if( cubit== 7 ) return 12;
276
                if( cubit==15 ) return  0;
277
                if( cubit==24 ) return 13;
278
                if( cubit== 8 ) return  9;
279
                if( cubit==16 ) return 20; // ditto, theoretically 10
280
                if( cubit==25 ) return 11;
281
                return NUM_TEXTURES;
282
        case 3: if( cubit== 0 ) return 14;
283
                if( cubit== 9 ) return  2; // ditto, theoretically 15
284
                if( cubit==17 ) return 16;
285
                if( cubit== 1 ) return 12;
286
                if( cubit==10 ) return  0;
287
                if( cubit==18 ) return 13;
288
                if( cubit== 2 ) return  9;
289
                if( cubit==11 ) return 20; // ditto, theoretically 10
290
                if( cubit==19 ) return 11;
291
                return NUM_TEXTURES;
292
        case 4: if( cubit== 8 ) return  1;
293
                if( cubit==16 ) return  2;
294
                if( cubit==25 ) return  3;
295
                if( cubit== 5 ) return  4;
296
                if( cubit==13 ) return  0;
297
                if( cubit==22 ) return  5;
298
                if( cubit== 2 ) return  6;
299
                if( cubit==11 ) return  7;
300
                if( cubit==19 ) return  8;
301
                return NUM_TEXTURES;
302
        case 5: if( cubit== 6 ) return  1;
303
                if( cubit==14 ) return  2;
304
                if( cubit==23 ) return  3;
305
                if( cubit== 3 ) return  4;
306
                if( cubit==12 ) return  0;
307
                if( cubit==20 ) return  5;
308
                if( cubit== 0 ) return  6;
309
                if( cubit== 9 ) return  7;
310
                if( cubit==17 ) return  8;
311
                return NUM_TEXTURES;
312
        }
313
      }
314
315
    return 0;
316
    }
317
318
///////////////////////////////////////////////////////////////////////////////////////////////////
319
320
  private float returnStroke(float x, float y)
321
    {
322
    return 0.08f/(Math.max(x,y));
323
    }
324
325
///////////////////////////////////////////////////////////////////////////////////////////////////
326
327
  private float[] generateStrokes()
328
    {
329
    int num = getNumLayers();
330
331
    if( num==2 )
332
      {
333 cc448c54 Leszek Koltunski
      int LEN = SEQ2.length;
334
      float[] tmp = new float[LEN];
335
      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ2[i][0],SEQ2[i][1]);
336
      return tmp;
337 29b82486 Leszek Koltunski
      }
338
    else
339
      {
340 cc448c54 Leszek Koltunski
      int LEN = SEQ3.length;
341
      float[] tmp = new float[LEN];
342
      for(int i=0; i<LEN; i++) tmp[i] = returnStroke(SEQ3[i][0],SEQ3[i][1]);
343
      return tmp;
344 29b82486 Leszek Koltunski
      }
345
    }
346
347
///////////////////////////////////////////////////////////////////////////////////////////////////
348
349
  private float[] returnSticker(float x, float y)
350
    {
351
      float H = 0.5f;
352
353
      if( x<y ) { float D=H*x/y; return new float[] {-D,-H,+D,-H,+D,+H,-D,+H}; }
354
      else      { float D=H*y/x; return new float[] {-H,-D,+H,-D,+H,+D,-H,+D}; }
355
    }
356
357
///////////////////////////////////////////////////////////////////////////////////////////////////
358
359
  private float[][] generateStickers()
360
    {
361
    int num = getNumLayers();
362
363
    if( num==2 )
364
      {
365 cc448c54 Leszek Koltunski
      int LEN = SEQ2.length;
366
      float[][] tmp = new float[LEN][];
367
      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ2[i][0],SEQ2[i][1]);
368
      return tmp;
369 29b82486 Leszek Koltunski
      }
370
    else
371
      {
372 cc448c54 Leszek Koltunski
      int LEN = SEQ3.length;
373
      float[][] tmp = new float[LEN][];
374
      for(int i=0; i<LEN; i++) tmp[i] = returnSticker(SEQ3[i][0],SEQ3[i][1]);
375
      return tmp;
376 29b82486 Leszek Koltunski
      }
377
    }
378
379
///////////////////////////////////////////////////////////////////////////////////////////////////
380
381
  protected ObjectSticker retSticker(int face)
382
    {
383
    if( mStickers==null )
384
      {
385
      final float[][] STICKERS = generateStickers();
386
      final float[] STROKES = generateStrokes();
387
      final int NUM_STICKERS = STICKERS.length;
388
      final float radius = 0.10f;
389
      final float[] radii = {radius,radius,radius,radius};
390
      mStickers = new ObjectSticker[NUM_STICKERS];
391
392
      for(int i=0; i<NUM_STICKERS; i++)
393
        {
394
        mStickers[i] = new ObjectSticker(STICKERS[i],null,radii,STROKES[i]);
395
        }
396
      }
397
398
    return mStickers[face/NUM_FACE_COLORS];
399
    }
400
401
///////////////////////////////////////////////////////////////////////////////////////////////////
402
403
  protected int getNumStickerTypes(int numLayers)
404
    {
405 cc448c54 Leszek Koltunski
    return numLayers==2 ? SEQ2.length : SEQ3.length;
406 29b82486 Leszek Koltunski
    }
407
408
///////////////////////////////////////////////////////////////////////////////////////////////////
409
410
  private int getRow(int cubit, int numLayers, int dim)
411
    {
412
    return (int)(mPositions[cubit][dim] + 0.5f*(numLayers-1));
413
    }
414
415
///////////////////////////////////////////////////////////////////////////////////////////////////
416
417
  protected ObjectShape getObjectShape(int cubit, int numLayers)
418
    {
419
    int extraI, extraV, num;
420
    float height;
421
422
    switch(numLayers)
423
      {
424
      case 2 : num = 6; extraI = 2; extraV = 2; height = 0.045f; break;
425
      case 3 : num = 5; extraI = 2; extraV = 2; height = 0.045f; break;
426
      case 4 : num = 5; extraI = 1; extraV = 1; height = 0.045f; break;
427
      default: num = 5; extraI = 0; extraV = 0; height = 0.045f; break;
428
      }
429
430
    int xrow = getRow(cubit,numLayers,0);
431
    int yrow = getRow(cubit,numLayers,1);
432
    int zrow = getRow(cubit,numLayers,2);
433
434
    float XL = -0.5f + (xrow==          0 ? DX : 0);
435
    float XR = +0.5f + (xrow==numLayers-1 ? DX : 0);
436
    float YL = -0.5f - (yrow==          0 ? DY : 0);
437
    float YR = +0.5f - (yrow==numLayers-1 ? DY : 0);
438
    float ZL = -0.5f - (zrow==          0 ? DZ : 0);
439
    float ZR = +0.5f - (zrow==numLayers-1 ? DZ : 0);
440
441
    double[][] vertices = new double[][]
442
          {
443
              { XR, YR, ZR },
444
              { XR, YR, ZL },
445
              { XR, YL, ZR },
446
              { XR, YL, ZL },
447
              { XL, YR, ZR },
448
              { XL, YR, ZL },
449
              { XL, YL, ZR },
450
              { XL, YL, ZL },
451
          };
452
453
    int[][] vert_indices = new int[][]
454
          {
455
              {2,3,1,0},
456
              {7,6,4,5},
457
              {4,0,1,5},
458
              {7,3,2,6},
459
              {6,2,0,4},
460
              {3,7,5,1}
461
          };
462
463
    float[][] bands     = new float[][] { {height,35,0.5f,0.7f,num,extraI,extraV} };
464
    int[] bandIndices   = new int[] { 0,0,0,0,0,0};
465
    float[][] corners   = new float[][] { {0.036f,0.12f} };
466
    int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0 };
467
    float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
468
    int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
469
470
    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
471
    }
472
473
///////////////////////////////////////////////////////////////////////////////////////////////////
474
475
  protected Static4D getQuat(int cubit, int numLayers)
476
    {
477
    if( mQuats ==null ) initializeQuats();
478
    return mQuats[0];
479
    }
480
481
///////////////////////////////////////////////////////////////////////////////////////////////////
482
483
  protected int getNumCubitVariants(int numLayers)
484
    {
485
    return 6*numLayers*numLayers - 12*numLayers + 8;
486
    }
487
488
///////////////////////////////////////////////////////////////////////////////////////////////////
489
490
  protected int getCubitVariant(int cubit, int numLayers)
491
    {
492
    return cubit;
493
    }
494
495
///////////////////////////////////////////////////////////////////////////////////////////////////
496
497 0310ac32 Leszek Koltunski
  protected int getColor(int face)
498 29b82486 Leszek Koltunski
    {
499
    return FACE_COLORS[face];
500
    }
501
502
///////////////////////////////////////////////////////////////////////////////////////////////////
503
504
  protected float[][] getCubitPositions(int numLayers)
505
    {
506
    if( mPositions==null )
507
      {
508
      int numCubits = numLayers>1 ? 6*numLayers*numLayers - 12*numLayers + 8 : 1;
509
      mPositions = new float[numCubits][];
510
511
      float diff = 0.5f*(numLayers-1);
512
      int currentPosition = 0;
513
514
      for(int x = 0; x<numLayers; x++)
515
        for(int y = 0; y<numLayers; y++)
516
          for(int z = 0; z<numLayers; z++)
517
            if( x==0 || x==numLayers-1 || y==0 || y==numLayers-1 || z==0 || z==numLayers-1 )
518
              {
519
              mPositions[currentPosition++] = new float[] {x-diff,y-diff,z-diff};
520
              }
521
      }
522
523
    return mPositions;
524
    }
525
526
///////////////////////////////////////////////////////////////////////////////////////////////////
527
528
  protected Static4D[] getQuats()
529
    {
530
    if( mQuats ==null ) initializeQuats();
531
    return mQuats;
532
    }
533
534
///////////////////////////////////////////////////////////////////////////////////////////////////
535
536 0310ac32 Leszek Koltunski
  protected int getNumFaceColors()
537 29b82486 Leszek Koltunski
    {
538
    return 1;
539
    }
540
541
///////////////////////////////////////////////////////////////////////////////////////////////////
542
543
  protected float[][] getCuts(int numLayers)
544
    {
545
    if( mCuts==null )
546
      {
547
      mCuts = new float[3][numLayers-1];
548
549
      for(int i=0; i<numLayers-1; i++)
550
        {
551
        float cut = (2-numLayers)*0.5f + i;
552
        mCuts[0][i] = cut;
553
        mCuts[1][i] = cut;
554
        mCuts[2][i] = cut;
555
        }
556
      }
557
558
    return mCuts;
559
    }
560
561
///////////////////////////////////////////////////////////////////////////////////////////////////
562
563
  private void getLayerRotatable(int numLayers)
564
    {
565
    if( mLayerRotatable==null )
566
      {
567
      int numAxis = ROT_AXIS.length;
568
      boolean[] tmp = new boolean[numLayers];
569
      for(int i=0; i<numLayers; i++) tmp[i] = true;
570
      mLayerRotatable = new boolean[numAxis][];
571
      for(int i=0; i<numAxis; i++) mLayerRotatable[i] = tmp;
572
      }
573
    }
574
575
///////////////////////////////////////////////////////////////////////////////////////////////////
576
577
  protected int getSolvedFunctionIndex()
578
    {
579
    return 0;
580
    }
581
582
///////////////////////////////////////////////////////////////////////////////////////////////////
583
584
  protected int getNumCubitFaces()
585
    {
586
    return 6;
587
    }
588
589
///////////////////////////////////////////////////////////////////////////////////////////////////
590
// PUBLIC API
591
592
  public Static3D[] getRotationAxis()
593
    {
594
    return ROT_AXIS;
595
    }
596
597
///////////////////////////////////////////////////////////////////////////////////////////////////
598
599
  public Movement getMovement()
600
    {
601
    if( mMovement==null )
602
      {
603
      int numLayers = getNumLayers();
604
      if( mCuts==null ) getCuts(numLayers);
605
      getLayerRotatable(numLayers);
606
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
607
      }
608
    return mMovement;
609
    }
610
611
///////////////////////////////////////////////////////////////////////////////////////////////////
612
613
  public int[] getBasicAngle()
614
    {
615
    if( mBasicAngle==null ) mBasicAngle = new int[] { 4,4,4 };
616
    return mBasicAngle;
617
    }
618
619
///////////////////////////////////////////////////////////////////////////////////////////////////
620
621
  public int getObjectName(int numLayers)
622
    {
623
    switch(numLayers)
624
      {
625
      case 2: return R.string.mirr2;
626
      case 3: return R.string.mirr3;
627
      }
628
    return R.string.mirr3;
629
    }
630
631
///////////////////////////////////////////////////////////////////////////////////////////////////
632
633
  public int getInventor(int numLayers)
634
    {
635
    switch(numLayers)
636
      {
637
      case 2: return R.string.mirr2_inventor;
638
      case 3: return R.string.mirr3_inventor;
639
      }
640
    return R.string.mirr3_inventor;
641
    }
642
643
///////////////////////////////////////////////////////////////////////////////////////////////////
644
645
  public int getComplexity(int numLayers)
646
    {
647
    switch(numLayers)
648
      {
649
      case 2: return 5;
650
      case 3: return 7;
651
      }
652
    return 7;
653
    }
654
}