Project

General

Profile

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

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

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.scrambling.ScrambleState;
27
import org.distorted.objectlib.main.ObjectType;
28
import org.distorted.objectlib.main.ShapeOctahedron;
29
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
30

    
31
import java.io.InputStream;
32

    
33
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_OCTAHEDRON;
34
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
35

    
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37

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

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

    
52
  private ScrambleState[] mStates;
53
  private int[] mBasicAngle;
54
  private float[][] mCuts;
55
  private float[][] mCenters;
56
  private int[] mQuatIndex;
57

    
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59

    
60
  public TwistyTrajber(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
61
    {
62
    super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
63
    }
64

    
65
///////////////////////////////////////////////////////////////////////////////////////////////////
66

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

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

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

    
98
///////////////////////////////////////////////////////////////////////////////////////////////////
99

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

    
106
      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};
107

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

    
129
    return mStates;
130
    }
131

    
132
///////////////////////////////////////////////////////////////////////////////////////////////////
133

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

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

    
151
      mCuts = new float[][] { tmp,tmp,tmp };
152
      }
153

    
154
    return mCuts;
155
    }
156

    
157
///////////////////////////////////////////////////////////////////////////////////////////////////
158

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

    
167
///////////////////////////////////////////////////////////////////////////////////////////////////
168

    
169
  public int getTouchControlType()
170
    {
171
    return TC_OCTAHEDRON;
172
    }
173

    
174
///////////////////////////////////////////////////////////////////////////////////////////////////
175

    
176
  public int getTouchControlSplit()
177
    {
178
    return TYPE_NOT_SPLIT;
179
    }
180

    
181
///////////////////////////////////////////////////////////////////////////////////////////////////
182

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

    
191
///////////////////////////////////////////////////////////////////////////////////////////////////
192

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

    
198
///////////////////////////////////////////////////////////////////////////////////////////////////
199

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

    
205
///////////////////////////////////////////////////////////////////////////////////////////////////
206

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

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

    
225
              {-LEN/2, (SQ2/2)*LEN, LEN/2},
226
              { LEN/2, (SQ2/2)*LEN,-LEN/2},
227
              {-LEN/2,-(SQ2/2)*LEN, LEN/2},
228
              { LEN/2,-(SQ2/2)*LEN,-LEN/2},
229
              {     0,     0,   LEN},
230
              {   LEN,     0,     0},
231
              {  -LEN,     0,     0},
232
              {     0,     0,  -LEN},
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

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

    
259
        mCenters = new float[][]
