Project

General

Profile

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

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

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