Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyTrajber.java @ a8295031

1
///////////////////////////////////////////////////////////////////////////////////////////////////
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
import org.distorted.library.type.Static3D;
23
import org.distorted.library.type.Static4D;
24
import org.distorted.objectlib.helpers.ObjectFaceShape;
25
import org.distorted.objectlib.helpers.ObjectShape;
26
import org.distorted.objectlib.helpers.ObjectSignature;
27
import org.distorted.objectlib.main.InitData;
28
import org.distorted.objectlib.scrambling.ScrambleState;
29
import org.distorted.objectlib.main.ObjectType;
30
import org.distorted.objectlib.main.ShapeOctahedron;
31
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
32

    
33
import java.io.InputStream;
34

    
35
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_OCTAHEDRON;
36
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
37

    
38
///////////////////////////////////////////////////////////////////////////////////////////////////
39

    
40
public class TwistyTrajber extends ShapeOctahedron
41
{
42
  // Trajber 3x3: each cut is at 1/5 of the length of the segment from the center to a vertex.
43
  private static final float CUT3 = 0.20f;
44
  // Trajber 4x4: each cut is at 0.27 of the length of the segment from the center to a vertex.
45
  private static final float CUT4 = 0.27f;
46

    
47
  static final Static3D[] ROT_AXIS = new Static3D[]
48
         {
49
         new Static3D(SQ2/2, 0, SQ2/2),
50
         new Static3D(    0, 1,     0),
51
         new Static3D(SQ2/2, 0,-SQ2/2)
52
         };
53

    
54
  private ScrambleState[] mStates;
55
  private int[][] mBasicAngle;
56
  private float[][] mCuts;
57
  private float[][] mPositions;
58
  private int[] mQuatIndex;
59

    
60
///////////////////////////////////////////////////////////////////////////////////////////////////
61

    
62
  public TwistyTrajber(InitData data, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
63
    {
64
    super(data, meshState, iconMode, data.getNumLayers()[0], quat, move, scale, stream);
65
    }
66

    
67
///////////////////////////////////////////////////////////////////////////////////////////////////
68

    
69
  @Override
70
  public int[][] getSolvedQuats()
71
    {
72
    int[] numLayers = getNumLayers();
73
    int numL = numLayers[0];
74

    
75
    if( numL==3 )
76
      {
77
      return super.getSolvedQuats();
78
      }
79
    else
80
      {
81
      // special SolvedQuats for the case where there are no corner of edge cubits.
82
      // first row {0} - means there are no corners or edges.
83
      // each next defines all cubits of a singe face
84
      // (numCubits, firstCubit, cubit1,..,cubitN-1, quat0,..., quatM)
85

    
86
      return new int[][] {
87
                           {0},
88
                           {7, 0, 8,20,26,34,41,49, 10,23},
89
                           {7, 4,13,16,29,37,47,54, 10,23},
90
                           {7, 5, 9,17,25,36,45,52, 13,20},
91
                           {7, 1,12,21,30,35,43,51, 13,20},
92
                           {7, 6,11,23,27,38,44,53, 12,22},
93
                           {7, 2,14,19,28,33,42,50, 12,22},
94
                           {7, 3,10,18,24,32,40,48, 15,21},
95
                           {7, 7,15,22,31,39,46,55, 15,21},
96
                         };
97
      }
98
    }
99

    
100
///////////////////////////////////////////////////////////////////////////////////////////////////
101

    
102
  public ScrambleState[] getScrambleStates()
103
    {
104
    if( mStates==null )
105
      {
106
      int[][] m = new int[16][];
107

    
108
      for(int i=0; i<16; i++) m[i] = new int[] { 0,-1,i,0,1,i,0,2,i, 1,-1,i,1,1,i,1,2,i, 2,-1,i,2,1,i,2,2,i};
109

    
110
      mStates = new ScrambleState[]
111
          {
112
          new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ),  //  0 0
113
          new ScrambleState( new int[][] {  null, m[ 4], m[ 5] } ),  //  1 x
114
          new ScrambleState( new int[][] { m[ 6],  null, m[ 7] } ),  //  2 y
115
          new ScrambleState( new int[][] { m[ 8], m[ 9],  null } ),  //  3 z
116
          new ScrambleState( new int[][] { m[10],  null, m[ 7] } ),  //  4 xy
117
          new ScrambleState( new int[][] { m[11], m[ 9],  null } ),  //  5 xz
118
          new ScrambleState( new int[][] {  null, m[12], m[ 5] } ),  //  6 yx
119
          new ScrambleState( new int[][] { m[ 8], m[13],  null } ),  //  7 yz
120
          new ScrambleState( new int[][] {  null, m[ 4], m[14] } ),  //  8 zx
121
          new ScrambleState( new int[][] { m[ 6],  null, m[15] } ),  //  9 zy
122
          new ScrambleState( new int[][] {  null,  null, m[ 5] } ),  // 10 xyx
123
          new ScrambleState( new int[][] {  null, m[ 4],  null } ),  // 11 xzx
124
          new ScrambleState( new int[][] {  null,  null, m[ 7] } ),  // 12 yxy
125
          new ScrambleState( new int[][] { m[ 6],  null,  null } ),  // 13 yzy
126
          new ScrambleState( new int[][] {  null, m[ 9],  null } ),  // 14 zxz
127
          new ScrambleState( new int[][] { m[ 8],  null,  null } ),  // 15 zyz
128
          };
129
      }
130

    
131
    return mStates;
132
    }
133

    
134
///////////////////////////////////////////////////////////////////////////////////////////////////
135

    
136
  public float[][] getCuts(int[] numLayers)
137
    {
138
    if( mCuts==null )
139
      {
140
      float[] tmp;
141

    
142
      if( numLayers[0]==3 )
143
        {
144
        final float cut= CUT3*numLayers[0]*SQ2/2;
145
        tmp = new float[] {-cut,+cut};
146
        }
147
      else
148
        {
149
        final float cut= CUT4*numLayers[0]*SQ2/2;
150
        tmp = new float[] {-cut,0,+cut};
151
        }
152

    
153
      mCuts = new float[][] { tmp,tmp,tmp };
154
      }
155

    
156
    return mCuts;
157
    }
158

    
159
///////////////////////////////////////////////////////////////////////////////////////////////////
160

    
161
  public boolean[][] getLayerRotatable(int[] numLayers)
162
    {
163
    int numL = numLayers[0];
164
    boolean[] tmp = new boolean[numL];
165
    for(int i=0; i<numL; i++) tmp[i] = true;
166
    return new boolean[][] { tmp,tmp,tmp };
167
    }
168

    
169
///////////////////////////////////////////////////////////////////////////////////////////////////
170

    
171
  public int getTouchControlType()
172
    {
173
    return TC_OCTAHEDRON;
174
    }
175

    
176
///////////////////////////////////////////////////////////////////////////////////////////////////
177

    
178
  public int getTouchControlSplit()
179
    {
180
    return TYPE_NOT_SPLIT;
181
    }
182

    
183
///////////////////////////////////////////////////////////////////////////////////////////////////
184

    
185
  public int[][][] getEnabled()
186
    {
187
    return new int[][][]
188
      {
189
          {{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}}
190
      };
191
    }
192

    
193
///////////////////////////////////////////////////////////////////////////////////////////////////
194

    
195
  public float[] getDist3D(int[] numLayers)
196
    {
197
    return TouchControlOctahedron.D3D;
198
    }
199

    
200
///////////////////////////////////////////////////////////////////////////////////////////////////
201

    
202
  public Static3D[] getFaceAxis()
203
    {
204
    return TouchControlOctahedron.FACE_AXIS;
205
    }
206

    
207
///////////////////////////////////////////////////////////////////////////////////////////////////
208

    
209
  public float[][] getCubitPositions(int[] numLayers)
210
    {
211
    if( mPositions==null )
212
      {
213
      int numL = numLayers[0];
214
      float LEN = numL*0.5f;
215

    
216
      if( numL==3 )
217
        {
218
        mPositions = new float[][]
219
            {
220
              {  -LEN,       0,   LEN},
221
              {   LEN,       0,  -LEN},
222
              {   LEN,       0,   LEN},
223
              {  -LEN,       0,  -LEN},
224
              {     0, SQ2*LEN,     0},
225
              {     0,-SQ2*LEN,     0},
226

    
227
              {     0,     0,   LEN},
228
              {   LEN,     0,     0},
229
              {  -LEN,     0,     0},
230
              {     0,     0,  -LEN},
231
              {-LEN/2, (SQ2/2)*LEN, LEN/2},
232
              { LEN/2, (SQ2/2)*LEN,-LEN/2},
233
              {-LEN/2,-(SQ2/2)*LEN, LEN/2},
234
              { LEN/2,-(SQ2/2)*LEN,-LEN/2},
235
              { LEN/2, (SQ2/2)*LEN, LEN/2},
236
              { LEN/2,-(SQ2/2)*LEN, LEN/2},
237
              {-LEN/2, (SQ2/2)*LEN,-LEN/2},
238
              {-LEN/2,-(SQ2/2)*LEN,-LEN/2},
239

    
240
              {       0, SQ2*LEN/3, 2*LEN/3},
241
              { 2*LEN/3, SQ2*LEN/3,       0},
242
              {       0,-SQ2*LEN/3, 2*LEN/3},
243
              { 2*LEN/3,-SQ2*LEN/3,       0},
244
              {-2*LEN/3, SQ2*LEN/3,       0},
245
              {       0, SQ2*LEN/3,-2*LEN/3},
246
              {-2*LEN/3,-SQ2*LEN/3,       0},
247
              {       0,-SQ2*LEN/3,-2*LEN/3},
248
            };
249
        }
250
      else
251
        {
252
        final float A = 0.5f*SQ2*CUT4*LEN;
253
        final float B =     CUT4*LEN;
254
        final float C = CUT4/2;
255
        final float D =-1.5f*C+0.5f;
256
        final float E = 0.5f*C+0.5f;
257
        final float F = (SQ2/2)*(1-C);
258
        final float G = C*SQ2;
259
        final float H = 1-C;
260
        final float I = LEN-0.5f*B;
261
        final float J = SQ2*(LEN-B);
262

    
263
        mPositions = new float[][]
264
            {
265
              {  -I+B,  A,  I   },
266
              {  -I+B, -A,  I   },
267
              {   I  ,  A, -I+B },
268
              {   I  , -A, -I+B },
269
              {   I-B, -A, -I   },
270
              {   I-B,  A, -I   },
271
              {   I  ,  A,  I-B },
272
              {   I  , -A,  I-B },
273
              {   I-B, -A,  I   },
274
              {   I-B,  A,  I   },
275
              {  -I  , -A, -I+B },
276
              {  -I  ,  A, -I+B },
277
              {  -I+B,  A, -I   },
278
              {  -I+B, -A, -I   },
279
              {     B,  J,  0   },
280
              {    -B,  J,  0   },
281
              {     0,  J,  B   },
282
              {     0,  J, -B   },
283
              {     B, -J,  0   },
284
              {    -B, -J,  0   },
285
              {     0, -J,  B   },
286
              {     0, -J, -B   },
287
              {  -I  , -A,  I-B },
288
              {  -I  ,  A,  I-B },
289

    
290
              {     0, G*LEN, H*LEN},
291
              {     0,-G*LEN, H*LEN},
292
              { H*LEN, G*LEN,     0},
293
              { H*LEN,-G*LEN,     0},
294
              {-H*LEN, G*LEN,     0},
295
              {-H*LEN,-G*LEN,     0},
296
              {     0, G*LEN,-H*LEN},
297
              {     0,-G*LEN,-H*LEN},
298

    
299
              {-D*LEN, F*LEN, E*LEN },
300
              {-E*LEN, F*LEN, D*LEN },
301
              { E*LEN, F*LEN,-D*LEN},
302
              { D*LEN, F*LEN,-E*LEN},
303
              {-D*LEN,-F*LEN, E*LEN },
304
              {-E*LEN,-F*LEN, D*LEN },
305
              { E*LEN,-F*LEN,-D*LEN},
306
              { D*LEN,-F*LEN,-E*LEN},
307

    
308
              {+D*LEN, F*LEN,+E*LEN},
309
              {+E*LEN, F*LEN,+D*LEN},
310
              {+D*LEN,-F*LEN,+E*LEN},
311
              {+E*LEN,-F*LEN,+D*LEN},
312
              {-D*LEN, F*LEN,-E*LEN},
313
              {-E*LEN, F*LEN,-D*LEN},
314
              {-D*LEN,-F*LEN,-E*LEN},
315
              {-E*LEN,-F*LEN,-D*LEN},
316

    
317
              {       0, SQ2*LEN/3, 2*LEN/3},
318
              { 2*LEN/3, SQ2*LEN/3,       0},
319
              {       0,-SQ2*LEN/3, 2*LEN/3},
320
              { 2*LEN/3,-SQ2*LEN/3,       0},
321
              {-2*LEN/3, SQ2*LEN/3,       0},
322
              {       0, SQ2*LEN/3,-2*LEN/3},
323
              {-2*LEN/3,-SQ2*LEN/3,       0},
324
              {       0,-SQ2*LEN/3,-2*LEN/3},
325
            };
326
        }
327
      }
328

    
329
    return mPositions;
330
    }
331

    
332
///////////////////////////////////////////////////////////////////////////////////////////////////
333

    
334
  public Static4D getCubitQuats(int cubit, int[] numLayers)
335
    {
336
    if( mQuatIndex==null )
337
      {
338
      if( numLayers[0]==3 )
339
        {
340
        mQuatIndex = new int[] { 0, 2, 6, 4, 1, 3,
341
                                 0, 2, 8, 5, 7,19, 9,18, 1, 3,14,11,
342
                                 0, 1, 3, 2, 7, 5, 8,16 };
343
        }
344
      else
345
        {
346
        mQuatIndex = new int[] { 0, 9,19, 2,18, 5, 6,12,17,21,20, 4,10,16, 1,14,15,13,23,22, 3,11, 8, 7,
347
                                 0,17, 6, 2, 4, 8, 5,16,15, 7,19,13, 9,22,23,18,21, 1, 3,12,10,14,11,20,
348
                                 0, 1, 3, 2, 7, 5, 8,16 };
349
        }
350
      }
351

    
352
    return mObjectQuats[mQuatIndex[cubit]];
353
    }
354

    
355
///////////////////////////////////////////////////////////////////////////////////////////////////
356

    
357
  public ObjectShape getObjectShape(int variant)
358
    {
359
    float numL = getNumLayers()[0];
360
    final float LEN = numL*0.5f;
361
    final float CUT = numL==3 ? CUT3 : CUT4;
362

    
363
    if( variant==0 )
364
      {
365
      final float A = SQ2*CUT*LEN;
366
      final float B =     CUT*LEN;
367

    
368
      float[][] vertices = numL==3 ?
369

    
370
        new float[][]
371
          {
372
             {    0,    0,    0},
373
             {    B,    A,   -B},
374
             {    B,   -A,   -B},
375
             {  2*B,    0,    0},
376
             {    0,    0, -2*B},
377
             {  3*B,    A,   -B},
378
             {  3*B,   -A,   -B},
379
             {    B,    A, -3*B},
380
             {    B,   -A, -3*B},
381

    
382
             {  LEN    ,  A, 2*B-LEN},
383
             {  LEN    , -A, 2*B-LEN},
384
             {  LEN-2*B,  A,    -LEN},
385
             {  LEN-2*B, -A,    -LEN},
386
          }
387
        :
388
        new float[][]
389
          {
390
             {  -1.5f*B,  -0.5f*A,  0.5f*B},
391
             {  -0.5f*B,   0.5f*A, -0.5f*B},
392
             {   0.5f*B,  -0.5f*A,  0.5f*B},
393
             {   1.5f*B,   0.5f*A, -0.5f*B},
394

    
395
             {  LEN-1.5f*B,  0.5f*A, 2.5f*B-LEN},
396
             {  LEN-2.5f*B,  0.5f*A, 1.5f*B-LEN},
397
             {  LEN-2.5f*B, -0.5f*A, 1.5f*B-LEN},
398
             {  LEN-1.5f*B, -0.5f*A, 2.5f*B-LEN},
399
          };
400

    
401
      int[][] indices = numL==3 ?
402

    
403
        new int[][]
404
          {
405
             {0,3,5,1},
406
             {0,2,6,3},
407
             {0,4,8,2},
408
             {0,1,7,4},
409
             {3,6,10,9,5},
410
             {2,8,12,10,6},
411
             {4,7,11,12,8},
412
             {1,5,9,11,7},
413
             {9,10,12,11}
414
          }
415
        :
416
        new int[][]
417
          {
418
             {0,2,3,1},
419
             {2,7,4,3},
420
             {3,4,5,1},
421
             {0,1,5,6},
422
             {0,6,7,2},
423
             {7,6,5,4}
424
          };
425

    
426
      return new ObjectShape(vertices, indices);
427
      }
428
    if( variant==1 )
429
      {
430
      final float A = SQ2*CUT*LEN;
431
      final float B = LEN*(1-2*CUT);
432
      final float C = (SQ2/2)*A;
433

    
434
      float[][] vertices = numL==3 ?
435

    
436
        new float[][]
437
          {
438
             {    -B, 0,  0 },
439
             {  -B+C, A, -C },
440
             {  -B+C,-A, -C },
441
             {     B, 0,  0 },
442
             {   B-C, A, -C },
443
             {   B-C,-A, -C },
444
             {     0, A, -B },
445
             {     0,-A, -B },
446
          }
447
        :
448
        new float[][]
449
          {
450
             {    -B, -0.5f*A,    C/2 },
451
             {  -B+C, +0.5f*A,   -C/2 },
452
             {     B, -0.5f*A,    C/2 },
453
             {   B-C, +0.5f*A,   -C/2 },
454
             {     0, +0.5f*A, -B+C/2 },
455
             {     0, -0.5f*A, -B+C/2 }
456
          };
457

    
458
      int[][] indices = numL==3 ?
459

    
460
        new int[][]
461
          {
462
             {0,3,4,1},
463
             {0,2,5,3},
464
             {1,4,6},
465
             {2,7,5},
466
             {0,1,6,7,2},
467
             {3,5,7,6,4}
468
          }
469
        :
470
        new int[][]
471
          {
472
             {0,2,3,1},
473
             {1,3,4},
474
             {0,5,2},
475
             {0,1,4,5},
476
             {2,5,4,3}
477
          };
478

    
479
      return new ObjectShape(vertices, indices);
480
      }
481
    else
482
      {
483
      final float L = LEN*(1-3*CUT);
484

    
485
      float[][] vertices =
486
          {
487
             { -L, -(SQ2/3)*L,   L/3 },
488
             {  L, -(SQ2/3)*L,   L/3 },
489
             {  0,(2*SQ2/3)*L,-2*L/3 },
490
             {  0, -(SQ2/3)*L,-2*L/3 },
491
          };
492

    
493
      int[][] indices =
494
          {
495
             {0,1,2},
496
             {3,1,0},
497
             {0,2,3},
498
             {1,3,2},
499
          };
500

    
501
      return new ObjectShape(vertices, indices);
502
      }
503
    }
504

    
505
///////////////////////////////////////////////////////////////////////////////////////////////////
506

    
507
  public ObjectFaceShape getObjectFaceShape(int variant)
508
    {
509
    int numL = getNumLayers()[0];
510
    final float LEN = numL*0.5f;
511
    final float CUT = numL==3 ? CUT3 : CUT4;
512

    
513
    if( variant==0 )
514
      {
515
      float height = isInIconMode() ? 0.001f : 0.05f;
516
      float[][] bands   = { {height,35,0.15f,0.3f,4,1,1},{0.001f,35,0.15f,0.3f,4,1,1} };
517
      float[][] corners = { {0.03f,0.10f} };
518
      float[][] centers = { { LEN/2, 0.0f, -LEN/2} };
519
      int[] bandIndices = numL==3 ? new int[] { 0,0,0,0,1,1,1,1,1 } : new int[] { 0,1,1,1,1,1 };
520
      int[] indices     = numL==3 ? new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 } : new int[] { 0,0,0,-1,-1,-1,-1,-1 };
521
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
522
      }
523
    if( variant==1 )
524
      {
525
      float height = isInIconMode() ? 0.001f : 0.03f;
526
      final float B = LEN*(1-2*CUT);
527
      float[][] bands   = { {height,35,0.15f,0.3f,3,1,1},{0.001f,35,0.15f,0.3f,3,1,1} };
528
      float[][] corners = { {0.02f,0.10f} };
529
      float[][] centers = { { 0, 0, -B} };
530
      int[] bandIndices = numL==3 ? new int[] { 0,0,1,1,1,1 }       : new int[] { 0,1,1,1,1 };
531
      int[] indices     = numL==3 ? new int[] { 0,0,0,0,0,0,-1,-1 } : new int[] { 0,0,0,0,-1,-1 };
532
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
533
      }
534
    else
535
      {
536
      float height = isInIconMode() ? 0.001f : 0.03f;
537
      final float L = LEN*(1-3*CUT);
538
      float[][] bands   = { {height,35,0.15f,0.3f,4,1,1},{0.001f,35,0.15f,0.3f,4,0,0} };
539
      float[][] corners = { {0.02f,0.10f} };
540
      float[][] centers = { {0, -(SQ2/3)*L,-2*L/3} };
541
      int[] bandIndices = { 0,1,1,1 };
542
      int[] indices     = { 0,0,0,-1 };
543
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
544
      }
545
    }