260
            {
261
              {   LEN-0.5f*B,   +0.5f*A,   LEN-1.5f*B},
262
              {   LEN-0.5f*B,   -0.5f*A,   LEN-1.5f*B},
263
              {   LEN-1.5f*B,   -0.5f*A,   LEN-0.5f*B},
264
              {   LEN-1.5f*B,   +0.5f*A,   LEN-0.5f*B},
265
              {  -LEN+0.5f*B,   -0.5f*A,  -LEN+1.5f*B},
266
              {  -LEN+0.5f*B,   +0.5f*A,  -LEN+1.5f*B},
267
              {  -LEN+1.5f*B,   +0.5f*A,  -LEN+0.5f*B},
268
              {  -LEN+1.5f*B,   -0.5f*A,  -LEN+0.5f*B},
269
              {     B, SQ2*LEN-1.5f*B, 0},
270
              {    -B, SQ2*LEN-1.5f*B, 0},
271
              {     0, SQ2*LEN-1.5f*B, B},
272
              {     0, SQ2*LEN-1.5f*B,-B},
273
              {     B,-SQ2*LEN+1.5f*B, 0},
274
              {    -B,-SQ2*LEN+1.5f*B, 0},
275
              {     0,-SQ2*LEN+1.5f*B, B},
276
              {     0,-SQ2*LEN+1.5f*B,-B},
277
              {  -LEN+0.5f*B,   -0.5f*A,   LEN-1.5f*B},
278
              {  -LEN+0.5f*B,   +0.5f*A,   LEN-1.5f*B},
279
              {  -LEN+1.5f*B,   +0.5f*A,   LEN-0.5f*B},
280
              {  -LEN+1.5f*B,   -0.5f*A,   LEN-0.5f*B},
281
              {   LEN-0.5f*B,   +0.5f*A,  -LEN+1.5f*B},
282
              {   LEN-0.5f*B,   -0.5f*A,  -LEN+1.5f*B},
283
              {   LEN-1.5f*B,   -0.5f*A,  -LEN+0.5f*B},
284
              {   LEN-1.5f*B,   +0.5f*A,  -LEN+0.5f*B},
285

    
286
              {-D*LEN, F*LEN, E*LEN },
287
              {-E*LEN, F*LEN, D*LEN },
288
              { E*LEN, F*LEN,-D*LEN},
289
              { D*LEN, F*LEN,-E*LEN},
290
              {-D*LEN,-F*LEN, E*LEN },
291
              {-E*LEN,-F*LEN, D*LEN },
292
              { E*LEN,-F*LEN,-D*LEN},
293
              { D*LEN,-F*LEN,-E*LEN},
294

    
295
              {     0, G*LEN, H*LEN},
296
              {     0,-G*LEN, H*LEN},
297
              { H*LEN, G*LEN,     0},
298
              { H*LEN,-G*LEN,     0},
299
              {-H*LEN, G*LEN,     0},
300
              {-H*LEN,-G*LEN,     0},
301
              {     0, G*LEN,-H*LEN},
302
              {     0,-G*LEN,-H*LEN},
303

    
304
              {+D*LEN, F*LEN,+E*LEN},
305
              {+E*LEN, F*LEN,+D*LEN},
306
              {+D*LEN,-F*LEN,+E*LEN},
307
              {+E*LEN,-F*LEN,+D*LEN},
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

    
313
              {       0, SQ2*LEN/3, 2*LEN/3},
314
              { 2*LEN/3, SQ2*LEN/3,       0},
315
              {       0,-SQ2*LEN/3, 2*LEN/3},
316
              { 2*LEN/3,-SQ2*LEN/3,       0},
317
              {-2*LEN/3, SQ2*LEN/3,       0},
318
              {       0, SQ2*LEN/3,-2*LEN/3},
319
              {-2*LEN/3,-SQ2*LEN/3,       0},
320
              {       0,-SQ2*LEN/3,-2*LEN/3},
321
            };
322
        }
323
      }
324

    
325
    return mCenters;
326
    }
327

    
328
///////////////////////////////////////////////////////////////////////////////////////////////////
329

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

    
348
    return mObjectQuats[mQuatIndex[cubit]];
349
    }
350

    
351
///////////////////////////////////////////////////////////////////////////////////////////////////
352

    
353
  public ObjectShape getObjectShape(int variant)
