Project

General

Profile

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

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

1 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6 6133be67 Leszek Koltunski
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10
package org.distorted.objectlib.objects;
11
12 c9c71c3f Leszek Koltunski
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_HEXAHEDRON;
13
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_SPLIT_CORNER;
14 29b82486 Leszek Koltunski
15
import org.distorted.library.type.Static3D;
16
import org.distorted.library.type.Static4D;
17
18 84a17011 Leszek Koltunski
import org.distorted.objectlib.helpers.FactoryCubit;
19 3ee1d662 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectFaceShape;
20 ae9d9227 leszek
import org.distorted.objectlib.metadata.Metadata;
21 84a17011 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectVertexEffects;
22 cf93ea4e Leszek Koltunski
import org.distorted.objectlib.main.InitAssets;
23 9ba7f3f6 Leszek Koltunski
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
24 c9c71c3f Leszek Koltunski
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
25 361fd0de leszek
import org.distorted.objectlib.metadata.ListObjects;
26 198c5bf0 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectShape;
27 b31249d6 Leszek Koltunski
import org.distorted.objectlib.shape.ShapeHexahedron;
28 29b82486 Leszek Koltunski
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30
31 386af988 Leszek Koltunski
public class TwistySkewb extends ShapeHexahedron
32 29b82486 Leszek Koltunski
{
33 c87e42df leszek
  public static final Static3D[] ROT_AXIS = new Static3D[]
34 29b82486 Leszek Koltunski
         {
35 84a17011 Leszek Koltunski
           new Static3D( SQ3/3, SQ3/3, SQ3/3),
36
           new Static3D( SQ3/3, SQ3/3,-SQ3/3),
37
           new Static3D( SQ3/3,-SQ3/3, SQ3/3),
38
           new Static3D( SQ3/3,-SQ3/3,-SQ3/3)
39 29b82486 Leszek Koltunski
         };
40
41 9ba7f3f6 Leszek Koltunski
  private int[][] mEdges;
42 beee90ab Leszek Koltunski
  private int[][] mBasicAngle;
43 29b82486 Leszek Koltunski
  private float[][] mCuts;
44 82e62580 Leszek Koltunski
  private float[][] mPositions;
45 29b82486 Leszek Koltunski
46
///////////////////////////////////////////////////////////////////////////////////////////////////
47
48 ae9d9227 leszek
  public TwistySkewb(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
49 29b82486 Leszek Koltunski
    {
50 ae9d9227 leszek
    super(iconMode, 2*meta.getNumLayers()[0]-2, quat, move, scale, meta, asset);
51 29b82486 Leszek Koltunski
    }
52
53 a70b1e96 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
54
55
  @Override
56
  public float[][] returnRotationFactor()
57
    {
58
    int numL = getNumLayers()[0];
59
    float[] f = new float[numL];
60
    for(int i=0; i<numL; i++) f[i] = 1.7f;
61
    return new float[][] { f,f,f,f };
62
    }
63
64 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
65
66 9ba7f3f6 Leszek Koltunski
  public int[][] getScrambleEdges()
67 29b82486 Leszek Koltunski
    {
68 9ba7f3f6 Leszek Koltunski
    if( mEdges==null ) mEdges = ScrambleEdgeGenerator.getScrambleEdgesSingle(mBasicAngle);
69
    return mEdges;
70 29b82486 Leszek Koltunski
    }
71
72
///////////////////////////////////////////////////////////////////////////////////////////////////
73
74
  private int getNumCorners()
75
    {
76
    return 8;
77
    }
78
79
///////////////////////////////////////////////////////////////////////////////////////////////////
80
81 a57e6870 Leszek Koltunski
  private int getNumEdges(int numLayers)
82 29b82486 Leszek Koltunski
    {
83 a57e6870 Leszek Koltunski
    return (numLayers-2)*12;
84 29b82486 Leszek Koltunski
    }
85
86
///////////////////////////////////////////////////////////////////////////////////////////////////
87
88 a57e6870 Leszek Koltunski
  private int getNumCentersPerFace(int numLayers)
89 29b82486 Leszek Koltunski
    {
90 a57e6870 Leszek Koltunski
    return ((numLayers-2)*(numLayers-2) + (numLayers-1)*(numLayers-1));
91 29b82486 Leszek Koltunski
    }
92
93
///////////////////////////////////////////////////////////////////////////////////////////////////
94
95 7bbfc84f Leszek Koltunski
  public float[][] getCuts(int[] numLayers)
96 29b82486 Leszek Koltunski
    {
97
    if( mCuts==null )
98
      {
99 84a17011 Leszek Koltunski
      float[] c = numLayers[0]==2 ? (new float[] {0.0f}) : (new float[] {-SQ3/6, SQ3/6});
100 29b82486 Leszek Koltunski
      mCuts = new float[][] {c,c,c,c};
101
      }
102
103
    return mCuts;
104
    }
105
106
///////////////////////////////////////////////////////////////////////////////////////////////////
107
108 59c20632 Leszek Koltunski
  public boolean[][] getLayerRotatable(int[] numLayers)
109
    {
110
    boolean[] tmp = numLayers[0]==2 ? (new boolean[] {true,true}) : (new boolean[] {true,false,true});
111 1b7ece90 Leszek Koltunski
    return new boolean[][] { tmp,tmp,tmp,tmp };
112 59c20632 Leszek Koltunski
    }
113
114
///////////////////////////////////////////////////////////////////////////////////////////////////
115
116 11fa413d Leszek Koltunski
  public int getTouchControlType()
117 59c20632 Leszek Koltunski
    {
118 c9c71c3f Leszek Koltunski
    return TC_HEXAHEDRON;
119 59c20632 Leszek Koltunski
    }
120
121
///////////////////////////////////////////////////////////////////////////////////////////////////
122
123 11fa413d Leszek Koltunski
  public int getTouchControlSplit()
124 59c20632 Leszek Koltunski
    {
125
    return TYPE_SPLIT_CORNER;
126
    }
127
128
///////////////////////////////////////////////////////////////////////////////////////////////////
129
130
  public int[][][] getEnabled()
131 29b82486 Leszek Koltunski
    {
132 59c20632 Leszek Koltunski
    return new int[][][]
133 29b82486 Leszek Koltunski
      {
134 59c20632 Leszek Koltunski
          {{0,1},{3,1},{2,3},{0,2}},
135
          {{2,3},{3,1},{0,1},{0,2}},
136
          {{1,2},{0,1},{0,3},{2,3}},
137
          {{1,2},{2,3},{0,3},{0,1}},
138
          {{0,3},{0,2},{1,2},{1,3}},
139
          {{1,2},{0,2},{0,3},{1,3}},
140
      };
141
    }
142
143
///////////////////////////////////////////////////////////////////////////////////////////////////
144
145
  public float[] getDist3D(int[] numLayers)
146
    {
147 4c9ca251 Leszek Koltunski
    return TouchControlHexahedron.D3D;
148
    }
149
150
///////////////////////////////////////////////////////////////////////////////////////////////////
151
152
  public Static3D[] getFaceAxis()
153
    {
154
    return TouchControlHexahedron.FACE_AXIS;
155 29b82486 Leszek Koltunski
    }
156
157
///////////////////////////////////////////////////////////////////////////////////////////////////
158
159 7b832206 Leszek Koltunski
  public float[][] getCubitPositions(int[] numLayers)
160 29b82486 Leszek Koltunski
    {
161 82e62580 Leszek Koltunski
    if( mPositions==null )
162
      {
163
      int numL = numLayers[0];
164
      final float DIST_CORNER = numL-1;
165
      final float DIST_EDGE   = numL-1;
166
      final float DIST_CENTER = numL-1;
167 29b82486 Leszek Koltunski
168 82e62580 Leszek Koltunski
      final int numCorners = getNumCorners();
169
      final int numEdges   = getNumEdges(numL);
170
      final int numCenters = 6*getNumCentersPerFace(numL);
171 29b82486 Leszek Koltunski
172 82e62580 Leszek Koltunski
      mPositions = new float[numCorners+numEdges+numCenters][];
173 29b82486 Leszek Koltunski
174 82e62580 Leszek Koltunski
      /// CORNERS //////////////////////////////////////////////
175 29b82486 Leszek Koltunski
176 82e62580 Leszek Koltunski
      mPositions[0] = new float[] { DIST_CORNER, DIST_CORNER, DIST_CORNER };
177
      mPositions[1] = new float[] { DIST_CORNER, DIST_CORNER,-DIST_CORNER };
178
      mPositions[2] = new float[] { DIST_CORNER,-DIST_CORNER, DIST_CORNER };
179
      mPositions[3] = new float[] { DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
180
      mPositions[4] = new float[] {-DIST_CORNER, DIST_CORNER, DIST_CORNER };
181
      mPositions[5] = new float[] {-DIST_CORNER, DIST_CORNER,-DIST_CORNER };
182
      mPositions[6] = new float[] {-DIST_CORNER,-DIST_CORNER, DIST_CORNER };
183
      mPositions[7] = new float[] {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
184 29b82486 Leszek Koltunski
185 82e62580 Leszek Koltunski
      /// CENTERS //////////////////////////////////////////////
186 29b82486 Leszek Koltunski
187 82e62580 Leszek Koltunski
      int index=8;
188
      final float X= -1000.0f;
189
      final float Y= -1001.0f;
190 29b82486 Leszek Koltunski
191 82e62580 Leszek Koltunski
      final float[][]  centerTable =
192 29b82486 Leszek Koltunski
        {
193 dcce7b29 Leszek Koltunski
            {X,Y,+DIST_CENTER},
194
            {X,Y,-DIST_CENTER},
195 29b82486 Leszek Koltunski
            {X,+DIST_CENTER,Y},
196
            {X,-DIST_CENTER,Y},
197 dcce7b29 Leszek Koltunski
            {+DIST_CENTER,X,Y},
198
            {-DIST_CENTER,X,Y},
199 29b82486 Leszek Koltunski
        };
200
201 82e62580 Leszek Koltunski
      float x,y, cen0, cen1, cen2;
202 29b82486 Leszek Koltunski
203 82e62580 Leszek Koltunski
      for( float[] centers : centerTable )
204 29b82486 Leszek Koltunski
        {
205 82e62580 Leszek Koltunski
        x = 2-numL;
206 29b82486 Leszek Koltunski
207 82e62580 Leszek Koltunski
        for(int i=0; i<numL-1; i++, x+=2)
208 29b82486 Leszek Koltunski
          {
209 82e62580 Leszek Koltunski
          y = 2-numL;
210
211
          for(int j=0; j<numL-1; j++, y+=2, index++)
212
            {
213
                 if( centers[0]==Y ) cen0 = y;
214
            else if( centers[0]==X ) cen0 = x;
215
            else                     cen0 = centers[0];
216 29b82486 Leszek Koltunski
217 82e62580 Leszek Koltunski
                 if( centers[1]==Y ) cen1 = y;
218
            else if( centers[1]==X ) cen1 = x;
219
            else                     cen1 = centers[1];
220 29b82486 Leszek Koltunski
221 82e62580 Leszek Koltunski
                 if( centers[2]==Y ) cen2 = y;
222
            else if( centers[2]==X ) cen2 = x;
223
            else                     cen2 = centers[2];
224 29b82486 Leszek Koltunski
225 82e62580 Leszek Koltunski
            mPositions[index] = new float[] {cen0,cen1,cen2};
226
            }
227 29b82486 Leszek Koltunski
          }
228
229 82e62580 Leszek Koltunski
        x = 3-numL;
230 29b82486 Leszek Koltunski
231 82e62580 Leszek Koltunski
        for(int i=0; i<numL-2; i++, x+=2)
232 29b82486 Leszek Koltunski
          {
233 82e62580 Leszek Koltunski
          y = 3-numL;
234
235
          for(int j=0; j<numL-2; j++, y+=2, index++)
236
            {
237
                 if( centers[0]==Y ) cen0 = y;
238
            else if( centers[0]==X ) cen0 = x;
239
            else                     cen0 = centers[0];
240 29b82486 Leszek Koltunski
241 82e62580 Leszek Koltunski
                 if( centers[1]==Y ) cen1 = y;
242
            else if( centers[1]==X ) cen1 = x;
243
            else                     cen1 = centers[1];
244 29b82486 Leszek Koltunski
245 82e62580 Leszek Koltunski
                 if( centers[2]==Y ) cen2 = y;
246
            else if( centers[2]==X ) cen2 = x;
247
            else                     cen2 = centers[2];
248 29b82486 Leszek Koltunski
249 82e62580 Leszek Koltunski
            mPositions[index] = new float[] {cen0,cen1,cen2};
250
            }
251 29b82486 Leszek Koltunski
          }
252
        }
253
254 82e62580 Leszek Koltunski
      /// EDGES ///////////////////////////////////////////////
255 7af68038 Leszek Koltunski
256 82e62580 Leszek Koltunski
      final float[][]  edgeTable =
257 7af68038 Leszek Koltunski
        {
258
            {0,+DIST_EDGE,+DIST_EDGE},
259
            {+DIST_EDGE,0,+DIST_EDGE},
260
            {0,-DIST_EDGE,+DIST_EDGE},
261
            {-DIST_EDGE,0,+DIST_EDGE},
262
            {+DIST_EDGE,+DIST_EDGE,0},
263
            {+DIST_EDGE,-DIST_EDGE,0},
264
            {-DIST_EDGE,-DIST_EDGE,0},
265
            {-DIST_EDGE,+DIST_EDGE,0},
266
            {0,+DIST_EDGE,-DIST_EDGE},
267
            {+DIST_EDGE,0,-DIST_EDGE},
268
            {0,-DIST_EDGE,-DIST_EDGE},
269
            {-DIST_EDGE,0,-DIST_EDGE}
270
        };
271
272 82e62580 Leszek Koltunski
      for (float[] edges : edgeTable)
273 7af68038 Leszek Koltunski
        {
274 82e62580 Leszek Koltunski
        float c = 3-numL;
275
276
        for (int j=0; j<numL-2; j++, c+=2, index++)
277
          {
278
          mPositions[index] = new float[] { edges[0]==0 ? c : edges[0] ,
279
                                            edges[1]==0 ? c : edges[1] ,
280
                                            edges[2]==0 ? c : edges[2] };
281
          }
282 7af68038 Leszek Koltunski
        }
283
      }
284
285 82e62580 Leszek Koltunski
    return mPositions;
286 29b82486 Leszek Koltunski
    }
287
288
///////////////////////////////////////////////////////////////////////////////////////////////////
289
290 d0e6cf7f Leszek Koltunski
  public Static4D getCubitQuats(int cubit, int[] numLayers)
291 29b82486 Leszek Koltunski
    {
292 a57e6870 Leszek Koltunski
    int numL = numLayers[0];
293 29b82486 Leszek Koltunski
    int numCorners = getNumCorners();
294 7af68038 Leszek Koltunski
    int numCentersPerFace = getNumCentersPerFace(numL);
295
    int numCenters = 6*numCentersPerFace;
296 29b82486 Leszek Koltunski
297
    if( cubit<numCorners )
298
      {
299
      switch(cubit)
300
        {
301 802fe251 Leszek Koltunski
        case  0: return mObjectQuats[0];                   //  unit quat
302 29b82486 Leszek Koltunski
        case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
303
        case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
304 802fe251 Leszek Koltunski
        case  3: return mObjectQuats[9];                   // 180 along X
305 29b82486 Leszek Koltunski
        case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
306 802fe251 Leszek Koltunski
        case  5: return mObjectQuats[11];                  // 180 along Y
307 82e62580 Leszek Koltunski
        case  6: return mObjectQuats[10];                  // 180 along Z
308 29b82486 Leszek Koltunski
        case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
309
        }
310
      }
311 7af68038 Leszek Koltunski
    else if( cubit<numCorners+numCenters )
312
      {
313
      int center = (cubit-numCorners)/numCentersPerFace;
314
315
      switch(center)
316
        {
317 dcce7b29 Leszek Koltunski
        case 0: return mObjectQuats[0];
318
        case 1: return mObjectQuats[9];
319
        case 2: return mObjectQuats[1];
320
        case 3: return mObjectQuats[4];
321
        case 4: return mObjectQuats[2];
322
        case 5: return mObjectQuats[3];
323 7af68038 Leszek Koltunski
        }
324
      }
325
    else
326 29b82486 Leszek Koltunski
      {
327 7af68038 Leszek Koltunski
      int edge = (cubit-numCorners-numCenters)/(numL-2);
328 29b82486 Leszek Koltunski
329
      switch(edge)
330
        {
331 802fe251 Leszek Koltunski
        case  0: return mObjectQuats[ 0];
332
        case  1: return mObjectQuats[ 2];
333
        case  2: return mObjectQuats[10];
334
        case  3: return mObjectQuats[ 8];
335
        case  4: return mObjectQuats[ 1];
336
        case  5: return mObjectQuats[ 4];
337
        case  6: return mObjectQuats[ 6];
338
        case  7: return mObjectQuats[ 7];
339
        case  8: return mObjectQuats[11];
340
        case  9: return mObjectQuats[ 5];
341
        case 10: return mObjectQuats[ 9];
342
        case 11: return mObjectQuats[ 3];
343 29b82486 Leszek Koltunski
        }
344
      }
345
346
    return null;
347
    }
348
349 84a17011 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
350
351
  private float[][] getVertices(int variant)
352
    {
353
    if( variant==0 )
354
      {
355
      return new float[][] { {-1,0,0},{0,-1,0},{0,0,-1},{-1,-1,-1},{0,0,0} };
356
      }
357
    else if( variant==1 )
358
      {
359
      return new float[][] { {-1,0,0},{0,-1,0},{1,0,0},{0,1,0},{0,0,-1} };
360
      }
361
    else
362
      {
363
      return new float[][] { {-1,0,0},{1,0,0},{0,-1,0},{0,0,-1} };
364
      }
365
    }
366
367 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
368
369 e30c522a Leszek Koltunski
  public ObjectShape getObjectShape(int variant)
370 3ee1d662 Leszek Koltunski
    {
371
    if( variant==0 )
372
      {
373 84a17011 Leszek Koltunski
      int[][] indices = { {0,1,4},{2,0,4},{1,2,4},{3,1,0},{3,2,1},{3,0,2} };
374
      return new ObjectShape(getVertices(variant), indices);
375 3ee1d662 Leszek Koltunski
      }
376
    else if( variant==1 )
377
      {
378 84a17011 Leszek Koltunski
      int[][] indices = { {0,1,2,3},{4,1,0},{4,2,1},{4,3,2},{4,0,3} };
379
      return new ObjectShape(getVertices(variant), indices);
380 3ee1d662 Leszek Koltunski
      }
381
    else
382
      {
383 84a17011 Leszek Koltunski
      int[][] indices = { {2,1,0},{3,0,1},{2,3,1},{3,2,0} };
384
      return new ObjectShape(getVertices(variant), indices);
385 3ee1d662 Leszek Koltunski
      }
386
    }
387
388
///////////////////////////////////////////////////////////////////////////////////////////////////
389
390
  public ObjectFaceShape getObjectFaceShape(int variant)
391 29b82486 Leszek Koltunski
    {
392 e30c522a Leszek Koltunski
    int numL = getNumLayers()[0];
393 29b82486 Leszek Koltunski
394
    if( variant==0 )
395
      {
396 a57e6870 Leszek Koltunski
      int N = numL==2 ? 7:5;
397
      int E1= numL==2 ? 3:2;
398
      int E2= numL==2 ? 5:3;
399 3bf19410 Leszek Koltunski
      float height = isInIconMode() ? 0.001f : 0.02f;
400 84a17011 Leszek Koltunski
      float[][] bands = { {height,35,0.16f,0.7f,N,E1,E1}, {0.001f, 35,1.00f,0.0f,3,1,E2} };
401
      int[] indices   = { 0,0,0,1,1,1 };
402
      return new ObjectFaceShape(bands,indices,null);
403
      }
404
    else if( variant==1 )
405
      {
406
      int N = numL==2 ? 7:6;
407
      int E = numL==2 ? 3:1;
408
      float height = isInIconMode() ? 0.001f : 0.04f;
409
      float[][] bands = { {height,35,SQ2/8,0.9f,N,E,E}, {0.001f,35,1,0.0f,3,0,0} };
410
      int[] indices   = { 0,1,1,1,1 };
411
      return new ObjectFaceShape(bands,indices,null);
412
      }
413
    else
414
      {
415
      int N = numL==2 ? 7:5;
416
      int E = numL==2 ? 5:2;
417
      float h1 = isInIconMode() ? 0.001f : 0.035f;
418
      float h2 = isInIconMode() ? 0.001f : 0.020f;
419
      float[][] bands = { {h1,30,0.16f,0.8f,N,2,E}, {h2,45,0.16f,0.2f,3,1,2} };
420
      int[] indices   = { 0,0,1,1 };
421
      return new ObjectFaceShape(bands,indices,null);
422
      }
423
    }
424
425
///////////////////////////////////////////////////////////////////////////////////////////////////
426
427
  public ObjectVertexEffects getVertexEffects(int variant)
428
    {
429
    if( variant==0 )
430
      {
431 4e9f2df5 Leszek Koltunski
      float[][] corners   = { {0.05f,0.25f}, {0.05f,0.20f} };
432
      int[] cornerIndices = { 1,1,1,0,0 };
433
      float[][] centers   = { {-0.5f, -0.5f, -0.5f} };
434
      int[] centerIndices = { 0,0,0,-1,0 };
435 8b1d0149 leszek
      return FactoryCubit.generateVertexEffect(getVertices(variant),corners,cornerIndices,centers,centerIndices);
436 29b82486 Leszek Koltunski
      }
437
    else if( variant==1 )
438
      {
439 4e9f2df5 Leszek Koltunski
      float[][] corners   = { {0.06f,0.15f} };
440
      int[] cornerIndices = { 0,0,0,0,0 };
441
      float[][] centers   = { {0,0,-0.4f} };
442
      int[] centerIndices = { 0,0,0,0,-1 };
443 84a17011 Leszek Koltunski
       return FactoryCubit.generateVertexEffect(getVertices(variant),corners,cornerIndices,centers,centerIndices);
444 29b82486 Leszek Koltunski
      }
445 7af68038 Leszek Koltunski
    else
446
      {
447 4e9f2df5 Leszek Koltunski
      float[][] corners   = { {0.07f,0.20f}, {0.02f,0.30f} };
448
      int[] cornerIndices = { 0,0,1,1 };
449
      float[][] centers   = { {0.0f, -0.5f, -0.5f} };
450
      int[] centerIndices = { 0,0,0,0 };
451 84a17011 Leszek Koltunski
      return FactoryCubit.generateVertexEffect(getVertices(variant),corners,cornerIndices,centers,centerIndices);
452 7af68038 Leszek Koltunski
      }
453 29b82486 Leszek Koltunski
    }
454
455
///////////////////////////////////////////////////////////////////////////////////////////////////
456
457 e30c522a Leszek Koltunski
  public int getNumCubitVariants(int[] numLayers)
458 29b82486 Leszek Koltunski
    {
459 7af68038 Leszek Koltunski
    return numLayers[0]==2 ? 2:3;
460 29b82486 Leszek Koltunski
    }
461
462
///////////////////////////////////////////////////////////////////////////////////////////////////
463
464 e30c522a Leszek Koltunski
  public int getCubitVariant(int cubit, int[] numLayers)
465 29b82486 Leszek Koltunski
    {
466 7af68038 Leszek Koltunski
    return cubit<8 ? 0 : (cubit<8+6*getNumCentersPerFace(numLayers[0]) ? 1:2);
467 29b82486 Leszek Koltunski
    }
468
469 89704841 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
470
471 d53fb890 Leszek Koltunski
  public float getStickerRadius()
472 89704841 Leszek Koltunski
    {
473
    return 0.08f;
474
    }
475
476
///////////////////////////////////////////////////////////////////////////////////////////////////
477
478 d53fb890 Leszek Koltunski
  public float getStickerStroke()
479 89704841 Leszek Koltunski
    {
480
    float stroke = 0.08f;
481
482 3bf19410 Leszek Koltunski
    if( isInIconMode() )
483 89704841 Leszek Koltunski
      {
484
      int[] numLayers = getNumLayers();
485
      stroke *= (numLayers[0]==2 ? 2.0f : 2.7f);
486
      }
487
488
    return stroke;
489
    }
490
491
///////////////////////////////////////////////////////////////////////////////////////////////////
492
493 ebe8c08e leszek
  public float[][][] getStickerAngles()
494 89704841 Leszek Koltunski
    {
495
    return null;
496
    }
497
498 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
499
// PUBLIC API
500
501
  public Static3D[] getRotationAxis()
502
    {
503
    return ROT_AXIS;
504
    }
505
506
///////////////////////////////////////////////////////////////////////////////////////////////////
507
508 beee90ab Leszek Koltunski
  public int[][] getBasicAngles()
509 29b82486 Leszek Koltunski
    {
510 beee90ab Leszek Koltunski
    if( mBasicAngle ==null )
511
      {
512
      int num = getNumLayers()[0];
513
      int[] tmp = new int[num];
514
      for(int i=0; i<num; i++) tmp[i] = 3;
515
      mBasicAngle = new int[][] { tmp,tmp,tmp,tmp };
516
      }
517
518 29b82486 Leszek Koltunski
    return mBasicAngle;
519
    }
520
521 61aa85e4 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
522
523 5f54927b Leszek Koltunski
  public String getShortName()
524 61aa85e4 Leszek Koltunski
    {
525 5f54927b Leszek Koltunski
    switch(getNumLayers()[0])
526
      {
527 361fd0de leszek
      case 2: return ListObjects.SKEW_2.name();
528
      case 3: return ListObjects.SKEW_3.name();
529 5f54927b Leszek Koltunski
      }
530
531 361fd0de leszek
    return ListObjects.SKEW_2.name();
532 5f54927b Leszek Koltunski
    }
533
534 052e0362 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
535
536
  public String[][] getTutorials()
537
    {
538
    int[] numLayers = getNumLayers();
539
540
    switch(numLayers[0])
541
      {
542
      case 2: return new String[][] {
543
                          {"gb","I6132yshkeU","How to Solve the Skewb","Z3"},
544
                          {"es","wxQX3HhPgds","Resolver Skewb (Principiantes)","Cuby"},
545
                          {"ru","EICw3aqn6Bc","Как собрать Скьюб?","Алексей Ярыгин"},
546
                          {"fr","lR-GuIroh4k","Comment réussir le skewb","Rachma Nikov"},
547
                          {"de","7RX6D5pznOk","Skewb lösen","Pezcraft"},
548
                          {"pl","ofRu1fByNpk","Jak ułożyć: Skewb","DżoDżo"},
549
                          {"br","mNycauwshWs","Como resolver o Skewb","Pedro Filho"},
550
                          {"kr","5R3sU-_bMAI","SKEWB 초보 공식","iamzoone"},
551 a399e91b Leszek Koltunski
                          {"vn","Db5mXuqgQP8","Tutorial N.5 - Skewb","Duy Thích Rubik"},
552 2318a72a leszek
                          {"tw","XtZL9WFMkA8","斜轉魔方教學","不正常魔術方塊研究中心"},
553 052e0362 Leszek Koltunski
                         };
554
      case 3: return new String[][] {
555
                          {"gb","Jiuf7zQyPYI","Master Skewb Cube Tutorial","Bearded Cubing"},
556
                          {"es","8TP6p63KQCA","Master Skewb en Español","jorlozCubes"},
557
                          {"ru","7155QSp3T74","часть 1: Как собрать мастер Скьюб","Иван Циков"},
558
                          {"ru","14ey-RihjgY","часть 2: Как собрать мастер Скьюб","Иван Циков"},
559
                          {"ru","watq6TLa5_E","часть 2.5: Как собрать мастер Скьюб","Иван Циков"},
560
                          {"ru","UnsvseFBXmo","часть 3: Как собрать мастер Скьюб","Иван Циков"},
561
                          {"fr","tYMoY4EOHVA","Résolution du Master Skewb","Asthalis"},
562
                          {"de","LSErzqGNElI","Master Skewb lösen","JamesKnopf"},
563
                          {"pl","Y7l3AYFvDJI","Master Skewb TUTORIAL PL","MrUk"},
564
                          {"kr","ycR-WmXJCG0","마스터 스큐브 3번째 해법","듀나메스 큐브 해법연구소"},
565 a399e91b Leszek Koltunski
                          {"vn","uG8H0ZQTZgw","Tutorial N.35 - Master Skewb","Duy Thích Rubik"},
566 2318a72a leszek
                          {"tw","PAPa069Y92M","大師斜轉方塊 教學","不正常魔術方塊研究中心"},
567 052e0362 Leszek Koltunski
                         };
568
      }
569
    return null;
570
    }
571 29b82486 Leszek Koltunski
}