546

    
547
///////////////////////////////////////////////////////////////////////////////////////////////////
548

    
549
  public int getNumCubitVariants(int[] numLayers)
550
    {
551
    return 3;
552
    }
553

    
554
///////////////////////////////////////////////////////////////////////////////////////////////////
555

    
556
  public int getCubitVariant(int cubit, int[] numLayers)
557
    {
558
    if( numLayers[0]==3 ) return cubit< 6 ? 0 : cubit<18 ? 1 : 2;
559
    else                  return cubit<24 ? 0 : cubit<48 ? 1 : 2;
560
    }
561

    
562
///////////////////////////////////////////////////////////////////////////////////////////////////
563

    
564
  public float getStickerRadius()
565
    {
566
    return 0.12f;
567
    }
568

    
569
///////////////////////////////////////////////////////////////////////////////////////////////////
570

    
571
  public float getStickerStroke()
572
    {
573
    return isInIconMode() ? 0.20f : 0.10f;
574
    }
575

    
576
///////////////////////////////////////////////////////////////////////////////////////////////////
577

    
578
  public float[][] getStickerAngles()
579
    {
580
    return null;
581
    }
582

    
583
///////////////////////////////////////////////////////////////////////////////////////////////////
584
// PUBLIC API
585

    
586
  public Static3D[] getRotationAxis()
