Project

General

Profile

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

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

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

    
32
import java.io.InputStream;
33

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

    
37
///////////////////////////////////////////////////////////////////////////////////////////////////
38

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

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

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

    
59
///////////////////////////////////////////////////////////////////////////////////////////////////
60

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

    
66
///////////////////////////////////////////////////////////////////////////////////////////////////
67

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

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

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

    
99
///////////////////////////////////////////////////////////////////////////////////////////////////
100

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

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

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

    
130
    return mStates;
131
    }
132

    
133
///////////////////////////////////////////////////////////////////////////////////////////////////
134

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

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

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

    
155
    return mCuts;
156
    }
157

    
158
///////////////////////////////////////////////////////////////////////////////////////////////////
159

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

    
168
///////////////////////////////////////////////////////////////////////////////////////////////////
169

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

    
175
///////////////////////////////////////////////////////////////////////////////////////////////////
176

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

    
182
///////////////////////////////////////////////////////////////////////////////////////////////////
183

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

    
192
///////////////////////////////////////////////////////////////////////////////////////////////////
193

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

    
199
///////////////////////////////////////////////////////////////////////////////////////////////////
200

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

    
206
///////////////////////////////////////////////////////////////////////////////////////////////////
207

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

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

    
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
              { LEN/2,-(SQ2/2)*LEN,-LEN/2},
230
              {     0,     0,   LEN},
231
              {   LEN,     0,     0},
232
              {  -LEN,     0,     0},
233
              {     0,     0,  -LEN},
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

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

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

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

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

    
305
              {+D*LEN, F*LEN,+E*LEN},
306
              {+E*LEN, F*LEN,+D*LEN},
307
              {+D*LEN,-F*LEN,+E*LEN},
308
              {+E*LEN,-F*LEN,+D*LEN},
309
              {-D*LEN, F*LEN,-E*LEN},
310
              {-E*LEN, F*LEN,-D*LEN},
311
              {-D*LEN,-F*LEN,-E*LEN},
312
              {-E*LEN,-F*LEN,-D*LEN},
313

    
314
              {       0, SQ2*LEN/3, 2*LEN/3},
315
              { 2*LEN/3, SQ2*LEN/3,       0},
316
              {       0,-SQ2*LEN/3, 2*LEN/3},
317
              { 2*LEN/3,-SQ2*LEN/3,       0},
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
              {       0,-SQ2*LEN/3,-2*LEN/3},
322
            };
323
        }
324
      }
325

    
326
    return mCenters;
327
    }
328

    
329
///////////////////////////////////////////////////////////////////////////////////////////////////
330

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

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

    
352
///////////////////////////////////////////////////////////////////////////////////////////////////
353

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

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

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

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

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

    
392
             {  LEN           -1.5f*B,  0.5f*A,  SQ2   *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-(SQ2/2)*A -1.5f*B, -0.5f*A, (SQ2/2)*A-LEN + 0.5f*B},
395
             {  LEN           -1.5f*B, -0.5f*A,  SQ2   *A-LEN + 0.5f*B},
396
          };
397

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

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

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

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

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

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

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

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

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

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

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

    
502
///////////////////////////////////////////////////////////////////////////////////////////////////
503

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

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

    
541
///////////////////////////////////////////////////////////////////////////////////////////////////
542

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

    
548
///////////////////////////////////////////////////////////////////////////////////////////////////
549

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

    
556
///////////////////////////////////////////////////////////////////////////////////////////////////
557

    
558
  public float getStickerRadius()
559
    {
560
    return 0.12f;
561
    }
562

    
563
///////////////////////////////////////////////////////////////////////////////////////////////////
564

    
565
  public float getStickerStroke()
566
    {
567
    return ObjectControl.isInIconMode() ? 0.20f : 0.10f;
568
    }
569

    
570
///////////////////////////////////////////////////////////////////////////////////////////////////
571

    
572
  public float[][] getStickerAngles()
573
    {
574
    return null;
575
    }
576

    
577
///////////////////////////////////////////////////////////////////////////////////////////////////
578
// PUBLIC API
579

    
580
  public Static3D[] getRotationAxis()
581
    {
582
    return ROT_AXIS;
583
    }
584

    
585
///////////////////////////////////////////////////////////////////////////////////////////////////
586

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

    
593
///////////////////////////////////////////////////////////////////////////////////////////////////
594

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

    
601
///////////////////////////////////////////////////////////////////////////////////////////////////
602

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

    
609
///////////////////////////////////////////////////////////////////////////////////////////////////
610

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

    
617
///////////////////////////////////////////////////////////////////////////////////////////////////
618

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

    
625
///////////////////////////////////////////////////////////////////////////////////////////////////
626

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

    
633
///////////////////////////////////////////////////////////////////////////////////////////////////
634

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

    
641
///////////////////////////////////////////////////////////////////////////////////////////////////
642

    
643
  public String[][] getTutorials()
644
    {
645
    int[] numLayers = getNumLayers();
646

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

    
670
    return null;
671
    }
672
}
(31-31/34)