Project

General

Profile

Download (20.7 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / TwistySkewb.java @ 967c1d17

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

    
20
package org.distorted.objects;
21

    
22
import static org.distorted.objects.Movement.TYPE_SPLIT_CORNER;
23

    
24
import android.content.res.Resources;
25

    
26
import org.distorted.helpers.ObjectShape;
27
import org.distorted.helpers.ObjectSticker;
28
import org.distorted.helpers.ScrambleState;
29
import org.distorted.library.main.DistortedEffects;
30
import org.distorted.library.main.DistortedTexture;
31
import org.distorted.library.mesh.MeshSquare;
32
import org.distorted.library.type.Static3D;
33
import org.distorted.library.type.Static4D;
34
import org.distorted.main.R;
35

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

    
38
public class TwistySkewb extends Twisty6
39
{
40
  static final Static3D[] ROT_AXIS = new Static3D[]
41
         {
42
           new Static3D(+SQ3/3,+SQ3/3,+SQ3/3),
43
           new Static3D(+SQ3/3,+SQ3/3,-SQ3/3),
44
           new Static3D(+SQ3/3,-SQ3/3,+SQ3/3),
45
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
46
         };
47

    
48
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
49

    
50
  private static final int[][][] ENABLED = new int[][][]
51
      {
52
          {{0,1},{3,1},{2,3},{0,2}},
53
          {{2,3},{3,1},{0,1},{0,2}},
54
          {{1,2},{0,1},{0,3},{2,3}},
55
          {{1,2},{2,3},{0,3},{0,1}},
56
          {{0,3},{0,2},{1,2},{1,3}},
57
          {{1,2},{0,2},{0,3},{1,3}},
58
      };
59

    
60
  private ScrambleState[] mStates;
61
  private int[] mBasicAngle;
62
  private Static4D[] mQuats;
63
  private float[][] mCuts;
64
  private boolean[][] mLayerRotatable;
65
  private int[][] mCornerMap,mEdgeMap,mCenterMap;
66
  private ObjectSticker[] mStickers;
67
  private Movement mMovement;
68

    
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70

    
71
  TwistySkewb(int size, Static4D quat, DistortedTexture texture,
72
              MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
73
    {
74
    super(size, 2*size-2, quat, texture, mesh, effects, moves, ObjectList.SKEW, res, scrWidth);
75
    }
76

    
77
///////////////////////////////////////////////////////////////////////////////////////////////////
78

    
79
  ScrambleState[] getScrambleStates()
80
    {
81
    if( mStates==null )
82
      {
83
      int size = getNumLayers();
84
      int[] tmp = {0,-1,0, 0,1,0, size-1,-1,0, size-1,1,0 };
85

    
86
      mStates = new ScrambleState[]
87
        {
88
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
89
        };
90
      }
91

    
92
    return mStates;
93
    }
94

    
95
///////////////////////////////////////////////////////////////////////////////////////////////////
96

    
97
  private void initializeQuats()
98
    {
99
    mQuats = new Static4D[]
100
         {
101
         new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),
102
         new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
103
         new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
104
         new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
105

    
106
         new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),
107
         new Static4D(  0.5f,  0.5f,  0.5f, -0.5f ),
108
         new Static4D(  0.5f,  0.5f, -0.5f,  0.5f ),
109
         new Static4D(  0.5f,  0.5f, -0.5f, -0.5f ),
110
         new Static4D(  0.5f, -0.5f,  0.5f,  0.5f ),
111
         new Static4D(  0.5f, -0.5f,  0.5f, -0.5f ),
112
         new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
113
         new Static4D(  0.5f, -0.5f, -0.5f, -0.5f )
114
         };
115
    }
116

    
117
///////////////////////////////////////////////////////////////////////////////////////////////////
118

    
119
  int[] getSolvedQuats(int cubit, int numLayers)
120
    {
121
    if( mQuats==null ) initializeQuats();
122
    int status = retCubitSolvedStatus(cubit,numLayers);
123
    return status<0 ? null : buildSolvedQuats(Movement6.FACE_AXIS[status],mQuats);
124
    }
125

    
126
///////////////////////////////////////////////////////////////////////////////////////////////////
127

    
128
  private int getNumCorners()
129
    {
130
    return 8;
131
    }
132

    
133
///////////////////////////////////////////////////////////////////////////////////////////////////
134

    
135
  private int getNumEdges(int layers)
136
    {
137
    return (layers-2)*12;
138
    }
139

    
140
///////////////////////////////////////////////////////////////////////////////////////////////////
141

    
142
  private int getNumCentersPerFace(int layers)
143
    {
144
    return ((layers-2)*(layers-2) + (layers-1)*(layers-1));
145
    }
146

    
147
///////////////////////////////////////////////////////////////////////////////////////////////////
148

    
149
  Static4D[] getQuats()
150
    {
151
    if( mQuats==null ) initializeQuats();
152
    return mQuats;
153
    }
154

    
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156

    
157
  int getSolvedFunctionIndex()
158
    {
159
    return 0;
160
    }
161

    
162
///////////////////////////////////////////////////////////////////////////////////////////////////
163

    
164
  int getNumStickerTypes(int numLayers)
165
    {
166
    return 3;
167
    }
168

    
169
///////////////////////////////////////////////////////////////////////////////////////////////////
170

    
171
  float[][] getCuts(int numLayers)
172
    {
173
    if( mCuts==null )
174
      {
175
      float[] c = numLayers==2 ? (new float[] {0.0f}) : (new float[] {-SQ3/6,+SQ3/6});
176
      mCuts = new float[][] {c,c,c,c};
177
      }
178

    
179
    return mCuts;
180
    }
181

    
182
///////////////////////////////////////////////////////////////////////////////////////////////////
183

    
184
  private void getLayerRotatable(int numLayers)
185
    {
186
    if( mLayerRotatable==null )
187
      {
188
      int numAxis = ROT_AXIS.length;
189
      boolean[] tmp = numLayers==2 ? (new boolean[] {true,true}) : (new boolean[] {true,false,true});
190
      mLayerRotatable = new boolean[numAxis][];
191
      for(int i=0; i<numAxis; i++) mLayerRotatable[i] = tmp;
192
      }
193
    }
194

    
195
///////////////////////////////////////////////////////////////////////////////////////////////////
196

    
197
  int getNumCubitFaces()
198
    {
199
    return 6;
200
    }
201

    
202
///////////////////////////////////////////////////////////////////////////////////////////////////
203

    
204
  float[][] getCubitPositions(int numLayers)
205
    {
206
    final float DIST_CORNER = numLayers-1;
207
    final float DIST_EDGE   = numLayers-1;
208
    final float DIST_CENTER = numLayers-1;
209

    
210
    final int numCorners = getNumCorners();
211
    final int numEdges   = getNumEdges(numLayers);
212
    final int numCenters = 6*getNumCentersPerFace(numLayers);
213

    
214
    final float[][] CENTERS = new float[numCorners+numEdges+numCenters][];
215

    
216
    /// CORNERS //////////////////////////////////////////////
217

    
218
    CENTERS[0] = new float[] { DIST_CORNER, DIST_CORNER, DIST_CORNER };
219
    CENTERS[1] = new float[] { DIST_CORNER, DIST_CORNER,-DIST_CORNER };
220
    CENTERS[2] = new float[] { DIST_CORNER,-DIST_CORNER, DIST_CORNER };
221
    CENTERS[3] = new float[] { DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
222
    CENTERS[4] = new float[] {-DIST_CORNER, DIST_CORNER, DIST_CORNER };
223
    CENTERS[5] = new float[] {-DIST_CORNER, DIST_CORNER,-DIST_CORNER };
224
    CENTERS[6] = new float[] {-DIST_CORNER,-DIST_CORNER, DIST_CORNER };
225
    CENTERS[7] = new float[] {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
226

    
227
    /// EDGES ///////////////////////////////////////////////
228

    
229
    final float[][]  edgeTable =
230
        {
231
            {0,+DIST_EDGE,+DIST_EDGE},
232
            {+DIST_EDGE,0,+DIST_EDGE},
233
            {0,-DIST_EDGE,+DIST_EDGE},
234
            {-DIST_EDGE,0,+DIST_EDGE},
235
            {+DIST_EDGE,+DIST_EDGE,0},
236
            {+DIST_EDGE,-DIST_EDGE,0},
237
            {-DIST_EDGE,-DIST_EDGE,0},
238
            {-DIST_EDGE,+DIST_EDGE,0},
239
            {0,+DIST_EDGE,-DIST_EDGE},
240
            {+DIST_EDGE,0,-DIST_EDGE},
241
            {0,-DIST_EDGE,-DIST_EDGE},
242
            {-DIST_EDGE,0,-DIST_EDGE}
243
        };
244

    
245
    int index=8;
246

    
247
    for (float[] edges : edgeTable)
248
      {
249
      float c = 3-numLayers;
250

    
251
      for (int j=0; j<numLayers-2; j++, c+=2, index++)
252
        {
253
        CENTERS[index] = new float[] { edges[0]==0 ? c : edges[0] ,
254
                                       edges[1]==0 ? c : edges[1] ,
255
                                       edges[2]==0 ? c : edges[2] };
256
        }
257
      }
258

    
259
    /// CENTERS //////////////////////////////////////////////
260

    
261
    final float X= -1000.0f;
262
    final float Y= -1001.0f;
263

    
264
    final float[][]  centerTable =
265
        {
266
            {+DIST_CENTER,X,Y},
267
            {-DIST_CENTER,X,Y},
268
            {X,+DIST_CENTER,Y},
269
            {X,-DIST_CENTER,Y},
270
            {X,Y,+DIST_CENTER},
271
            {X,Y,-DIST_CENTER}
272
        };
273

    
274
    float x,y, cen0, cen1, cen2;
275

    
276
    for( float[] centers : centerTable )
277
      {
278
      x = 2-numLayers;
279

    
280
      for(int i=0; i<numLayers-1; i++, x+=2)
281
        {
282
        y = 2-numLayers;
283

    
284
        for(int j=0; j<numLayers-1; j++, y+=2, index++)
285
          {
286
               if( centers[0]==Y ) cen0 = y;
287
          else if( centers[0]==X ) cen0 = x;
288
          else                     cen0 = centers[0];
289

    
290
               if( centers[1]==Y ) cen1 = y;
291
          else if( centers[1]==X ) cen1 = x;
292
          else                     cen1 = centers[1];
293

    
294
               if( centers[2]==Y ) cen2 = y;
295
          else if( centers[2]==X ) cen2 = x;
296
          else                     cen2 = centers[2];
297

    
298
          CENTERS[index] = new float[] {cen0,cen1,cen2};
299
          }
300
        }
301

    
302
      x = 3-numLayers;
303

    
304
      for(int i=0; i<numLayers-2; i++, x+=2)
305
        {
306
        y = 3-numLayers;
307

    
308
        for(int j=0; j<numLayers-2; j++, y+=2, index++)
309
          {
310
               if( centers[0]==Y ) cen0 = y;
311
          else if( centers[0]==X ) cen0 = x;
312
          else                     cen0 = centers[0];
313

    
314
               if( centers[1]==Y ) cen1 = y;
315
          else if( centers[1]==X ) cen1 = x;
316
          else                     cen1 = centers[1];
317

    
318
               if( centers[2]==Y ) cen2 = y;
319
          else if( centers[2]==X ) cen2 = x;
320
          else                     cen2 = centers[2];
321

    
322
          CENTERS[index] = new float[] {cen0,cen1,cen2};
323
          }
324
        }
325
      }
326

    
327
    return CENTERS;
328
    }
329

    
330
///////////////////////////////////////////////////////////////////////////////////////////////////
331

    
332
  Static4D getQuat(int cubit, int numLayers)
333
    {
334
    if( mQuats==null ) initializeQuats();
335
    int numCorners = getNumCorners();
336
    int numEdges   = getNumEdges(numLayers);
337

    
338
    if( cubit<numCorners )
339
      {
340
      switch(cubit)
341
        {
342
        case  0: return mQuats[0];                         //  unit quat
343
        case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
344
        case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
345
        case  3: return mQuats[1];                         // 180 along X
346
        case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
347
        case  5: return mQuats[2];                         // 180 along Y
348
        case  6: return mQuats[3];                         // 180 along Z
349
        case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
350
        }
351
      }
352
    else if( cubit<numCorners+numEdges )
353
      {
354
      int edge = (cubit-numCorners)/(numLayers-2);
355

    
356
      switch(edge)
357
        {
358
        case  0: return mQuats[ 0];
359
        case  1: return mQuats[ 5];
360
        case  2: return mQuats[ 3];
361
        case  3: return mQuats[11];
362
        case  4: return mQuats[ 4];
363
        case  5: return mQuats[ 7];
364
        case  6: return mQuats[ 9];
365
        case  7: return mQuats[10];
366
        case  8: return mQuats[ 2];
367
        case  9: return mQuats[ 8];
368
        case 10: return mQuats[ 1];
369
        case 11: return mQuats[ 6];
370
        }
371
      }
372
    else
373
      {
374
      int center = (cubit-numCorners-numEdges)/getNumCentersPerFace(numLayers);
375

    
376
      switch(center)
377
        {
378
        case 0: return new Static4D(0,-SQ2/2,0,SQ2/2);    // -90 along Y
379
        case 1: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
380
        case 2: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
381
        case 3: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
382
        case 4: return mQuats[0];                         //  unit quaternion
383
        case 5: return mQuats[1];                         // 180 along X
384
        }
385
      }
386

    
387
    return null;
388
    }
389

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

    
392
  ObjectShape getObjectShape(int cubit, int numLayers)
393
    {
394
    int variant = getCubitVariant(cubit,numLayers);
395

    
396
    if( variant==0 )
397
      {
398
      double[][] vertices = new double[][] { {-1,0,0},{0,-1,0},{0,0,-1},{-1,-1,-1},{0,0,0} };
399
      int[][] vert_indices = new int[][] { {0,1,4},{2,0,4},{1,2,4},{3,1,0},{3,2,1},{3,0,2} };
400
      int N = numLayers==2 ? 7:5;
401
      int E1= numLayers==2 ? 3:2;
402
      int E2= numLayers==2 ? 5:3;
403
      float[][] bands     = new float[][] { {0.020f,35,0.16f,0.7f,N,E1,E1}, {0.000f, 0,1.00f,0.0f,3,1,E2} };
404
      int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
405
      float[][] corners   = new float[][] { {0.05f,0.25f}, {0.05f,0.20f} };
406
      int[] cornerIndices = new int[] { 1,1,1,0,0 };
407
      float[][] centers   = new float[][] { {-0.5f, -0.5f, -0.5f} };
408
      int[] centerIndices = new int[] { 0,0,0,-1,0 };
409
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
410
      }
411
    else if( variant==1 )
412
      {
413
      double[][] vertices = new double[][] { {-1,0,0},{1,0,0},{0,-1,0},{0,0,-1} };
414
      int[][] vert_indices = new int[][] { {2,1,0},{3,0,1},{2,3,1},{3,2,0} };
415
      int N = numLayers==2 ? 7:5;
416
      int E = numLayers==2 ? 5:2;
417
      float[][] bands     = new float[][] { {0.035f,30,0.16f,0.8f,N,2,E}, {0.020f,45,0.16f,0.2f,3,1,2} };
418
      int[] bandIndices   = new int[] { 0,0,1,1 };
419
      float[][] corners   = new float[][] { {0.07f,0.20f}, {0.02f,0.30f} };
420
      int[] cornerIndices = new int[] { 0,0,1,1 };
421
      float[][] centers   = new float[][] { {0.0f, -0.5f, -0.5f} };
422
      int[] centerIndices = new int[] { 0,0,0,0 };
423
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
424
      }
425
    else
426
      {
427
      double[][] vertices = new double[][] { {-1,0,0},{0,-1,0},{1,0,0},{0,1,0},{0,0,-1} };
428
      int[][] vert_indices = new int[][] { {0,1,2,3},{4,1,0},{4,2,1},{4,3,2},{4,0,3} };
429
      int N = numLayers==2 ? 7:6;
430
      int E = numLayers==2 ? 3:1;
431
      float[][] bands     = new float[][] { {0.04f,35,SQ2/8,0.9f,N,E,E}, {0.000f,0,1,0.0f,3,0,0} };
432
      int[] bandIndices   = new int[] { 0,1,1,1,1 };
433
      float[][] corners   = new float[][] { {0.06f,0.15f} };
434
      int[] cornerIndices = new int[] { 0,0,0,0,0 };
435
      float[][] centers   = new float[][] { {0,0,-0.4f} };
436
      int[] centerIndices = new int[] { 0,0,0,0,-1 };
437
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
438
      }
439
    }
440

    
441
///////////////////////////////////////////////////////////////////////////////////////////////////
442

    
443
  int getNumCubitVariants(int numLayers)
444
    {
445
    return 3;
446
    }
447

    
448
///////////////////////////////////////////////////////////////////////////////////////////////////
449

    
450
  int getCubitVariant(int cubit, int numLayers)
451
    {
452
    int numCorners = getNumCorners();
453
    if( cubit<numCorners ) return 0;
454
    int numEdges = getNumEdges(numLayers);
455
    return cubit<numCorners+numEdges ? 1:2;
456
    }
457

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

    
460
  int getFaceColor(int cubit, int cubitface, int numLayers)
461
    {
462
    if( mCornerMap==null || mEdgeMap==null || mCenterMap==null )
463
      {
464
      mCornerMap = new int[][]
465
         {
466
           {  4, 2, 0, 18,18,18 },
467
           {  2, 5, 0, 18,18,18 },
468
           {  3, 4, 0, 18,18,18 },
469
           {  5, 3, 0, 18,18,18 },
470
           {  1, 2, 4, 18,18,18 },
471
           {  5, 2, 1, 18,18,18 },
472
           {  4, 3, 1, 18,18,18 },
473
           {  1, 3, 5, 18,18,18 },
474
         };
475

    
476
      mEdgeMap = new int[][]
477
         {
478
           { 10, 8, 18,18,18,18 },
479
           {  6,10, 18,18,18,18 },
480
           { 10, 9, 18,18,18,18 },
481
           {  7,10, 18,18,18,18 },
482
           {  8, 6, 18,18,18,18 },
483
           {  9, 6, 18,18,18,18 },
484
           {  9, 7, 18,18,18,18 },
485
           {  8, 7, 18,18,18,18 },
486
           { 11, 8, 18,18,18,18 },
487
           {  6,11, 18,18,18,18 },
488
           { 11, 9, 18,18,18,18 },
489
           {  7,11, 18,18,18,18 }
490
         };
491

    
492
      mCenterMap = new int[][]
493
         {
494
           { 12, 18,18,18,18,18 },
495
           { 13, 18,18,18,18,18 },
496
           { 14, 18,18,18,18,18 },
497
           { 15, 18,18,18,18,18 },
498
           { 16, 18,18,18,18,18 },
499
           { 17, 18,18,18,18,18 },
500
         };
501
      }
502

    
503
    int numCorners = getNumCorners();
504
    int numEdges   = getNumEdges(numLayers);
505

    
506
    if( cubit<numCorners )
507
      {
508
      return mCornerMap[cubit][cubitface];
509
      }
510
    else if( cubit<numCorners+numEdges )
511
      {
512
      int edge = (cubit-numCorners)/(numLayers-2);
513
      return mEdgeMap[edge][cubitface];
514
      }
515
    else
516
      {
517
      int center = (cubit-numCorners-numEdges)/getNumCentersPerFace(numLayers);
518
      return mCenterMap[center][cubitface];
519
      }
520
    }
521

    
522
///////////////////////////////////////////////////////////////////////////////////////////////////
523

    
524
  ObjectSticker retSticker(int face)
525
    {
526
    if( mStickers==null )
527
      {
528
      float[][] STICKERS = new float[][]
529
          {
530
             { -0.5f, 0.25f, 0.25f,  -0.5f, 0.25f, 0.25f  },
531
             { -0.5f, 0.00f, 0.00f,  -0.5f, 0.50f, 0.0f, 0.0f, 0.5f }
532
          };
533

    
534
      final float R1 = 0.025f;
535
      final float R2 = 0.025f;
536
      final float R3 = 0.055f;
537
      final float[][] radii  = { { R1,R1,R1 },{ R2,R2,R2 },{ R3,R3,R3,R3 } };
538
      final float[] strokes = { 0.045f, 0.035f, 0.035f };
539

    
540
      mStickers = new ObjectSticker[STICKERS.length+1];
541

    
542
      for(int s=0; s<STICKERS.length+1; s++)
543
        {
544
        int index = s<2 ? 0:1;
545
        mStickers[s] = new ObjectSticker(STICKERS[index],null,radii[s],strokes[s]);
546
        }
547
      }
548

    
549
    return mStickers[face/NUM_FACE_COLORS];
550
    }
551

    
552
///////////////////////////////////////////////////////////////////////////////////////////////////
553
// PUBLIC API
554

    
555
  public Static3D[] getRotationAxis()
556
    {
557
    return ROT_AXIS;
558
    }
559

    
560
///////////////////////////////////////////////////////////////////////////////////////////////////
561

    
562
  public Movement getMovement()
563
    {
564
    if( mMovement==null )
565
      {
566
      int numLayers = getNumLayers();
567
      if( mCuts==null ) getCuts(numLayers);
568
      getLayerRotatable(numLayers);
569
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,2*numLayers-2,TYPE_SPLIT_CORNER,NUM_ENABLED,ENABLED);
570
      }
571
    return mMovement;
572
    }
573

    
574
///////////////////////////////////////////////////////////////////////////////////////////////////
575

    
576
  public int[] getBasicAngle()
577
    {
578
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
579
    return mBasicAngle;
580
    }
581

    
582
///////////////////////////////////////////////////////////////////////////////////////////////////
583

    
584
  public int getObjectName(int numLayers)
585
    {
586
    switch(numLayers)
587
      {
588
      case 2: return R.string.skew2;
589
      case 3: return R.string.skew3;
590
      }
591
    return R.string.skew2;
592
    }
593

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

    
596
  public int getInventor(int numLayers)
597
    {
598
    switch(numLayers)
599
      {
600
      case 2: return R.string.skew2_inventor;
601
      case 3: return R.string.skew3_inventor;
602
      }
603
    return R.string.skew2_inventor;
604
    }
605

    
606
///////////////////////////////////////////////////////////////////////////////////////////////////
607

    
608
  public int getComplexity(int numLayers)
609
    {
610
    switch(numLayers)
611
      {
612
      case 2: return 4;
613
      case 3: return 8;
614
      }
615
    return 5;
616
    }
617
}
(34-34/38)