587
    {
588
    return ROT_AXIS;
589
    }
590

    
591
///////////////////////////////////////////////////////////////////////////////////////////////////
592

    
593
  public int[][] getBasicAngles()
594
    {
595
    if( mBasicAngle ==null )
596
      {
597
      int num = getNumLayers()[0];
598
      int[] tmp = new int[num];
599
      for(int i=0; i<num; i++) tmp[i] = 4;
600
      mBasicAngle = new int[][] { tmp,tmp,tmp };
601
      }
602

    
603
    return mBasicAngle;
604
    }
605

    
606
///////////////////////////////////////////////////////////////////////////////////////////////////
607

    
608
  public String getShortName()
609
    {
610
    int[] numLayers = getNumLayers();
611
    return numLayers[0]==3 ? ObjectType.TRAJ_3.name() : ObjectType.TRAJ_4.name();
612
    }
613

    
614
///////////////////////////////////////////////////////////////////////////////////////////////////
615

    
616
  public ObjectSignature getSignature()
617
    {
618
    int[] numLayers = getNumLayers();
619

    
620
    switch(numLayers[0])
621
      {
622
      case 3: return new ObjectSignature(ObjectType.TRAJ_3);
623
      case 4: return new ObjectSignature(ObjectType.TRAJ_4);
624
      }
625

    
626
    return null;
627
    }