354
    {
355
    float numL = getNumLayers()[0];
356
    final float LEN = numL*0.5f;
357
    final float CUT = numL==3 ? CUT3 : CUT4;
358

    
359
    if( variant==0 )
360
      {
361
      final float A = SQ2*CUT*LEN;
362
      final float B =     CUT*LEN;
363

    
364
      float[][] vertices = numL==3 ?
365

    
366
        new float[][]
367
          {
368
             {    0,    0,    0},
369
             {    B,    A,   -B},
370
             {    B,   -A,   -B},
371
             {  2*B,    0,    0},
372
             {    0,    0, -2*B},
373
             {  3*B,    A,   -B},
374
             {  3*B,   -A,   -B},
375
             {    B,    A, -3*B},
376
             {    B,   -A, -3*B},
377

    
378
             {  LEN      ,    A, SQ2*A-LEN},
379
             {  LEN      ,   -A, SQ2*A-LEN},
380
             {  LEN-SQ2*A,    A,      -LEN},
381
             {  LEN-SQ2*A,   -A,      -LEN},
382
          }
383
        :
384
        new float[][]
385
          {
386
             {  -1.5f*B,  -0.5f*A,  0.5f*B},
387
             {  -0.5f*B,   0.5f*A, -0.5f*B},
388
             {   0.5f*B,  -0.5f*A,  0.5f*B},
389
             {   1.5f*B,   0.5f*A, -0.5f*B},
390

    
391
             {  LEN           -1.5f*B,  0.5f*A,  SQ2   *A-LEN + 0.5f*B},
392
             {  LEN-(SQ2/2)*A -1.5f*B,  0.5f*A, (SQ2/2)*A-LEN + 0.5f*B},
393
             {  LEN-(SQ2/2)*A -1.5f*B, -0.5f*A, (SQ2/2)*A-LEN + 0.5f*B},
394
             {  LEN           -1.5f*B, -0.5f*A,  SQ2   *A-LEN + 0.5f*B},
395
          };
396

    
397
      int[][] indices = numL==3 ?
398

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

    
422
      return new ObjectShape(vertices, indices);
423
      }
424
    if( variant==1 )
425
      {
426
      final float A = SQ2*CUT*LEN;
427
      final float B = LEN*(1-2*CUT);
428
      final float C = (SQ2/2)*A;
429

    
430
      float[][] vertices = numL==3 ?
431

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

    
454
      int[][] indices = numL==3 ?
455

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

    
475
      return new ObjectShape(vertices, indices);
476
      }
477
    else
478
      {
479
      final float L = LEN*(1-3*CUT);
480

    
481
      float[][] vertices =
482
          {
483
             { -L, -(SQ2/3)*L,   L/3 },
484
             {  L, -(SQ2/3)*L,   L/3 },
485
             {  0,(2*SQ2/3)*L,-2*L/3 },
486
             {  0, -(SQ2/3)*L,-2*L/3 },
487
          };
488

    
489
      int[][] indices =
490
          {
491
             {0,1,2},
492
             {3,1,0},
493
             {0,2,3},
494
             {1,3,2},
495
          };
496

    
497
      return new ObjectShape(vertices, indices);
498
      }
499
    }
500

    
501
///////////////////////////////////////////////////////////////////////////////////////////////////
502

    
503
  public ObjectFaceShape getObjectFaceShape(int variant)
504
    {
505
    int numL = getNumLayers()[0];
506
    final float LEN = numL*0.5f;
507
    final float CUT = numL==3 ? CUT3 : CUT4;
508

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

    
543
///////////////////////////////////////////////////////////////////////////////////////////////////
544

    
545
  public int getNumCubitVariants(int[] numLayers)
546
    {
547
    return 3;
548
    }
549

    
550
///////////////////////////////////////////////////////////////////////////////////////////////////
551

    
552
  public int getCubitVariant(int cubit, int[] numLayers)
553
    {
554
    if( numLayers[0]==3 ) return cubit< 6 ? 0 : cubit<18 ? 1 : 2;
555
    else                  return cubit<24 ? 0 : cubit<48 ? 1 : 2;
556
    }
557

    
558
///////////////////////////////////////////////////////////////////////////////////////////////////
559

    
560
  public float getStickerRadius()
561
    {
562
    return 0.12f;
563
    }
564

    
565
///////////////////////////////////////////////////////////////////////////////////////////////////
566

    
567
  public float getStickerStroke()
568
    {
569
    return isInIconMode() ? 0.20f : 0.10f;
570
    }
571

    
572
///////////////////////////////////////////////////////////////////////////////////////////////////
573

    
574
  public float[][] getStickerAngles()
575
    {
576
    return null;
577
    }
578

    
579
///////////////////////////////////////////////////////////////////////////////////////////////////
580
// PUBLIC API
581

    
582
  public Static3D[] getRotationAxis()
583
    {
584
    return ROT_AXIS;
585
    }
586

    
587
///////////////////////////////////////////////////////////////////////////////////////////////////
588

    
589
  public int[] getBasicAngles()
590
    {
591
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 4,4,4 };
592
    return mBasicAngle;
593
    }
594

    
595
///////////////////////////////////////////////////////////////////////////////////////////////////
596

    
597
  public String getShortName()
