Project

General

Profile

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

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

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