628

    
629
///////////////////////////////////////////////////////////////////////////////////////////////////
630

    
631
  public String getObjectName()
632
    {
633
    int[] numLayers = getNumLayers();
634

    
635
    switch(numLayers[0])
636
      {
637
      case 3: return "Trajber's Octahedron";
638
      case 4: return "Trajber 4x4";
639
      }
640

    
641
    return null;
642
    }
643

    
644
///////////////////////////////////////////////////////////////////////////////////////////////////
645

    
646
  public String getInventor()
647
    {
648
    int[] numLayers = getNumLayers();
649

    
650
    switch(numLayers[0])
651
      {
652
      case 3: return "Josef Trajber";
653
      case 4: return "Jürgen Brandt";
654
      }
655

    
656
    return null;
657
    }
658

    
659
///////////////////////////////////////////////////////////////////////////////////////////////////
660

    
661
  public int getYearOfInvention()
662
    {
663
    int[] numLayers = getNumLayers();
664
    return numLayers[0]==3 ? 1982 : 2001;
665
    }
666

    
667
///////////////////////////////////////////////////////////////////////////////////////////////////
668

    
669
  public int getComplexity()
670
    {
671
    int[] numLayers = getNumLayers();
672
    return numLayers[0]==3 ? 2 : 3;
673
    }