598
    {
599
    int[] numLayers = getNumLayers();
600
    return numLayers[0]==3 ? ObjectType.TRAJ_3.name() : ObjectType.TRAJ_4.name();
601
    }
602

    
603
///////////////////////////////////////////////////////////////////////////////////////////////////
604

    
605
  public long getSignature()
606
    {
607
    int[] numLayers = getNumLayers();
608
    return numLayers[0]==3 ? ObjectType.TRAJ_3.ordinal() : ObjectType.TRAJ_4.ordinal();
609
    }
610

    
611
///////////////////////////////////////////////////////////////////////////////////////////////////
612

    
613
  public String getObjectName()
614
    {
615
    int[] numLayers = getNumLayers();
616
    return numLayers[0]==3 ? "Trajber's Octahedron" : "Trajber 4x4";
617
    }
618

    
619
///////////////////////////////////////////////////////////////////////////////////////////////////
620

    
621
  public String getInventor()
622
    {
623
    int[] numLayers = getNumLayers();
624
    return numLayers[0]==3 ? "Josef Trajber" : "Jürgen Brandt";
625
    }
626

    
627
///////////////////////////////////////////////////////////////////////////////////////////////////
628

    
629
  public int getYearOfInvention()
630
    {
631
    int[] numLayers = getNumLayers();
632
    return numLayers[0]==3 ? 1982 : 2001;
633
    }
634

    
635
///////////////////////////////////////////////////////////////////////////////////////////////////
636

    
637
  public int getComplexity()
638
    {
639
    int[] numLayers = getNumLayers();
640
    return numLayers[0]==3 ? 2 : 3;
641
    }
642

    
643
///////////////////////////////////////////////////////////////////////////////////////////////////
644

    
645
  public String[][] getTutorials()
646
    {
647
    int[] numLayers = getNumLayers();
648

    
649
    switch(numLayers[0])
650
      {
651
      case 3: return new String[][] {
652
                                     {"gb","Q2NSiuJWVvk","Trajber and UFO Tutorial","SuperAntoniovivaldi"},
653
                                     {"es","FPBirEJ8ZfY","Resolver Octaedro 3x3","Solución Rubik"},
654
                                     {"de","FjQXlwJGniQ","Trajbers Octahedron Tutorial","GerCubing"},
655
                                     {"br","kO3nMpZKv3Q","Resolver Octaedro Trajber","Rafael Cinoto"},
656
                                    };
657
      case 4: return new String[][] {
658
                                     {"gb","FZlw68I7snM","4x4 Trajber's Tutorial (1/2)","SuperAntoniovivaldi"},
659
                                     {"gb","VM0XFu7gAII","4x4 Trajber's Tutorial (2/2)","SuperAntoniovivaldi"},
660
                                     {"es","Q8ljV-feLpU","Tutorial Octaedro 4x4 (1/2)","Dany Cuber"},
661
                                     {"es","QyWpDLa1eZQ","Tutorial Octaedro 4x4 (2/2)","Dany Cuber"},
662
                                     {"ru","ikUogVow-58","Как собрать Октаэдр 4х4","RBcuber"},
663
                                     {"fr","4hxZyMVGiTA","Résolution de l'Octaèdre 4x4","asthalis"},
664
                                     {"pl","oPBvAT9lwt4","Octahedron 4x4 TUTORIAL PL","MrUK"},
665
                                     {"br","0ZgaoQ6IS2w","Resolver o octaedro Trajber 4x4 (1/3)","Rafael Cinoto"},
666
                                     {"br","TjxTx3IJy6M","Resolver o octaedro Trajber 4x4 (2/3)","Rafael Cinoto"},
667
                                     {"br","E8k2TXfUS8g","Resolver o octaedro Trajber 4x4 (3/3)","Rafael Cinoto"},
668
                                     {"vn","yorULpIm6Yw","Tutorial N.22 - Octahedron 4x4","Duy Thích Rubik"},
669
                                    };
670
      }
671

    
672
    return null;
673
    }
674
}
(31-31/34)