Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyMegaminx.java @ 3a0990b1

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.TouchControlDodecahedron.COS54;
13
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.SIN54;
14 29b82486 Leszek Koltunski
15 ecf3d6e3 Leszek Koltunski
import org.distorted.library.type.Static3D;
16 29b82486 Leszek Koltunski
import org.distorted.library.type.Static4D;
17 aacf5e27 Leszek Koltunski
import org.distorted.library.helpers.QuatHelper;
18 29b82486 Leszek Koltunski
19 84a17011 Leszek Koltunski
import org.distorted.objectlib.helpers.FactoryCubit;
20 3ee1d662 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectFaceShape;
21 ae9d9227 leszek
import org.distorted.objectlib.metadata.Metadata;
22 84a17011 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectVertexEffects;
23 cf93ea4e Leszek Koltunski
import org.distorted.objectlib.main.InitAssets;
24 361fd0de leszek
import org.distorted.objectlib.metadata.ListObjects;
25 198c5bf0 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectShape;
26 29b82486 Leszek Koltunski
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28
29 9ba7f3f6 Leszek Koltunski
public class TwistyMegaminx extends TwistyDodecahedron
30 29b82486 Leszek Koltunski
{
31
  static final float MEGA_D = 0.04f;
32
  private int[] mQuatCenterIndices;
33
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35
36 ae9d9227 leszek
  public TwistyMegaminx(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
37 29b82486 Leszek Koltunski
    {
38 ae9d9227 leszek
    super(iconMode, quat, move, scale, meta, asset);
39 29b82486 Leszek Koltunski
    }
40
41
///////////////////////////////////////////////////////////////////////////////////////////////////
42
43
  private void initializeCenterIndices()
44
    {
45 a4af26c1 Leszek Koltunski
    mQuatCenterIndices = new int[] { 0, 35, 55, 38, 48, 41, 42, 58, 57, 46, 29, 59 };
46 29b82486 Leszek Koltunski
    }
47
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49
50
  private int numCubitsPerCorner(int numLayers)
51
    {
52
    return 3*((numLayers-1)/2)*((numLayers-3)/2) + 1;
53
    }
54
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56
57
  private int numCubitsPerEdge(int numLayers)
58
    {
59
    return numLayers-2;
60
    }
61
62
///////////////////////////////////////////////////////////////////////////////////////////////////
63
64 7bbfc84f Leszek Koltunski
  public float[][] getCuts(int[] numLayers)
65 29b82486 Leszek Koltunski
    {
66 a57e6870 Leszek Koltunski
    return genericGetCuts(numLayers[0],0.5f-MEGA_D);
67 29b82486 Leszek Koltunski
    }
68
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70
71
  private float[] computeCenter(int center, int numLayers)
72
    {
73
    if( mCenterCoords==null ) initializeCenterCoords();
74
    float[] coords = mCenterCoords[center];
75 0351740a Leszek Koltunski
    float A = (float)numLayers/3;
76 29b82486 Leszek Koltunski
77
    return new float[] { A*coords[0], A*coords[1], A*coords[2] };
78
    }
79
80
///////////////////////////////////////////////////////////////////////////////////////////////////
81
// Fill out mCurrCorner{X,Y,Z} by applying appropriate Quat to mBasicCorner{X,Y,Z}
82
// Appropriate one: QUATS[QUAT_INDICES[corner]].
83
84
  private void computeBasicCornerVectors(int corner)
85
    {
86
    if( mQuatCornerIndices==null ) initializeQuatIndices();
87
    if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
88
89 89a00832 Leszek Koltunski
    Static4D quat = mObjectQuats[mQuatCornerIndices[corner]];
90 29b82486 Leszek Koltunski
91
    mCurrCornerV[0] = QuatHelper.rotateVectorByQuat(mBasicCornerV[0],quat);
92
    mCurrCornerV[1] = QuatHelper.rotateVectorByQuat(mBasicCornerV[1],quat);
93
    mCurrCornerV[2] = QuatHelper.rotateVectorByQuat(mBasicCornerV[2],quat);
94
    }
95
96
///////////////////////////////////////////////////////////////////////////////////////////////////
97
98
  private float[] computeCorner(int numCubitsPerCorner, int numLayers, int corner, int part)
99
    {
100 22e5106b leszek
    if( mCorners==null ) mCorners = initializeCorners();
101 29b82486 Leszek Koltunski
    if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
102
103
    float D = numLayers/3.0f;
104
    float[] corn = mCorners[corner];
105
106
    if( part==0 )
107
      {
108
      return new float[] { corn[0]*D, corn[1]*D, corn[2]*D };
109
      }
110
    else
111
      {
112
      float E = 2.0f*D*(0.5f-MEGA_D)/(0.5f*(numLayers-1));
113
      int N = (numCubitsPerCorner-1)/3;
114
      int block = (part-1) % N;
115
      int index = (part-1) / N;
116
      Static4D pri = mCurrCornerV[index];
117
      Static4D sec = mCurrCornerV[(index+2)%3];
118
119
      int layers= (numLayers-3)/2;
120
      int multP = (block % layers) + 1;
121
      int multS = (block / layers);
122
123
      return new float[] {
124
                          corn[0]*D + (pri.get0()*multP + sec.get0()*multS)*E,
125
                          corn[1]*D + (pri.get1()*multP + sec.get1()*multS)*E,
126
                          corn[2]*D + (pri.get2()*multP + sec.get2()*multS)*E
127
                         };
128
      }
129
    }
130
131
///////////////////////////////////////////////////////////////////////////////////////////////////
132
133
  private int computeEdgeType(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
134
    {
135
    int part = (cubit - NUM_CORNERS*numCubitsPerCorner) % numCubitsPerEdge;
136
    return (part+1)/2;
137
    }
138
139
///////////////////////////////////////////////////////////////////////////////////////////////////
140
141
  private float[] computeEdge(int numLayers, int edge, int part)
142
    {
143
    if( mCenterCoords==null ) initializeCenterCoords();
144 22e5106b leszek
    if( mCorners==null ) mCorners = initializeCorners();
145
    if( mEdgeMap==null ) mEdgeMap = initializeEdgeMap();
146 29b82486 Leszek Koltunski
147
    float D = numLayers/3.0f;
148
    float[] c1 = mCorners[ mEdgeMap[edge][0] ];
149
    float[] c2 = mCorners[ mEdgeMap[edge][1] ];
150
    float x = D * (c1[0]+c2[0]) / 2;
151
    float y = D * (c1[1]+c2[1]) / 2;
152
    float z = D * (c1[2]+c2[2]) / 2;
153
154
    if( part==0 )
155
      {
156
      return new float[] { x, y, z };
157
      }
158
    else
159
      {
160
      int mult = (part+1)/2;
161
      int dir  = (part+1)%2;
162
      float[] center = mCenterCoords[ mEdgeMap[edge][dir+2] ];
163
164
      float vX = D*center[0] - x;
165
      float vY = D*center[1] - y;
166
      float vZ = D*center[2] - z;
167
168
      float A = 3*mult*D*(0.5f-MEGA_D)*COS18/((numLayers-1)*0.5f);
169
      A /= (float)Math.sqrt(vX*vX+vY*vY+vZ*vZ);
170
171
      return new float[] { x+A*vX, y+A*vY, z+A*vZ };
172
      }
173
    }
174
175
///////////////////////////////////////////////////////////////////////////////////////////////////
176
177 7b832206 Leszek Koltunski
  public float[][] getCubitPositions(int[] numLayers)
178 29b82486 Leszek Koltunski
    {
179 a57e6870 Leszek Koltunski
    int numL = numLayers[0];
180
    int numCubitsPerCorner = numCubitsPerCorner(numL);
181
    int numCubitsPerEdge   = numCubitsPerEdge(numL);
182 29b82486 Leszek Koltunski
    int numCubits = NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge + NUM_CENTERS;
183
    int index=0;
184
185 9659b849 leszek
    final float[][] positions = new float[numCubits][];
186 29b82486 Leszek Koltunski
187
    for(int corner=0; corner<NUM_CORNERS; corner++)
188
      {
189
      computeBasicCornerVectors(corner);
190
191
      for(int part=0; part<numCubitsPerCorner; part++, index++)
192
        {
193 9659b849 leszek
        positions[index] = computeCorner(numCubitsPerCorner,numL,corner,part);
194 29b82486 Leszek Koltunski
        }
195
      }
196
197
    for(int edge=0; edge<NUM_EDGES; edge++)
198
      {
199
      for(int part=0; part<numCubitsPerEdge; part++, index++)
200
        {
201 9659b849 leszek
        positions[index] = computeEdge(numL, edge, part );
202 29b82486 Leszek Koltunski
        }
203
      }
204
205
    for(int center=0; center<NUM_CENTERS; center++, index++)
206
      {
207 9659b849 leszek
      positions[index] = computeCenter(center, numL);
208 29b82486 Leszek Koltunski
      }
209
210 9659b849 leszek
    return positions;
211 29b82486 Leszek Koltunski
    }
212
213 d0e6cf7f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
214
215
  public Static4D getCubitQuats(int cubit, int[] numLayers)
216
    {
217
    int numL = numLayers[0];
218
    int numCubitsPerCorner = numCubitsPerCorner(numL);
219
    int numCubitsPerEdge   = numCubitsPerEdge(numL);
220
221 89a00832 Leszek Koltunski
    return mObjectQuats[getQuat(cubit,numCubitsPerCorner,numCubitsPerEdge)];
222 d0e6cf7f Leszek Koltunski
    }
223
224 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
225
226
  private int getQuat(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
227
    {
228
    if( mQuatCornerIndices==null || mQuatEdgeIndices==null ) initializeQuatIndices();
229
    if( mQuatCenterIndices==null ) initializeCenterIndices();
230
231
    if( cubit < NUM_CORNERS*numCubitsPerCorner )
232
      {
233
      int corner = cubit/numCubitsPerCorner;
234
      return mQuatCornerIndices[corner];
235
      }
236
237
    if( cubit < NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
238
      {
239
      int edge = (cubit-NUM_CORNERS*numCubitsPerCorner)/numCubitsPerEdge;
240
      return mQuatEdgeIndices[edge];
241
      }
242
243
    int center = cubit - NUM_CORNERS*numCubitsPerCorner - NUM_EDGES*numCubitsPerEdge;
244
    return mQuatCenterIndices[center];
245
    }
246
247
///////////////////////////////////////////////////////////////////////////////////////////////////
248
249 84a17011 Leszek Koltunski
  private float[][] getVertices(int variant)
250 29b82486 Leszek Koltunski
    {
251 e30c522a Leszek Koltunski
    int[] numLayers = getNumLayers();
252 29b82486 Leszek Koltunski
    int numVariants = getNumCubitVariants(numLayers);
253 e30c522a Leszek Koltunski
    int numL        = numLayers[0];
254 29b82486 Leszek Koltunski
255
    if( variant==0 )
256
      {
257 a57e6870 Leszek Koltunski
      float width = numL*(0.5f-MEGA_D)/(0.5f*(numL-1));
258 57ef6378 Leszek Koltunski
      float X = width*COS18*SIN_HALFD;
259
      float Y = width*SIN18;
260
      float Z = width*COS18*COS_HALFD;
261 29b82486 Leszek Koltunski
262 84a17011 Leszek Koltunski
      return new float[][]
263 29b82486 Leszek Koltunski
        {
264 57ef6378 Leszek Koltunski
            {   0,   0      ,   0 },
265 29b82486 Leszek Koltunski
            {   X,   Y      ,  -Z },
266 57ef6378 Leszek Koltunski
            {   0, 2*Y      ,-2*Z },
267 29b82486 Leszek Koltunski
            {  -X,   Y      ,  -Z },
268 57ef6378 Leszek Koltunski
            {   0,   0-width,   0 },
269 29b82486 Leszek Koltunski
            {   X,   Y-width,  -Z },
270 57ef6378 Leszek Koltunski
            {   0, 2*Y-width,-2*Z },
271 29b82486 Leszek Koltunski
            {  -X,   Y-width,  -Z },
272
        };
273
      }
274 84a17011 Leszek Koltunski
    else if( variant<numVariants-1 )
275 29b82486 Leszek Koltunski
      {
276 e30c522a Leszek Koltunski
      int type = variant-1;
277 a57e6870 Leszek Koltunski
      float height= numL*(0.5f-MEGA_D)*COS18/((numL-1)*0.5f);
278
      float width = numL*2*MEGA_D + 2*type*height*SIN18/COS18;
279 29b82486 Leszek Koltunski
280 57ef6378 Leszek Koltunski
      float W = width/2;
281
      float X = height*SIN_HALFD;
282
      float Y = height*SIN18/COS18;
283
      float Z = height*COS_HALFD;
284 29b82486 Leszek Koltunski
285 84a17011 Leszek Koltunski
      return new float[][]
286 29b82486 Leszek Koltunski
        {
287 57ef6378 Leszek Koltunski
            {   0,   W   ,   0 },
288 29b82486 Leszek Koltunski
            {   X, W+Y   ,  -Z },
289 57ef6378 Leszek Koltunski
            {   0, W+2*Y ,-2*Z },
290 29b82486 Leszek Koltunski
            {  -X, W+Y   ,  -Z },
291 57ef6378 Leszek Koltunski
            {   0,  -W   ,   0 },
292 29b82486 Leszek Koltunski
            {   X,-W-Y   ,  -Z },
293 57ef6378 Leszek Koltunski
            {   0,-W-2*Y ,-2*Z },
294 29b82486 Leszek Koltunski
            {  -X,-W-Y   ,  -Z },
295
        };
296
      }
297
    else
298
      {
299 a57e6870 Leszek Koltunski
      float width = 2*numL*(MEGA_D+(0.5f-MEGA_D)*SIN18);
300 0351740a Leszek Koltunski
      final double ANGLE = 0.825f*Math.PI;
301 57ef6378 Leszek Koltunski
      final float cosA  = (float)Math.cos(ANGLE);
302
      final float sinA  = (float)Math.sin(ANGLE);
303 29b82486 Leszek Koltunski
304
      float R  = 0.5f*width/COS54;
305
      float X1 = R*COS54;
306
      float Y1 = R*SIN54;
307
      float X2 = R*COS18;
308
      float Y2 = R*SIN18;
309
310 84a17011 Leszek Koltunski
      return new float[][]
311 29b82486 Leszek Koltunski
        {
312 84a17011 Leszek Koltunski
          {-X1, Y1*sinA, Y1*cosA},
313 29b82486 Leszek Koltunski
          {-X2,-Y2*sinA,-Y2*cosA},
314 c3a033e9 Leszek Koltunski
          { 0 ,-R*sinA ,-R*cosA },
315 29b82486 Leszek Koltunski
          {+X2,-Y2*sinA,-Y2*cosA},
316 84a17011 Leszek Koltunski
          {+X1, Y1*sinA, Y1*cosA},
317 c3a033e9 Leszek Koltunski
          { 0 , R*cosA ,-R*sinA }
318 29b82486 Leszek Koltunski
        };
319 84a17011 Leszek Koltunski
      }
320
    }
321 29b82486 Leszek Koltunski
322 84a17011 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
323
324
  public ObjectShape getObjectShape(int variant)
325
    {
326
    int[] numLayers = getNumLayers();
327
    int numVariants = getNumCubitVariants(numLayers);
328
329
    if( variant<numVariants-1 )
330
      {
331
      int[][] indices =
332
        {
333 2a495bdb leszek
          {4,5,1,0},
334
          {7,4,0,3},
335
          {0,1,2,3},
336
          {7,6,5,4},
337
          {2,1,5,6},
338
          {3,2,6,7}
339 84a17011 Leszek Koltunski
        };
340
341
      return new ObjectShape(getVertices(variant), indices);
342
      }
343
    else
344
      {
345 4e9f2df5 Leszek Koltunski
      int[][] indices =
346 29b82486 Leszek Koltunski
        {
347
          {0,1,2,3,4},
348 846b69f3 Leszek Koltunski
          {5,1,0},
349
          {5,2,1},
350
          {5,3,2},
351
          {5,4,3},
352
          {5,0,4}
353 29b82486 Leszek Koltunski
        };
354
355 84a17011 Leszek Koltunski
      return new ObjectShape(getVertices(variant), indices);
356 3ee1d662 Leszek Koltunski
      }
357
    }
358
359
///////////////////////////////////////////////////////////////////////////////////////////////////
360
361
  public ObjectFaceShape getObjectFaceShape(int variant)
362
    {
363
    int[] numLayers = getNumLayers();
364
    int numVariants = getNumCubitVariants(numLayers);
365
    int numL        = numLayers[0];
366
    boolean small   = numL<=3;
367 347f6cc1 Leszek Koltunski
    int angle = 25;
368
    float R = 0.7f;
369
    float S = 0.5f;
370 3ee1d662 Leszek Koltunski
371
    if( variant==0 )
372
      {
373 3bf19410 Leszek Koltunski
      float h1 = isInIconMode() ? 0.001f : 0.04f;
374 347f6cc1 Leszek Koltunski
      float[][] bands = { {h1,angle,R,S,3,0,0}, {0.001f,angle,R,S,2,0,0} };
375 84a17011 Leszek Koltunski
      int[] indices   = { 0,0,0,1,1,1};
376
      return new ObjectFaceShape(bands,indices,null);
377 3ee1d662 Leszek Koltunski
      }
378
    if( variant<numVariants-1 )
379
      {
380
      int N = small ? 5 : 3;
381 3bf19410 Leszek Koltunski
      float h1 = isInIconMode() ? 0.001f : 0.04f;
382 347f6cc1 Leszek Koltunski
      float[][] bands = { {h1,angle,R,S,N,0,0},{0.001f,angle,R,S,2,0,0} };
383 84a17011 Leszek Koltunski
      int[] indices   = { 0,0,1,1,1,1};
384
      return new ObjectFaceShape(bands,indices,null);
385 3ee1d662 Leszek Koltunski
      }
386
    else
387
      {
388 66de0d91 Leszek Koltunski
      int N = small ? 4 : 3;
389 3bf19410 Leszek Koltunski
      float h1 = isInIconMode() ? 0.001f : (small ? 0.04f : 0.015f);
390 347f6cc1 Leszek Koltunski
      float[][] bands = { { h1,angle,R,S,N,0,0},{0.001f,angle,R,S,2,0,0} };
391 84a17011 Leszek Koltunski
      int[] indices   = { 0,1,1,1,1,1 };
392
      return new ObjectFaceShape(bands,indices,null);
393
      }
394
    }
395 29b82486 Leszek Koltunski
396 84a17011 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
397 29b82486 Leszek Koltunski
398 ba8dbe0e Leszek Koltunski
399
400 84a17011 Leszek Koltunski
  public ObjectVertexEffects getVertexEffects(int variant)
401
    {
402
    if( variant==0 )
403
      {
404 ba8dbe0e Leszek Koltunski
      int[] numLayers = getNumLayers();
405
      int numL        = numLayers[0];
406
      float width = numL*(0.5f-MEGA_D)/(0.5f*(numL-1));
407
      float Y = width*SIN18;
408
      float Z = width*COS18*COS_HALFD;
409
410
      float[][] corners   = { {0.03f,0.15f}, {0.02f,0.10f} };
411
      int[] cornerIndices = { 0,1,1,1,-1,-1,-1,-1 };
412
      float[][] centers   = { { 0.0f, 2*Y-width,-2*Z } };
413
      int[] centerIndices = { 0,0,0,0,-1,-1,-1,-1 };
414
      return FactoryCubit.generateVertexEffect(getVertices(variant),corners,cornerIndices,centers,centerIndices);
415 84a17011 Leszek Koltunski
      }
416
    else
417
      {
418 ba8dbe0e Leszek Koltunski
      return null;
419 29b82486 Leszek Koltunski
      }
420
    }
421
422
///////////////////////////////////////////////////////////////////////////////////////////////////
423
424 e30c522a Leszek Koltunski
  public int getNumCubitVariants(int[] numLayers)
425 29b82486 Leszek Koltunski
    {
426 ec42a6fe Leszek Koltunski
    return 2 + numLayers[0]/2;
427 29b82486 Leszek Koltunski
    }
428
429
///////////////////////////////////////////////////////////////////////////////////////////////////
430
431 e30c522a Leszek Koltunski
  public int getCubitVariant(int cubit, int[] numLayers)
432 29b82486 Leszek Koltunski
    {
433 a57e6870 Leszek Koltunski
    int numL = numLayers[0];
434
    int numCubitsPerCorner = numCubitsPerCorner(numL);
435 29b82486 Leszek Koltunski
436
    if( cubit<NUM_CORNERS*numCubitsPerCorner ) return 0;
437
438 a57e6870 Leszek Koltunski
    int numCubitsPerEdge = numCubitsPerEdge(numL);
439 29b82486 Leszek Koltunski
440
    if( cubit<NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
441
      {
442
      int type = computeEdgeType(cubit,numCubitsPerCorner,numCubitsPerEdge);
443
      return type+1;
444
      }
445
446 61aa85e4 Leszek Koltunski
    return getNumCubitVariants(numLayers)-1;
447 29b82486 Leszek Koltunski
    }
448
449
///////////////////////////////////////////////////////////////////////////////////////////////////
450
451 d53fb890 Leszek Koltunski
  public float getStickerRadius()
452 29b82486 Leszek Koltunski
    {
453 b0720f49 Leszek Koltunski
    return 0.13f;
454
    }
455 29b82486 Leszek Koltunski
456 b0720f49 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
457 29b82486 Leszek Koltunski
458 d53fb890 Leszek Koltunski
  public float getStickerStroke()
459 b0720f49 Leszek Koltunski
    {
460
    float stroke = 0.18f;
461 43a4ccff Leszek Koltunski
462 3bf19410 Leszek Koltunski
    if( isInIconMode() )
463 b0720f49 Leszek Koltunski
      {
464
      int[] numLayers = getNumLayers();
465
      stroke*= ( numLayers[0]==3 ? 1.5f : 2.2f );
466
      }
467 7af68038 Leszek Koltunski
468 b0720f49 Leszek Koltunski
    return stroke;
469
    }
470 8592461c Leszek Koltunski
471 00f4980d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
472
473 ebe8c08e leszek
  public float[][][] getStickerAngles()
474 00f4980d Leszek Koltunski
    {
475
    return null;
476
    }
477
478 61aa85e4 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
479
480 5f54927b Leszek Koltunski
  public String getShortName()
481 61aa85e4 Leszek Koltunski
    {
482 5f54927b Leszek Koltunski
    switch(getNumLayers()[0])
483 61aa85e4 Leszek Koltunski
      {
484 361fd0de leszek
      case 3: return ListObjects.MEGA_3.name();
485
      case 5: return ListObjects.MEGA_5.name();
486 61aa85e4 Leszek Koltunski
      }
487 5f54927b Leszek Koltunski
488 361fd0de leszek
    return ListObjects.MEGA_3.name();
489 5f54927b Leszek Koltunski
    }
490
491 052e0362 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
492
493
  public String[][] getTutorials()
494
    {
495
    int[] numLayers = getNumLayers();
496
497
    switch(numLayers[0])
498
      {
499
      case 3: return new String[][] {
500
                          {"gb","j4x61L5Onzk","How to Solve the Megaminx","Z3"},
501
                          {"es","xuKbT6Il0Ko","Resolver Megaminx","Cuby"},
502
                          {"ru","WgoguOY3tKI","Как собрать Мегаминкс","Алексей Ярыгин"},
503
                          {"fr","Ln1vl85puKo","Résoudre le Megaminx","Victor Colin"},
504
                          {"de","d-GQD6CBdB8","Megaminx lösen","Pezcraft"},
505
                          {"pl","BZTW6ApeRZE","Jak ułożyć: Megaminx","DżoDżo"},
506
                          {"br","0BTzkDZW078","Como resolver o Megaminx 1/2","Pedro Filho"},
507
                          {"br","VVHzZI73BN0","Como resolver o Megaminx 2/2","Pedro Filho"},
508
                          {"kr","2NUsMclrD-0","메가밍크스 예시솔빙","iamzoone"},
509 a399e91b Leszek Koltunski
                          {"vn","wRN3t91vD8w","Tutorial N.9 - Megaminx","Duy Thích Rubik"},
510 2318a72a leszek
                          {"tw","u1h8V5mLubk","五魔方 教學 (LBL+8355)","不正常魔術方塊研究中心"},
511 052e0362 Leszek Koltunski
                         };
512
      case 5: return new String[][] {
513
                          {"gb","MNBMm8BnHtQ","Solve the Gigaminx Part 1","BeardedCubing"},
514
                          {"gb","QrrP4GwqVMw","Solve the Gigaminx Part 2","BeardedCubing"},
515
                          {"es","ex5EQMBxV1U","Tutorial Gigaminx","RubikArt"},
516
                          {"ru","UJYK3SHjSGg","Как собрать Гигаминкс ч.1","Артем Мартиросов"},
517
                          {"ru","-iBCpr4Gwsw","Как собрать Гигаминкс ч.2","Артем Мартиросов"},
518
                          {"ru","4-dI7NCW8n8","Как собрать Гигаминкс ч.3","Артем Мартиросов"},
519
                          {"fr","e485fh0V1dg","Résolution du Gigaminx","Asthalis"},
520
                          {"de","APSAj4UtOAg","Megaminx 5x5 lösen","JamesKnopf"},
521
                          {"pl","qbKLMCX1wKg","Jak ułożyć Gigaminxa cz.1","chomik19751"},
522
                          {"pl","JQOXD3qleH4","Jak ułożyć Gigaminxa cz.2","chomik19751"},
523
                          {"pl","WF2katJ22FA","Jak ułożyć Gigaminxa cz.3","chomik19751"},
524
                          {"pl","jlyRrJjH4qQ","Jak ułożyć Gigaminxa cz.4","chomik19751"},
525
                          {"kr","HfPFrWuz6z4","기가밍크스 gigaminx","큐브놀이터"},
526 a399e91b Leszek Koltunski
                          {"vn","yJzejHqZscY","Tutorial N.49 - Gigaminx","Duy Thích Rubik"},
527 2318a72a leszek
                          {"tw","ofUxh8mL80M","五階五魔方 教學","不正常魔術方塊研究中心"},
528 052e0362 Leszek Koltunski
                         };
529
      }
530
    return null;
531
    }
532 29b82486 Leszek Koltunski
}