674

    
675
///////////////////////////////////////////////////////////////////////////////////////////////////
676

    
677
  public String[][] getTutorials()
678
    {
679
    int[] numLayers = getNumLayers();
680

    
681
    switch(numLayers[0])
682
      {
683
      case 3: return new String[][] {
684
                                     {"gb","Q2NSiuJWVvk","Trajber and UFO Tutorial","SuperAntoniovivaldi"},
685
                                     {"es","FPBirEJ8ZfY","Resolver Octaedro 3x3","Solución Rubik"},
686
                                     {"de","FjQXlwJGniQ","Trajbers Octahedron Tutorial","GerCubing"},
687
                                     {"br","kO3nMpZKv3Q","Resolver Octaedro Trajber","Rafael Cinoto"},
688
                                    };
689
      case 4: return new String[][] {
690
                                     {"gb","FZlw68I7snM","4x4 Trajber's Tutorial (1/2)","SuperAntoniovivaldi"},
691
                                     {"gb","VM0XFu7gAII","4x4 Trajber's Tutorial (2/2)","SuperAntoniovivaldi"},
692
                                     {"es","Q8ljV-feLpU","Tutorial Octaedro 4x4 (1/2)","Dany Cuber"},
693
                                     {"es","QyWpDLa1eZQ","Tutorial Octaedro 4x4 (2/2)","Dany Cuber"},
694
                                     {"ru","ikUogVow-58","Как собрать Октаэдр 4х4","RBcuber"},
695
                                     {"fr","4hxZyMVGiTA","Résolution de l'Octaèdre 4x4","asthalis"},
696
                                     {"pl","oPBvAT9lwt4","Octahedron 4x4 TUTORIAL PL","MrUK"},
697
                                     {"br","0ZgaoQ6IS2w","Resolver o octaedro Trajber 4x4 (1/3)","Rafael Cinoto"},
698
                                     {"br","TjxTx3IJy6M","Resolver o octaedro Trajber 4x4 (2/3)","Rafael Cinoto"},
699
                                     {"br","E8k2TXfUS8g","Resolver o octaedro Trajber 4x4 (3/3)","Rafael Cinoto"},
700
                                     {"vn","yorULpIm6Yw","Tutorial N.22 - Octahedron 4x4","Duy Thích Rubik"},
701
                                    };
702
      }
703

    
704
    return null;
705
    }
706
}
(37-37/40)