Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyCrazy2x2.java @ 5d09301e

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2022 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.objects;
11

    
12
import java.io.InputStream;
13

    
14
import org.distorted.library.type.Static3D;
15
import org.distorted.library.type.Static4D;
16
import org.distorted.objectlib.helpers.ObjectFaceShape;
17
import org.distorted.objectlib.helpers.ObjectShape;
18
import org.distorted.objectlib.helpers.ObjectSignature;
19
import org.distorted.objectlib.main.Cubit;
20
import org.distorted.objectlib.main.InitData;
21
import org.distorted.objectlib.main.ObjectType;
22
import org.distorted.objectlib.main.ShapeHexahedron;
23
import org.distorted.objectlib.scrambling.ScrambleState;
24
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
25

    
26
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_HEXAHEDRON;
27
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
28

    
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30

    
31
public class TwistyCrazy2x2 extends ShapeHexahedron
32
{
33
  private static final float DIAMETER_RATIO = 0.60f;
34
  private static final float DIFF = 1.0f;
35
  private static final int NUMBER_CORNER_SEGMENTS = 4;
36

    
37
  static final Static3D[] ROT_AXIS = new Static3D[]
38
         {
39
           new Static3D(1,0,0),
40
           new Static3D(0,1,0),
41
           new Static3D(0,0,1)
42
         };
43

    
44
  private ScrambleState[] mStates;
45
  private int[][] mBasicAngle;
46
  private float[][] mCuts;
47
  private float[][] mPositions;
48
  private int[] mQuatIndex;
49
  private float[][] mOffsets;
50

    
51
///////////////////////////////////////////////////////////////////////////////////////////////////
52

    
53
  public TwistyCrazy2x2(InitData data, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
54
    {
55
    super(data, meshState, iconMode, data.getNumLayers()[0], quat, move, scale, stream);
56
    }
57

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

    
60
  @Override
61
  public void adjustStickerCoords()
62
    {
63
    final float A = 0.50000f;
64
    final float B = 0.45424f;
65
    final float C = 0.11830f;
66

    
67
    mStickerCoords = new float[][]
68
      {
69
        {  B, A,-A, A,-A,-B,-C,-B, B, C },
70
        { -A, A,-A,-A, A,-A }
71
      };
72
    }
73

    
74
///////////////////////////////////////////////////////////////////////////////////////////////////
75

    
76
  @Override
77
  public int getCubitRotationType(int cubit)
78
    {
79
    return cubit<8 ? Cubit.TYPE_NORMAL : ( cubit<11 ? Cubit.TYPE_DECIDER : Cubit.TYPE_FOLLOWER);
80
    }
81

    
82
///////////////////////////////////////////////////////////////////////////////////////////////////
83

    
84
  @Override
85
  public float[] getCubitRowOffset(int cubitIndex)
86
    {
87
    if( mOffsets==null )
88
      {
89
      float[] tmp = new float[] {0,0,0};
90
      int numCubits = mPositions.length;
91
      mOffsets = new float[numCubits][];
92

    
93
      for(int i=0; i<numCubits; i++)
94
        {
95
        switch(i)
96
          {
97
          case  8: mOffsets[i] = new float[] { 1,0,0}; break;
98
          case  9: mOffsets[i] = new float[] {0, 1,0}; break;
99
          case 10: mOffsets[i] = new float[] {0,0,-1}; break;
100
          default: mOffsets[i] = tmp;
101
          }
102
        }
103
      }
104

    
105
    return mOffsets[cubitIndex];
106
    }
107

    
108
///////////////////////////////////////////////////////////////////////////////////////////////////
109
// Normal 2x2
110

    
111
  public ScrambleState[] getScrambleStates()
112
    {
113
    if( mStates==null )
114
      {
115
      int[] m = new int[] { 0,-1,0,0,1,0,0,2,0, 1,-1,0,1,1,0,1,2,0 };
116

    
117
      mStates = new ScrambleState[]
118
          {
119
          new ScrambleState( new int[][] { m,m,m } )
120
          };
121
      }
122

    
123
    return mStates;
124
    }
125

    
126
///////////////////////////////////////////////////////////////////////////////////////////////////
127

    
128
  public float[][] getCuts(int[] numLayers)
129
    {
130
    if( mCuts==null )
131
      {
132
      float[] cut = new float[] {0};
133
      mCuts = new float[][] { cut,cut,cut };
134
      }
135

    
136
    return mCuts;
137
    }
138

    
139
///////////////////////////////////////////////////////////////////////////////////////////////////
140

    
141
  public boolean[][] getLayerRotatable(int[] numLayers)
142
    {
143
    boolean[] tmp = new boolean[] {true,true};
144
    return new boolean[][] { tmp,tmp,tmp };
145
    }
146

    
147
///////////////////////////////////////////////////////////////////////////////////////////////////
148

    
149
  public int getTouchControlType()
150
    {
151
    return TC_HEXAHEDRON;
152
    }
153

    
154
///////////////////////////////////////////////////////////////////////////////////////////////////
155

    
156
  public int getTouchControlSplit()
157
    {
158
    return TYPE_NOT_SPLIT;
159
    }
160

    
161
///////////////////////////////////////////////////////////////////////////////////////////////////
162

    
163
  public int[][][] getEnabled()
164
    {
165
    return new int[][][] { {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}} };
166
    }
167

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

    
170
  public float[] getDist3D(int[] numLayers)
171
    {
172
    return TouchControlHexahedron.D3D;
173
    }
174

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

    
177
  public Static3D[] getFaceAxis()
178
    {
179
    return TouchControlHexahedron.FACE_AXIS;
180
    }
181

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

    
184
  public float[][] getCubitPositions(int[] numLayers)
185
    {
186
    if( mPositions==null )
187
      {
188
      final float E = -DIFF+0.5f;
189

    
190
      mPositions = new float[][]
191
         {
192
             { 0.5f, 0.5f, 0.5f},
193
             { 0.5f, 0.5f,-0.5f},
194
             { 0.5f,-0.5f, 0.5f},
195
             { 0.5f,-0.5f,-0.5f},
196
             {-0.5f, 0.5f, 0.5f},
197
             {-0.5f, 0.5f,-0.5f},
198
             {-0.5f,-0.5f, 0.5f},
199
             {-0.5f,-0.5f,-0.5f},
200

    
201
             { E, 0.5f,-0.5f}, //
202
             { 0.5f, E,-0.5f}, // Deciders first
203
             { 0.5f, 0.5f,-E}, //
204

    
205
             { 0.5f, 0.5f, E},
206

    
207
             { 0.5f,-0.5f, E},
208
             { 0.5f,-0.5f,-E},
209
             {-0.5f, 0.5f, E},
210
             {-0.5f, 0.5f,-E},
211
             {-0.5f,-0.5f, E},
212
             {-0.5f,-0.5f,-E},
213
             { 0.5f, E, 0.5f},
214
             { 0.5f,-E, 0.5f},
215

    
216
             { 0.5f,-E,-0.5f},
217
             {-0.5f, E, 0.5f},
218
             {-0.5f,-E, 0.5f},
219
             {-0.5f, E,-0.5f},
220
             {-0.5f,-E,-0.5f},
221
             { E, 0.5f, 0.5f},
222
             {-E, 0.5f, 0.5f},
223

    
224
             {-E, 0.5f,-0.5f},
225
             { E,-0.5f, 0.5f},
226
             {-E,-0.5f, 0.5f},
227
             { E,-0.5f,-0.5f},
228
             {-E,-0.5f,-0.5f},
229
         };
230
      }
231

    
232
    return mPositions;
233
    }
234

    
235
///////////////////////////////////////////////////////////////////////////////////////////////////
236

    
237
  public Static4D getCubitQuats(int cubit, int[] numLayers)
238
    {
239
    if( mQuatIndex==null ) mQuatIndex = new int[] { 0,1,17,22,4,5,8,19,
240
                                                    6,1,18,
241
                                                    0,7,2, 9,5,8,19, 13,3,22, 14,23,15,11, 21,4,10, 17,20,12,16 };
242
    return mObjectQuats[mQuatIndex[cubit]];
243
    }
244

    
245
///////////////////////////////////////////////////////////////////////////////////////////////////
246

    
247
  private ObjectShape getCornerShape()
248
    {
249
    final float INIT_ALPHA = 0.0f;
250
    final float STEP_CORNER= (float)((Math.PI/2)/NUMBER_CORNER_SEGMENTS);
251
    final int SINGLE_ARC = NUMBER_CORNER_SEGMENTS+1;
252
    final int SINGLE_INNER_ARC = (NUMBER_CORNER_SEGMENTS+1)/2;
253
    final int NUM_VERTICES = 4 + 3*SINGLE_ARC + 1 + 3*SINGLE_INNER_ARC;
254
    float[][] tmp = new float[SINGLE_ARC][2];
255

    
256
    for(int i=0; i<SINGLE_ARC; i++)
257
      {
258
      float alpha = INIT_ALPHA + i*STEP_CORNER;
259
      tmp[i][0] = (float)(DIAMETER_RATIO*Math.sin(alpha) - 0.5f);
260
      tmp[i][1] = (float)(DIAMETER_RATIO*Math.cos(alpha) - 0.5f);
261
      }
262

    
263
    float[][] vertices = new float[NUM_VERTICES][];
264

    
265
    vertices[0] = new float[] { +0.5f, +0.5f, +0.5f };
266
    vertices[1] = new float[] { -0.5f, +0.5f, +0.5f };
267
    vertices[2] = new float[] { +0.5f, -0.5f, +0.5f };
268
    vertices[3] = new float[] { +0.5f, +0.5f, -0.5f };
269

    
270
    for(int i=0; i<SINGLE_ARC; i++)
271
      {
272
      float s = tmp[i][0];
273
      float c = tmp[i][1];
274

    
275
      vertices[4             +i] = new float[] {0.5f,+s,+c};
276
      vertices[4+  SINGLE_ARC+i] = new float[] {+c,0.5f,+s};
277
      vertices[4+2*SINGLE_ARC+i] = new float[] {+s,+c,0.5f};
278
      }
279

    
280
    final float EXTRA = (NUMBER_CORNER_SEGMENTS%2)==0 ? 1.0f : (float)Math.cos((Math.PI/2)/(2*NUMBER_CORNER_SEGMENTS));
281
    final float LEN   = DIAMETER_RATIO*EXTRA;
282
    final float M     = (float)(LEN*Math.sin(Math.PI/4) - 0.5f);
283
    vertices[4+3*SINGLE_ARC] = new float[] {M,M,M};
284

    
285
    for(int i=0; i<SINGLE_INNER_ARC; i++)
286
      {
287
      float s = tmp[i][0];
288
      float c = tmp[i][1];
289

    
290
      vertices[4+3*SINGLE_ARC+1                   +i] = new float[] {s,c,c};
291
      vertices[4+3*SINGLE_ARC+1+  SINGLE_INNER_ARC+i] = new float[] {c,s,c};
292
      vertices[4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+i] = new float[] {c,c,s};
293
      }
294

    
295
    final int NUM_FACES = 6 + 3*NUMBER_CORNER_SEGMENTS;
296
    final int NUM_VERTS = 4 +   NUMBER_CORNER_SEGMENTS;
297

    
298
    int[][] indices = new int[NUM_FACES][];
299

    
300
    indices[0] = new int[NUM_VERTS];
301
    indices[1] = new int[NUM_VERTS];
302
    indices[2] = new int[NUM_VERTS];
303

    
304
    indices[0][0] = 3;
305
    indices[0][1] = 0;
306
    indices[0][2] = 2;
307
    indices[1][0] = 1;
308
    indices[1][1] = 0;
309
    indices[1][2] = 3;
310
    indices[2][0] = 2;
311
    indices[2][1] = 0;
312
    indices[2][2] = 1;
313

    
314
    for(int i=0; i<SINGLE_ARC; i++)
315
      {
316
      indices[0][3+i] = 4+i;
317
      indices[1][3+i] = 4+i+  SINGLE_ARC;
318
      indices[2][3+i] = 4+i+2*SINGLE_ARC;
319
      }
320

    
321
    indices[3] = new int[] { 1, 4+2*SINGLE_ARC-1, 4+3*SINGLE_ARC+1                   , 4+2*SINGLE_ARC};
322
    indices[4] = new int[] { 2, 4+3*SINGLE_ARC-1, 4+3*SINGLE_ARC+1+  SINGLE_INNER_ARC, 4             };
323
    indices[5] = new int[] { 3, 4+  SINGLE_ARC-1, 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC, 4+  SINGLE_ARC};
324

    
325
    int start,i0,i1,i2,i3;
326
    int MID = (NUMBER_CORNER_SEGMENTS)/2;
327
    int MID2= (NUMBER_CORNER_SEGMENTS+1)/2;
328

    
329
    if( (NUMBER_CORNER_SEGMENTS%2) == 0 )
330
      {
331
      start = 12;
332
      indices[ 6] = new int[] { 4+3*SINGLE_ARC, 4+SINGLE_ARC+MID, 4+SINGLE_ARC+MID-1, 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+MID-1};
333
      indices[ 7] = new int[] { 4+3*SINGLE_ARC, 4+3*SINGLE_ARC+1+MID-1,  4+SINGLE_ARC+MID+1, 4+SINGLE_ARC+MID};
334
      indices[ 8] = new int[] { 4+3*SINGLE_ARC, 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+MID-1, 4+MID+1, 4+MID };
335
      indices[ 9] = new int[] { 4+3*SINGLE_ARC, 4+MID, 4+MID-1, 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+MID-1 };
336
      indices[10] = new int[] { 4+3*SINGLE_ARC, 4+2*SINGLE_ARC+MID, 4+2*SINGLE_ARC+MID-1, 4+3*SINGLE_ARC+1+MID-1 };
337
      indices[11] = new int[] { 4+3*SINGLE_ARC, 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+MID-1, 4+2*SINGLE_ARC+MID+1, 4+2*SINGLE_ARC+MID };
338
      }
339
    else
340
      {
341
      start = 9;
342
      indices[ 6] = new int[] { 4+3*SINGLE_ARC, 4+3*SINGLE_ARC+1+MID, 4+SINGLE_ARC+MID+1, 4+SINGLE_ARC+MID, 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+MID};
343
      indices[ 7] = new int[] { 4+3*SINGLE_ARC, 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+MID,  4+MID+1, 4+MID, 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+MID};
344
      indices[ 8] = new int[] { 4+3*SINGLE_ARC, 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+MID, 4+2*SINGLE_ARC+MID+1, 4+2*SINGLE_ARC+MID, 4+3*SINGLE_ARC+1+MID};
345
      }
346

    
347
    for(int j=0; j<MID2-1; j++)
348
      {
349
      i0 = 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+j;
350
      i1 = 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+j+1;
351
      i2 = 4+SINGLE_ARC+j+1;
352
      i3 = 4+SINGLE_ARC+j;
353

    
354
      indices[start+j] = new int[] {i0,i1,i2,i3};
355

    
356
      i0 = 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+j+1;
357
      i1 = 4+3*SINGLE_ARC+1+2*SINGLE_INNER_ARC+j;
358
      i2 = 4+(SINGLE_ARC-1)-j;
359
      i3 = 4+(SINGLE_ARC-1)-(j+1);
360

    
361
      indices[start+j+(MID2-1)] = new int[] {i0,i1,i2,i3};
362

    
363
      i0 = 4+3*SINGLE_ARC+1+j;
364
      i1 = 4+3*SINGLE_ARC+1+j+1;
365
      i2 = 4+2*SINGLE_ARC+j+1;
366
      i3 = 4+2*SINGLE_ARC+j;
367

    
368
      indices[start+j+2*(MID2-1)] = new int[] {i0,i1,i2,i3};
369

    
370
      i0 = 4+3*SINGLE_ARC+1+j+1;
371
      i1 = 4+3*SINGLE_ARC+1+j;
372
      i2 = 4+(2*SINGLE_ARC-1)-j;
373
      i3 = 4+(2*SINGLE_ARC-1)-(j+1);
374

    
375
      indices[start+j+3*(MID2-1)] = new int[] {i0,i1,i2,i3};
376

    
377
      i0 = 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+j;
378
      i1 = 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+j+1;
379
      i2 = 4+j+1;
380
      i3 = 4+j;
381

    
382
      indices[start+j+4*(MID2-1)] = new int[] {i0,i1,i2,i3};
383

    
384
      i0 = 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+j+1;
385
      i1 = 4+3*SINGLE_ARC+1+SINGLE_INNER_ARC+j;
386
      i2 = 4+(3*SINGLE_ARC-1)-j;
387
      i3 = 4+(3*SINGLE_ARC-1)-(j+1);
388

    
389
      indices[start+j+5*(MID2-1)] = new int[] {i0,i1,i2,i3};
390
      }
391

    
392
    return new ObjectShape(vertices,indices);
393
    }
394

    
395
///////////////////////////////////////////////////////////////////////////////////////////////////
396

    
397
  private ObjectShape getSmallCircleShape()
398
    {
399
    final float D = DIFF+0.02f;
400
    final float H = DIAMETER_RATIO-0.5f;
401
    final float INIT_ALPHA = 0;
402
    final float STEP_CORNER= (float)((Math.PI/2)/NUMBER_CORNER_SEGMENTS);
403
    final int NUM_VERTICES = 6 + 2*(NUMBER_CORNER_SEGMENTS-1);
404
    float[][] vertices = new float[NUM_VERTICES][];
405

    
406
    vertices[0] = new float[] {-0.5f,    H, 0.5f+D};
407
    vertices[1] = new float[] {    H,-0.5f, 0.5f+D};
408
    vertices[2] = new float[] {-0.5f,-0.5f, 0.5f+D};
409
    vertices[3] = new float[] {-0.5f,    H,-0.5f+D};
410
    vertices[4] = new float[] {    H,-0.5f,-0.5f+D};
411
    vertices[5] = new float[] {-0.5f,-0.5f,-0.5f+D};
412

    
413
    for(int i=0; i<NUMBER_CORNER_SEGMENTS-1; i++)
414
      {
415
      float alpha = INIT_ALPHA + (i+1)*STEP_CORNER;
416
      float A = (float)(DIAMETER_RATIO*Math.sin(alpha) - 0.5f);
417
      float B = (float)(DIAMETER_RATIO*Math.cos(alpha) - 0.5f);
418

    
419
      vertices[6                       +i] = new float[] {A,B, 0.5f+D};
420
      vertices[5+NUMBER_CORNER_SEGMENTS+i] = new float[] {A,B,-0.5f+D};
421
      }
422

    
423
    final int NUM_FACES = 4 + NUMBER_CORNER_SEGMENTS;
424
    int[][] indices = new int[NUM_FACES][];
425

    
426
    int NUMV = 2+NUMBER_CORNER_SEGMENTS;
427
    indices[0] = new int[NUMV];
428
    indices[0][0] = 0;
429
    indices[0][1] = 2;
430
    indices[0][2] = 1;
431
    for(int i=3; i<NUMV; i++) indices[0][i] = 5+(NUMBER_CORNER_SEGMENTS-1)-(i-3);
432

    
433
    indices[1] = new int[NUMV];
434
    indices[1][0] = 4;
435
    indices[1][1] = 5;
436
    indices[1][2] = 3;
437
    for(int i=3; i<NUMV; i++) indices[1][i] = 5+NUMBER_CORNER_SEGMENTS+(i-3);
438

    
439
    indices[2] = new int[] {0,3,5,2};
440
    indices[3] = new int[] {1,2,5,4};
441

    
442
    indices[4] = new int[] {5+NUMBER_CORNER_SEGMENTS,3,0,6};
443
    indices[5] = new int[] {1,4,5+2*(NUMBER_CORNER_SEGMENTS-1),5+(NUMBER_CORNER_SEGMENTS-1)};
444

    
445
    for(int i=0; i<NUMBER_CORNER_SEGMENTS-2; i++)
446
      {
447
      int i0 = 6+i;
448
      int i1 = 7+i;
449
      int i2 = 6+NUMBER_CORNER_SEGMENTS+i;
450
      int i3 = 5+NUMBER_CORNER_SEGMENTS+i;
451

    
452
      indices[6+i] = new int[] {i0,i1,i2,i3};
453
      }
454

    
455
    return new ObjectShape(vertices,indices);
456
    }
457

    
458
///////////////////////////////////////////////////////////////////////////////////////////////////
459

    
460
  public ObjectShape getObjectShape(int variant)
461
    {
462
    switch(variant)
463
      {
464
      case 0: return getCornerShape();
465
      case 1: return getSmallCircleShape();
466
      }
467

    
468
    return null;
469
    }
470

    
471
///////////////////////////////////////////////////////////////////////////////////////////////////
472

    
473
  public ObjectFaceShape getObjectFaceShape(int variant)
474
    {
475
    if( variant==0 )
476
      {
477
      float h1 = isInIconMode() ? 0.001f : 0.04f;
478
      float h2 = 0.001f;
479
      float[][] bands   = { {h1,45,0.3f,0.7f,5,0,0}, {h2,5,0.3f,0.2f,5,0,0}, {h2,5,0.3f,0.2f,2,0,0} };
480
      final int NUM_BANDS = 6+3*NUMBER_CORNER_SEGMENTS;
481
      int[] bandIndices = new int[NUM_BANDS];
482
      bandIndices[0] = bandIndices[1] = bandIndices[2] = 0;
483
      bandIndices[3] = bandIndices[4] = bandIndices[5] = 0;
484
      for(int i=6; i<NUM_BANDS; i++) bandIndices[i] = 2;
485
      float[][] corners = { {0.02f,0.09f} };
486
      float[][] centers = { { 0.0f, 0.0f, 0.0f } };
487
      final int SINGLE_ARC = NUMBER_CORNER_SEGMENTS+1;
488
      final int SINGLE_INNER_ARC = (NUMBER_CORNER_SEGMENTS+1)/2;
489
      final int NUM_VERTICES = 4 + 3*SINGLE_ARC + 1 + 3*SINGLE_INNER_ARC;
490
      int[] indices = new int[NUM_VERTICES];
491
      indices[0] = indices[1] = indices[2] = indices[3] = 0;
492
      for(int i=4; i<NUM_VERTICES; i++) indices[i] = -1;
493
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
494
      }
495
    else
496
      {
497
      float h1 = isInIconMode() ? 0.001f : 0.03f;
498
      float[][] bands   = { {h1,45,0.2f,0.4f,5,0,0}, {0.001f,1,0.3f,0.5f,3,0,0}, {0.001f,1,0.3f,0.5f,2,0,0} };
499
      final int NUM_BANDS = 4 + NUMBER_CORNER_SEGMENTS;
500
      int[] bandIndices = new int[NUM_BANDS];
501
      bandIndices[0] = 0;
502
      bandIndices[1] = 2;
503
      bandIndices[2] = bandIndices[3] = 1;
504
      for(int i=4; i<NUM_BANDS; i++) bandIndices[i] = 2;
505
      float[][] corners = { {0.02f,0.09f} };
506
      float[][] centers = { { 0.0f, 0.0f, 1.0f } };
507
      final int NUM_VERTICES = 6 + 2*(NUMBER_CORNER_SEGMENTS-1);
508
      int[] indices = new int[NUM_VERTICES];
509
      for(int i=0; i<NUM_VERTICES; i++) indices[i] = -1;
510
      indices[0] = indices[1] = indices[2] = 0;
511
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
512
      }
513
    }
514

    
515
///////////////////////////////////////////////////////////////////////////////////////////////////
516

    
517
  public int getNumCubitVariants(int[] numLayers)
518
    {
519
    return 2;
520
    }
521

    
522
///////////////////////////////////////////////////////////////////////////////////////////////////
523

    
524
  public int getCubitVariant(int cubit, int[] numLayers)
525
    {
526
    return cubit<8?0:1;
527
    }
528

    
529
///////////////////////////////////////////////////////////////////////////////////////////////////
530

    
531
  public float getStickerRadius()
532
    {
533
    return 0.07f;
534
    }
535

    
536
///////////////////////////////////////////////////////////////////////////////////////////////////
537

    
538
  public float getStickerStroke()
539
    {
540
    return isInIconMode() ? 0.17f : 0.12f;
541
    }
542

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

    
545
  public float[][] getStickerAngles()
546
    {
547
    float D = (float)(Math.PI/4);
548
    return new float[][] { { 0,0,0,-D,0 },{ 0,0,D } };
549
    }
550

    
551
///////////////////////////////////////////////////////////////////////////////////////////////////
552
// PUBLIC API
553

    
554
  public Static3D[] getRotationAxis()
555
    {
556
    return ROT_AXIS;
557
    }
558

    
559
///////////////////////////////////////////////////////////////////////////////////////////////////
560

    
561
  public int[][] getBasicAngles()
562
    {
563
    if( mBasicAngle==null )
564
      {
565
      int[] tmp = new int[] {4,4,4};
566
      mBasicAngle = new int[][] { tmp,tmp,tmp };
567
      }
568

    
569
    return mBasicAngle;
570
    }
571

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

    
574
  public String getShortName()
575
    {
576
    return ObjectType.CRA1_2.name();
577
    }
578

    
579
///////////////////////////////////////////////////////////////////////////////////////////////////
580

    
581
  public ObjectSignature getSignature()
582
    {
583
    return new ObjectSignature(ObjectType.CRA1_2);
584
    }
585

    
586
///////////////////////////////////////////////////////////////////////////////////////////////////
587

    
588
  public String getObjectName()
589
    {
590
    return "Circle 2x2";
591
    }
592

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

    
595
  public String getInventor()
596
    {
597
    return "Aleh Hladzilin";
598
    }
599

    
600
///////////////////////////////////////////////////////////////////////////////////////////////////
601

    
602
  public int getYearOfInvention()
603
    {
604
    return 2007;
605
    }
606

    
607
///////////////////////////////////////////////////////////////////////////////////////////////////
608

    
609
  public int getComplexity()
610
    {
611
    return 2;
612
    }
613

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

    
616
  public String[][] getTutorials()
617
    {
618
     return new String[][] {
619
                            {"gb","DKLIQghl66c","Circle 2x2 Demonstration","SuperAntoniovivaldi"},
620
                            {"es","Wq9lwfDfg4E","Resolucion del 2x2 Crazy","RUBIKworld"},
621
                            {"es","K4bFs4BFdXc","Tutorial Crazy 2x2 de Sengso","Manzacuber"},
622
                            {"vn","TlT5MYiz4RY","Tutorial N.216 Circular 2x2","Duy Thích Rubik"},
623
                           };
624
    }
625
}
(4-4/36)