Project

General

Profile

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

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

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