Project

General

Profile

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

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

1 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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.objectlib.objects;
21
22
import static org.distorted.objectlib.main.Movement.TYPE_SPLIT_CORNER;
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 TwistySkewb extends Twisty6
44
{
45
  static final Static3D[] ROT_AXIS = new Static3D[]
46
         {
47
           new Static3D(+SQ3/3,+SQ3/3,+SQ3/3),
48
           new Static3D(+SQ3/3,+SQ3/3,-SQ3/3),
49
           new Static3D(+SQ3/3,-SQ3/3,+SQ3/3),
50
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
51
         };
52
53
  private static final int[][][] ENABLED = new int[][][]
54
      {
55
          {{0,1},{3,1},{2,3},{0,2}},
56
          {{2,3},{3,1},{0,1},{0,2}},
57
          {{1,2},{0,1},{0,3},{2,3}},
58
          {{1,2},{2,3},{0,3},{0,1}},
59
          {{0,3},{0,2},{1,2},{1,3}},
60
          {{1,2},{0,2},{0,3},{1,3}},
61
      };
62
63
  private ScrambleState[] mStates;
64
  private int[] mBasicAngle;
65
  private Static4D[] mQuats;
66
  private float[][] mCuts;
67
  private boolean[][] mLayerRotatable;
68
  private int[][] mCornerMap,mEdgeMap,mCenterMap;
69
  private ObjectSticker[] mStickers;
70
  private Movement mMovement;
71
72
///////////////////////////////////////////////////////////////////////////////////////////////////
73
74
  public TwistySkewb(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
75
                     DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
76
    {
77
    super(size, 2*size-2, quat, texture, mesh, effects, moves, ObjectList.SKEW, res, scrWidth);
78
    }
79
80
///////////////////////////////////////////////////////////////////////////////////////////////////
81
82
  protected ScrambleState[] getScrambleStates()
83
    {
84
    if( mStates==null )
85
      {
86
      int size = getNumLayers();
87
      int[] tmp = {0,-1,0, 0,1,0, size-1,-1,0, size-1,1,0 };
88
89
      mStates = new ScrambleState[]
90
        {
91
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
92
        };
93
      }
94
95
    return mStates;
96
    }
97
98
///////////////////////////////////////////////////////////////////////////////////////////////////
99
100
  private void initializeQuats()
101
    {
102
    mQuats = new Static4D[]
103
         {
104
         new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),
105
         new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
106
         new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
107
         new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
108
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
         new Static4D(  0.5f, -0.5f,  0.5f, -0.5f ),
115
         new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
116
         new Static4D(  0.5f, -0.5f, -0.5f, -0.5f )
117
         };
118
    }
119
120
///////////////////////////////////////////////////////////////////////////////////////////////////
121
122
  protected int[] getSolvedQuats(int cubit, int numLayers)
123
    {
124
    if( mQuats==null ) initializeQuats();
125
    int status = retCubitSolvedStatus(cubit,numLayers);
126
    return status<0 ? null : buildSolvedQuats(Movement6.FACE_AXIS[status],mQuats);
127
    }
128
129
///////////////////////////////////////////////////////////////////////////////////////////////////
130
131
  private int getNumCorners()
132
    {
133
    return 8;
134
    }
135
136
///////////////////////////////////////////////////////////////////////////////////////////////////
137
138
  private int getNumEdges(int layers)
139
    {
140
    return (layers-2)*12;
141
    }
142
143
///////////////////////////////////////////////////////////////////////////////////////////////////
144
145
  private int getNumCentersPerFace(int layers)
146
    {
147
    return ((layers-2)*(layers-2) + (layers-1)*(layers-1));
148
    }
149
150
///////////////////////////////////////////////////////////////////////////////////////////////////
151
152
  protected Static4D[] getQuats()
153
    {
154
    if( mQuats==null ) initializeQuats();
155
    return mQuats;
156
    }
157
158
///////////////////////////////////////////////////////////////////////////////////////////////////
159
160
  protected int getSolvedFunctionIndex()
161
    {
162
    return 0;
163
    }
164
165
///////////////////////////////////////////////////////////////////////////////////////////////////
166
167
  protected int getNumStickerTypes(int numLayers)
168
    {
169
    return 3;
170
    }
171
172
///////////////////////////////////////////////////////////////////////////////////////////////////
173
174
  protected float[][] getCuts(int numLayers)
175
    {
176
    if( mCuts==null )
177
      {
178
      float[] c = numLayers==2 ? (new float[] {0.0f}) : (new float[] {-SQ3/6,+SQ3/6});
179
      mCuts = new float[][] {c,c,c,c};
180
      }
181
182
    return mCuts;
183
    }
184
185
///////////////////////////////////////////////////////////////////////////////////////////////////
186
187
  private void getLayerRotatable(int numLayers)
188
    {
189
    if( mLayerRotatable==null )
190
      {
191
      int numAxis = ROT_AXIS.length;
192
      boolean[] tmp = numLayers==2 ? (new boolean[] {true,true}) : (new boolean[] {true,false,true});
193
      mLayerRotatable = new boolean[numAxis][];
194
      for(int i=0; i<numAxis; i++) mLayerRotatable[i] = tmp;
195
      }
196
    }
197
198
///////////////////////////////////////////////////////////////////////////////////////////////////
199
200
  protected int getNumCubitFaces()
201
    {
202
    return 6;
203
    }
204
205
///////////////////////////////////////////////////////////////////////////////////////////////////
206
207
  protected float[][] getCubitPositions(int numLayers)
208
    {
209
    final float DIST_CORNER = numLayers-1;
210
    final float DIST_EDGE   = numLayers-1;
211
    final float DIST_CENTER = numLayers-1;
212
213
    final int numCorners = getNumCorners();
214
    final int numEdges   = getNumEdges(numLayers);
215
    final int numCenters = 6*getNumCentersPerFace(numLayers);
216
217
    final float[][] CENTERS = new float[numCorners+numEdges+numCenters][];
218
219
    /// CORNERS //////////////////////////////////////////////
220
221
    CENTERS[0] = new float[] { DIST_CORNER, DIST_CORNER, DIST_CORNER };
222
    CENTERS[1] = new float[] { DIST_CORNER, DIST_CORNER,-DIST_CORNER };
223
    CENTERS[2] = new float[] { DIST_CORNER,-DIST_CORNER, DIST_CORNER };
224
    CENTERS[3] = new float[] { DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
225
    CENTERS[4] = new float[] {-DIST_CORNER, DIST_CORNER, DIST_CORNER };
226
    CENTERS[5] = new float[] {-DIST_CORNER, DIST_CORNER,-DIST_CORNER };
227
    CENTERS[6] = new float[] {-DIST_CORNER,-DIST_CORNER, DIST_CORNER };
228
    CENTERS[7] = new float[] {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
229
230
    /// EDGES ///////////////////////////////////////////////
231
232
    final float[][]  edgeTable =
233
        {
234
            {0,+DIST_EDGE,+DIST_EDGE},
235
            {+DIST_EDGE,0,+DIST_EDGE},
236
            {0,-DIST_EDGE,+DIST_EDGE},
237
            {-DIST_EDGE,0,+DIST_EDGE},
238
            {+DIST_EDGE,+DIST_EDGE,0},
239
            {+DIST_EDGE,-DIST_EDGE,0},
240
            {-DIST_EDGE,-DIST_EDGE,0},
241
            {-DIST_EDGE,+DIST_EDGE,0},
242
            {0,+DIST_EDGE,-DIST_EDGE},
243
            {+DIST_EDGE,0,-DIST_EDGE},
244
            {0,-DIST_EDGE,-DIST_EDGE},
245
            {-DIST_EDGE,0,-DIST_EDGE}
246
        };
247
248
    int index=8;
249
250
    for (float[] edges : edgeTable)
251
      {
252
      float c = 3-numLayers;
253
254
      for (int j=0; j<numLayers-2; j++, c+=2, index++)
255
        {
256
        CENTERS[index] = new float[] { edges[0]==0 ? c : edges[0] ,
257
                                       edges[1]==0 ? c : edges[1] ,
258
                                       edges[2]==0 ? c : edges[2] };
259
        }
260
      }
261
262
    /// CENTERS //////////////////////////////////////////////
263
264
    final float X= -1000.0f;
265
    final float Y= -1001.0f;
266
267
    final float[][]  centerTable =
268
        {
269
            {+DIST_CENTER,X,Y},
270
            {-DIST_CENTER,X,Y},
271
            {X,+DIST_CENTER,Y},
272
            {X,-DIST_CENTER,Y},
273
            {X,Y,+DIST_CENTER},
274
            {X,Y,-DIST_CENTER}
275
        };
276
277
    float x,y, cen0, cen1, cen2;
278
279
    for( float[] centers : centerTable )
280
      {
281
      x = 2-numLayers;
282
283
      for(int i=0; i<numLayers-1; i++, x+=2)
284
        {
285
        y = 2-numLayers;
286
287
        for(int j=0; j<numLayers-1; j++, y+=2, index++)
288
          {
289
               if( centers[0]==Y ) cen0 = y;
290
          else if( centers[0]==X ) cen0 = x;
291
          else                     cen0 = centers[0];
292
293
               if( centers[1]==Y ) cen1 = y;
294
          else if( centers[1]==X ) cen1 = x;
295
          else                     cen1 = centers[1];
296
297
               if( centers[2]==Y ) cen2 = y;
298
          else if( centers[2]==X ) cen2 = x;
299
          else                     cen2 = centers[2];
300
301
          CENTERS[index] = new float[] {cen0,cen1,cen2};
302
          }
303
        }
304
305
      x = 3-numLayers;
306
307
      for(int i=0; i<numLayers-2; i++, x+=2)
308
        {
309
        y = 3-numLayers;
310
311
        for(int j=0; j<numLayers-2; j++, y+=2, index++)
312
          {
313
               if( centers[0]==Y ) cen0 = y;
314
          else if( centers[0]==X ) cen0 = x;
315
          else                     cen0 = centers[0];
316
317
               if( centers[1]==Y ) cen1 = y;
318
          else if( centers[1]==X ) cen1 = x;
319
          else                     cen1 = centers[1];
320
321
               if( centers[2]==Y ) cen2 = y;
322
          else if( centers[2]==X ) cen2 = x;
323
          else                     cen2 = centers[2];
324
325
          CENTERS[index] = new float[] {cen0,cen1,cen2};
326
          }
327
        }
328
      }
329
330
    return CENTERS;
331
    }
332
333
///////////////////////////////////////////////////////////////////////////////////////////////////
334
335
  protected Static4D getQuat(int cubit, int numLayers)
336
    {
337
    if( mQuats==null ) initializeQuats();
338
    int numCorners = getNumCorners();
339
    int numEdges   = getNumEdges(numLayers);
340
341
    if( cubit<numCorners )
342
      {
343
      switch(cubit)
344
        {
345
        case  0: return mQuats[0];                         //  unit quat
346
        case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
347
        case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
348
        case  3: return mQuats[1];                         // 180 along X
349
        case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
350
        case  5: return mQuats[2];                         // 180 along Y
351
        case  6: return mQuats[3];                         // 180 along Z
352
        case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
353
        }
354
      }
355
    else if( cubit<numCorners+numEdges )
356
      {
357
      int edge = (cubit-numCorners)/(numLayers-2);
358
359
      switch(edge)
360
        {
361
        case  0: return mQuats[ 0];
362
        case  1: return mQuats[ 5];
363
        case  2: return mQuats[ 3];
364
        case  3: return mQuats[11];
365
        case  4: return mQuats[ 4];
366
        case  5: return mQuats[ 7];
367
        case  6: return mQuats[ 9];
368
        case  7: return mQuats[10];
369
        case  8: return mQuats[ 2];
370
        case  9: return mQuats[ 8];
371
        case 10: return mQuats[ 1];
372
        case 11: return mQuats[ 6];
373
        }
374
      }
375
    else
376
      {
377
      int center = (cubit-numCorners-numEdges)/getNumCentersPerFace(numLayers);
378
379
      switch(center)
380
        {
381
        case 0: return new Static4D(0,-SQ2/2,0,SQ2/2);    // -90 along Y
382
        case 1: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
383
        case 2: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
384
        case 3: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
385
        case 4: return mQuats[0];                         //  unit quaternion
386
        case 5: return mQuats[1];                         // 180 along X
387
        }
388
      }
389
390
    return null;
391
    }
392
393
///////////////////////////////////////////////////////////////////////////////////////////////////
394
395
  protected ObjectShape getObjectShape(int cubit, int numLayers)
396
    {
397
    int variant = getCubitVariant(cubit,numLayers);
398
399
    if( variant==0 )
400
      {
401
      double[][] vertices = new double[][] { {-1,0,0},{0,-1,0},{0,0,-1},{-1,-1,-1},{0,0,0} };
402
      int[][] vert_indices = new int[][] { {0,1,4},{2,0,4},{1,2,4},{3,1,0},{3,2,1},{3,0,2} };
403
      int N = numLayers==2 ? 7:5;
404
      int E1= numLayers==2 ? 3:2;
405
      int E2= numLayers==2 ? 5:3;
406
      float[][] bands     = new float[][] { {0.020f,35,0.16f,0.7f,N,E1,E1}, {0.000f, 0,1.00f,0.0f,3,1,E2} };
407
      int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
408
      float[][] corners   = new float[][] { {0.05f,0.25f}, {0.05f,0.20f} };
409
      int[] cornerIndices = new int[] { 1,1,1,0,0 };
410
      float[][] centers   = new float[][] { {-0.5f, -0.5f, -0.5f} };
411
      int[] centerIndices = new int[] { 0,0,0,-1,0 };
412
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
413
      }
414
    else if( variant==1 )
415
      {
416
      double[][] vertices = new double[][] { {-1,0,0},{1,0,0},{0,-1,0},{0,0,-1} };
417
      int[][] vert_indices = new int[][] { {2,1,0},{3,0,1},{2,3,1},{3,2,0} };
418
      int N = numLayers==2 ? 7:5;
419
      int E = numLayers==2 ? 5:2;
420
      float[][] bands     = new float[][] { {0.035f,30,0.16f,0.8f,N,2,E}, {0.020f,45,0.16f,0.2f,3,1,2} };
421
      int[] bandIndices   = new int[] { 0,0,1,1 };
422
      float[][] corners   = new float[][] { {0.07f,0.20f}, {0.02f,0.30f} };
423
      int[] cornerIndices = new int[] { 0,0,1,1 };
424
      float[][] centers   = new float[][] { {0.0f, -0.5f, -0.5f} };
425
      int[] centerIndices = new int[] { 0,0,0,0 };
426
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
427
      }
428
    else
429
      {
430
      double[][] vertices = new double[][] { {-1,0,0},{0,-1,0},{1,0,0},{0,1,0},{0,0,-1} };
431
      int[][] vert_indices = new int[][] { {0,1,2,3},{4,1,0},{4,2,1},{4,3,2},{4,0,3} };
432
      int N = numLayers==2 ? 7:6;
433
      int E = numLayers==2 ? 3:1;
434
      float[][] bands     = new float[][] { {0.04f,35,SQ2/8,0.9f,N,E,E}, {0.000f,0,1,0.0f,3,0,0} };
435
      int[] bandIndices   = new int[] { 0,1,1,1,1 };
436
      float[][] corners   = new float[][] { {0.06f,0.15f} };
437
      int[] cornerIndices = new int[] { 0,0,0,0,0 };
438
      float[][] centers   = new float[][] { {0,0,-0.4f} };
439
      int[] centerIndices = new int[] { 0,0,0,0,-1 };
440
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
441
      }
442
    }
443
444
///////////////////////////////////////////////////////////////////////////////////////////////////
445
446
  protected int getNumCubitVariants(int numLayers)
447
    {
448
    return 3;
449
    }
450
451
///////////////////////////////////////////////////////////////////////////////////////////////////
452
453
  protected int getCubitVariant(int cubit, int numLayers)
454
    {
455
    int numCorners = getNumCorners();
456
    if( cubit<numCorners ) return 0;
457
    int numEdges = getNumEdges(numLayers);
458
    return cubit<numCorners+numEdges ? 1:2;
459
    }
460
461
///////////////////////////////////////////////////////////////////////////////////////////////////
462
463
  protected int getFaceColor(int cubit, int cubitface, int numLayers)
464
    {
465
    if( mCornerMap==null || mEdgeMap==null || mCenterMap==null )
466
      {
467
      mCornerMap = new int[][]
468
         {
469
           {  4, 2, 0, 18,18,18 },
470
           {  2, 5, 0, 18,18,18 },
471
           {  3, 4, 0, 18,18,18 },
472
           {  5, 3, 0, 18,18,18 },
473
           {  1, 2, 4, 18,18,18 },
474
           {  5, 2, 1, 18,18,18 },
475
           {  4, 3, 1, 18,18,18 },
476
           {  1, 3, 5, 18,18,18 },
477
         };
478
479
      mEdgeMap = new int[][]
480
         {
481
           { 10, 8, 18,18,18,18 },
482
           {  6,10, 18,18,18,18 },
483
           { 10, 9, 18,18,18,18 },
484
           {  7,10, 18,18,18,18 },
485
           {  8, 6, 18,18,18,18 },
486
           {  9, 6, 18,18,18,18 },
487
           {  9, 7, 18,18,18,18 },
488
           {  8, 7, 18,18,18,18 },
489
           { 11, 8, 18,18,18,18 },
490
           {  6,11, 18,18,18,18 },
491
           { 11, 9, 18,18,18,18 },
492
           {  7,11, 18,18,18,18 }
493
         };
494
495
      mCenterMap = new int[][]
496
         {
497
           { 12, 18,18,18,18,18 },
498
           { 13, 18,18,18,18,18 },
499
           { 14, 18,18,18,18,18 },
500
           { 15, 18,18,18,18,18 },
501
           { 16, 18,18,18,18,18 },
502
           { 17, 18,18,18,18,18 },
503
         };
504
      }
505
506
    int numCorners = getNumCorners();
507
    int numEdges   = getNumEdges(numLayers);
508
509
    if( cubit<numCorners )
510
      {
511
      return mCornerMap[cubit][cubitface];
512
      }
513
    else if( cubit<numCorners+numEdges )
514
      {
515
      int edge = (cubit-numCorners)/(numLayers-2);
516
      return mEdgeMap[edge][cubitface];
517
      }
518
    else
519
      {
520
      int center = (cubit-numCorners-numEdges)/getNumCentersPerFace(numLayers);
521
      return mCenterMap[center][cubitface];
522
      }
523
    }
524
525
///////////////////////////////////////////////////////////////////////////////////////////////////
526
527
  protected ObjectSticker retSticker(int face)
528
    {
529
    if( mStickers==null )
530
      {
531
      float[][] STICKERS = new float[][]
532
          {
533
             { -0.5f, 0.25f, 0.25f,  -0.5f, 0.25f, 0.25f  },
534
             { -0.5f, 0.00f, 0.00f,  -0.5f, 0.50f, 0.0f, 0.0f, 0.5f }
535
          };
536
537
      final float R1 = 0.025f;
538
      final float R2 = 0.025f;
539
      final float R3 = 0.055f;
540
      final float[][] radii  = { { R1,R1,R1 },{ R2,R2,R2 },{ R3,R3,R3,R3 } };
541
      final float[] strokes = { 0.045f, 0.035f, 0.035f };
542
543
      mStickers = new ObjectSticker[STICKERS.length+1];
544
545
      for(int s=0; s<STICKERS.length+1; s++)
546
        {
547
        int index = s<2 ? 0:1;
548
        mStickers[s] = new ObjectSticker(STICKERS[index],null,radii[s],strokes[s]);
549
        }
550
      }
551
552
    return mStickers[face/NUM_FACE_COLORS];
553
    }
554
555
///////////////////////////////////////////////////////////////////////////////////////////////////
556
// PUBLIC API
557
558
  public Static3D[] getRotationAxis()
559
    {
560
    return ROT_AXIS;
561
    }
562
563
///////////////////////////////////////////////////////////////////////////////////////////////////
564
565
  public Movement getMovement()
566
    {
567
    if( mMovement==null )
568
      {
569
      int numLayers = getNumLayers();
570
      if( mCuts==null ) getCuts(numLayers);
571
      getLayerRotatable(numLayers);
572
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,2*numLayers-2,TYPE_SPLIT_CORNER,ENABLED);
573
      }
574
    return mMovement;
575
    }
576
577
///////////////////////////////////////////////////////////////////////////////////////////////////
578
579
  public int[] getBasicAngle()
580
    {
581
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
582
    return mBasicAngle;
583
    }
584
585
///////////////////////////////////////////////////////////////////////////////////////////////////
586
587
  public int getObjectName(int numLayers)
588
    {
589
    switch(numLayers)
590
      {
591
      case 2: return R.string.skew2;
592
      case 3: return R.string.skew3;
593
      }
594
    return R.string.skew2;
595
    }
596
597
///////////////////////////////////////////////////////////////////////////////////////////////////
598
599
  public int getInventor(int numLayers)
600
    {
601
    switch(numLayers)
602
      {
603
      case 2: return R.string.skew2_inventor;
604
      case 3: return R.string.skew3_inventor;
605
      }
606
    return R.string.skew2_inventor;
607
    }
608
609
///////////////////////////////////////////////////////////////////////////////////////////////////
610
611
  public int getComplexity(int numLayers)
612
    {
613
    switch(numLayers)
614
      {
615
      case 2: return 4;
616
      case 3: return 8;
617
      }
618
    return 5;
619
    }
620
}