Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyCoinHexahedron.java @ 074a0284

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2023 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 static org.distorted.objectlib.touchcontrol.TouchControl.TC_HEXAHEDRON;
13
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_SPLIT_EDGE_COIN;
14

    
15
import org.distorted.library.helpers.QuatHelper;
16
import org.distorted.library.type.Static3D;
17
import org.distorted.library.type.Static4D;
18
import org.distorted.objectlib.helpers.FactoryCubit;
19
import org.distorted.objectlib.helpers.ObjectFaceShape;
20
import org.distorted.objectlib.helpers.ObjectShape;
21
import org.distorted.objectlib.metadata.Metadata;
22
import org.distorted.objectlib.helpers.ObjectVertexEffects;
23
import org.distorted.objectlib.main.InitAssets;
24
import org.distorted.objectlib.metadata.ListObjects;
25
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
26
import org.distorted.objectlib.shape.ShapeHexahedron;
27
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
28

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

    
31
public class TwistyCoinHexahedron extends ShapeHexahedron
32
{
33
  static final Static3D[] ROT_AXIS = new Static3D[]
34
         {
35
           new Static3D( SQ3/3, SQ3/3, SQ3/3),
36
           new Static3D( SQ3/3, SQ3/3,-SQ3/3),
37
           new Static3D( SQ3/3,-SQ3/3, SQ3/3),
38
           new Static3D( SQ3/3,-SQ3/3,-SQ3/3),
39
           new Static3D(     1,     0,     0),
40
           new Static3D(     0,     1,     0),
41
           new Static3D(     0,     0,     1),
42
         };
43

    
44
  private static final int N = 5;
45
  private static final float C = 0.2f;
46
  private static final float D = 0.85f;
47

    
48
  private int[][] mEdges;
49
  private int[][] mBasicAngle;
50
  private float[][] mCuts;
51
  private float[][] mPosition;
52
  private int[] mQuatIndex;
53
  private boolean[][] mRotatable;
54

    
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56

    
57
  public TwistyCoinHexahedron(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
58
    {
59
    super(iconMode, meta.getNumLayers()[0], quat, move, scale, meta, asset);
60
    }
61

    
62
///////////////////////////////////////////////////////////////////////////////////////////////////
63

    
64
  public int[][] getScrambleEdges()
65
    {
66
    if( mEdges==null )
67
      {
68
      mEdges = new int[][]
69
        {
70
          {0,1,1,1, 2,2,3,2, 4,3,5,3, 6,4,7,4, 8,5,9,5, 10,6,11,6, 12,7,13,7, 14,8,15,8},
71
          {16, 9,17, 9,18, 9, 22,11,23,11,24,11, 28,13,29,13,30,13},
72
          {19,10,20,10,21,10, 25,12,26,12,27,12, 31,14,32,14,33,14},
73
          {16, 9,17, 9,18, 9, 22,11,23,11,24,11, 31,14,32,14,33,14},
74
          {19,10,20,10,21,10, 25,12,26,12,27,12, 28,13,29,13,30,13},
75
          {16, 9,17, 9,18, 9, 25,12,26,12,27,12, 28,13,29,13,30,13},
76
          {19,10,20,10,21,10, 22,11,23,11,24,11, 31,14,32,14,33,14},
77
          {16, 9,17, 9,18, 9, 25,12,26,12,27,12, 31,14,32,14,33,14},
78
          {19,10,20,10,21,10, 22,11,23,11,24,11, 28,13,29,13,30,13},
79
          { 0, 1, 1, 1,  4, 3, 5, 3,   8, 5, 9, 5,  12, 7,13, 7},
80
          { 2, 2, 3, 2,  6, 4, 7, 4,  10, 6,11, 6,  14, 8,15, 8},
81
          { 0, 1, 1, 1,  4, 3, 5, 3,  10, 6,11, 6,  14, 8,15, 8},
82
          { 2, 2, 3, 2,  6, 4, 7, 4,   8, 5, 9, 5,  12, 7,13, 7},
83
          { 0, 1, 1, 1,  6, 4, 7, 4,   8, 5, 9, 5,  14, 8,15, 8},
84
          { 2, 2, 3, 2,  4, 3, 5, 3,  10, 6,11, 6,  12, 7,13, 7}
85
        };
86
      }
87

    
88
    return mEdges;
89
    }
90

    
91
///////////////////////////////////////////////////////////////////////////////////////////////////
92

    
93
  @Override
94
  public int[][] getScrambleAlgorithms()
95
    {
96
    setUpRotatable();
97
    return ScrambleEdgeGenerator.getScramblingAlgorithms(mBasicAngle, mRotatable);
98
    }
99

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

    
102
  @Override
103
  public float[][] returnRotationFactor()
104
    {
105
    float C1 = 2.5f;
106
    float C2 = 1.0f;
107
    float[] f1 = new float[] { C1,C1,C1 };
108
    float[] f2 = new float[] { C2,C2,C2 };
109

    
110
    return new float[][] { f1,f1,f1,f1, f2,f2,f2 };
111
    }
112

    
113
///////////////////////////////////////////////////////////////////////////////////////////////////
114

    
115
  public float[][] getCuts(int[] numLayers)
116
    {
117
    if( mCuts==null )
118
      {
119
      float C1 = 0.75f*SQ3;
120
      float C2 = 1.49f;
121
      float[] cut1 = new float[] { -C1,C1 };
122
      float[] cut2 = new float[] { -C2,C2 };
123
      mCuts = new float[][] { cut1,cut1,cut1,cut1,cut2,cut2,cut2 };
124
      }
125

    
126
    return mCuts;
127
    }
128

    
129
///////////////////////////////////////////////////////////////////////////////////////////////////
130

    
131
  private void setUpRotatable()
132
    {
133
    if( mRotatable==null )
134
      {
135
      boolean[] tmp = new boolean[] {true,false,true};
136
      mRotatable = new boolean[][] { tmp,tmp,tmp,tmp,tmp,tmp,tmp };
137
      }
138
    }
139

    
140
///////////////////////////////////////////////////////////////////////////////////////////////////
141

    
142
  public boolean[][] getLayerRotatable(int[] numLayers)
143
    {
144
    setUpRotatable();
145
    return mRotatable;
146
    }
147

    
148
///////////////////////////////////////////////////////////////////////////////////////////////////
149

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

    
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156

    
157
  public int getTouchControlSplit()
158
    {
159
    return TYPE_SPLIT_EDGE_COIN;
160
    }
161

    
162
///////////////////////////////////////////////////////////////////////////////////////////////////
163

    
164
  public int[][][] getEnabled()
165
    {
166
    return new int[][][]
167
      {
168
         {{4},{4},{4},{4},{1},{3},{2},{0}},
169
         {{4},{4},{4},{4},{3},{1},{0},{2}},
170
         {{5},{5},{5},{5},{1},{0},{3},{2}},
171
         {{5},{5},{5},{5},{2},{3},{0},{1}},
172
         {{6},{6},{6},{6},{0},{2},{1},{3}},
173
         {{6},{6},{6},{6},{2},{0},{3},{1}},
174
      };
175
    }
176

    
177
///////////////////////////////////////////////////////////////////////////////////////////////////
178

    
179
  public float[] getDist3D(int[] numLayers)
180
    {
181
    return TouchControlHexahedron.D3D;
182
    }
183

    
184
///////////////////////////////////////////////////////////////////////////////////////////////////
185

    
186
  public Static3D[] getFaceAxis()
187
    {
188
    return TouchControlHexahedron.FACE_AXIS;
189
    }
190

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

    
193
  public float[][] getCubitPositions(int[] numLayers)
194
    {
195
    if( mPosition==null )
196
      {
197
      final float A = 1.48f-C;
198
      final float B = 1.52f;
199
      final float Z = 1.50f;
200
      final float E = 0.75f*D;
201

    
202
      mPosition = new float[][]
203
         {
204
             { A, A, A},
205
             { A, A,-A},
206
             { A,-A, A},
207
             { A,-A,-A},
208
             {-A, A, A},
209
             {-A, A,-A},
210
             {-A,-A, A},
211
             {-A,-A,-A},
212

    
213
             { 0, 0, B },
214
             { 0, 0,-B },
215
             { 0, B, 0 },
216
             { 0,-B, 0 },
217
             { B, 0, 0 },
218
             {-B, 0, 0 },
219

    
220
             { E, E, Z},
221
             { E,-E, Z},
222
             {-E, E, Z},
223
             {-E,-E, Z},
224
             { E, E,-Z},
225
             { E,-E,-Z},
226
             {-E, E,-Z},
227
             {-E,-E,-Z},
228
             { E, Z, E},
229
             { E, Z,-E},
230
             {-E, Z, E},
231
             {-E, Z,-E},
232
             { E,-Z, E},
233
             { E,-Z,-E},
234
             {-E,-Z, E},
235
             {-E,-Z,-E},
236
             { Z, E, E},
237
             { Z, E,-E},
238
             { Z,-E, E},
239
             { Z,-E,-E},
240
             {-Z, E, E},
241
             {-Z, E,-E},
242
             {-Z,-E, E},
243
             {-Z,-E,-E},
244
         };
245
      }
246

    
247
    return mPosition;
248
    }
249

    
250
///////////////////////////////////////////////////////////////////////////////////////////////////
251

    
252
  public Static4D getCubitQuats(int cubit, int[] numLayers)
253
    {
254
    if( mQuatIndex==null ) mQuatIndex = new int[] {0,9,11,4,12,3,6,21,
255
                                                   0,10,1,4,2,3,
256
                                                   0,15,17,16,19,10,13,23,1,9,20,7, 11,4,6,21,2,14,18,5,12,3,8,22 };
257
    return mObjectQuats[mQuatIndex[cubit]];
258
    }
259

    
260
///////////////////////////////////////////////////////////////////////////////////////////////////
261

    
262
  private float[] rotateVertices(float angle, float[] vector, float[] center, float[] rotAxis)
263
    {
264
    float[] ret = new float[4];
265
    float sin = (float)Math.sin(angle/2);
266
    float cos = (float)Math.cos(angle/2);
267
    float[] quat= new float[] { sin*rotAxis[0], sin*rotAxis[1], sin*rotAxis[2], cos};
268
    QuatHelper.rotateVectorByQuat(ret,vector,quat);
269

    
270
    ret[0] += center[0];
271
    ret[1] += center[1];
272
    ret[2] += center[2];
273

    
274
    return ret;
275
    }
276

    
277
///////////////////////////////////////////////////////////////////////////////////////////////////
278

    
279
  private float[][] produceCorner()
280
    {
281
    final float angle = (float)Math.PI/(2*N);
282
    final float A = 0.3f;
283
    final int N1 = 4;
284
    final int N2 = N1 + N + 1;
285
    final int N3 = N2 + N + 1;
286
    float[][] vertices= new float[3*N+8][3];
287

    
288
    vertices[3*N+7][0] = -A;
289
    vertices[3*N+7][1] = -A;
290
    vertices[3*N+7][2] = -A;
291

    
292
    vertices[0][0] = 0;
293
    vertices[0][1] = 0;
294
    vertices[0][2] = 0;
295
    vertices[1][0] =-2;
296
    vertices[1][1] = 0;
297
    vertices[1][2] = 0;
298
    vertices[2][0] = 0;
299
    vertices[2][1] =-2;
300
    vertices[2][2] = 0;
301
    vertices[3][0] = 0;
302
    vertices[3][1] = 0;
303
    vertices[3][2] =-2;
304

    
305
    for(int i=0; i<=N; i++)
306
      {
307
      float cos1 = (float)Math.cos((N-i)*angle);
308
      float sin1 = (float)Math.sin((N-i)*angle);
309
      float cos2 = (float)Math.cos((  i)*angle);
310
      float sin2 = (float)Math.sin((  i)*angle);
311

    
312
      vertices[N1+i][0] = 2*D*cos1-2;
313
      vertices[N1+i][1] = 2*D*sin1-2;
314
      vertices[N1+i][2] = 0;
315

    
316
      vertices[N2+i][0] = 0;
317
      vertices[N2+i][1] = 2*D*sin2-2;
318
      vertices[N2+i][2] = 2*D*cos2-2;
319

    
320
      vertices[N3+i][0] = 2*D*cos2-2;
321
      vertices[N3+i][1] = 0;
322
      vertices[N3+i][2] = 2*D*sin2-2;
323
      }
324

    
325
    for(int i=0; i<3*N+8; i++)
326
      {
327
      vertices[i][0] = 0.75f*vertices[i][0] + C;
328
      vertices[i][1] = 0.75f*vertices[i][1] + C;
329
      vertices[i][2] = 0.75f*vertices[i][2] + C;
330
      }
331

    
332
    return vertices;
333
    }
334

    
335
///////////////////////////////////////////////////////////////////////////////////////////////////
336

    
337
  private float[][] produceCenter()
338
    {
339
    float[][] ret = new float[4*N+1][];
340

    
341
    float[] rot = new float[] { 0,0,-1 };
342

    
343
    float[] center1 = { 1.5f*D, 1.5f*D, 0  };
344
    float[] center2 = { 1.5f*D,-1.5f*D, 0  };
345
    float[] center3 = {-1.5f*D,-1.5f*D, 0  };
346
    float[] center4 = {-1.5f*D, 1.5f*D, 0  };
347

    
348
    float[] vect1 = { -1.5f*D,0,0,0 };
349
    float[] vect2 = { 0, 1.5f*D,0,0 };
350
    float[] vect3 = {  1.5f*D,0,0,0 };
351
    float[] vect4 = { 0,-1.5f*D,0,0 };
352

    
353
    for(int i=0; i<N; i++)
354
      {
355
      float angle = (float)(Math.PI/2)*i/N;
356

    
357
      ret[i    ] = rotateVertices(angle, vect1, center1, rot);
358
      ret[i+  N] = rotateVertices(angle, vect2, center2, rot);
359
      ret[i+2*N] = rotateVertices(angle, vect3, center3, rot);
360
      ret[i+3*N] = rotateVertices(angle, vect4, center4, rot);
361
      }
362

    
363
    ret[4*N] = new float[] { 0, 0, -1.5f };
364

    
365
    return ret;
366
    }
367

    
368
///////////////////////////////////////////////////////////////////////////////////////////////////
369

    
370
  private float[][] produceLeaf()
371
    {
372
    float[][] ret = new float[2*N+1][];
373

    
374
    float[] rot = new float[] { 0,0,1 };
375

    
376
    float[] center1 = {-0.75f*D,-0.75f*D, 0 };
377
    float[] center2 = { 0.75f*D, 0.75f*D, 0 };
378

    
379
    float[] vect1 = {  0, 1.5f*D, 0, 0 };
380
    float[] vect2 = {  0,-1.5f*D, 0, 0 };
381

    
382
    for(int i=0; i<N; i++)
383
      {
384
      float angle = (float)(Math.PI/2)*i/N;
385

    
386
      ret[  N-1-i] = rotateVertices(angle, vect1, center1, rot);
387
      ret[2*N-1-i] = rotateVertices(angle, vect2, center2, rot);
388
      }
389

    
390
    ret[2*N] = new float[] { 0, 0, -1.5f/10 };
391

    
392
    return ret;
393
    }
394

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

    
397
  private float[][] getVertices(int variant)
398
    {
399
         if( variant==0 ) return produceCorner();
400
    else if( variant==1 ) return produceCenter();
401
    else                  return produceLeaf();
402
    }
403

    
404
///////////////////////////////////////////////////////////////////////////////////////////////////
405

    
406
  private int[][] produceCornerShape()
407
    {
408
    int[][] indices = new int[3*N+9][];
409

    
410
    indices[0] = new int[N+4];
411
    indices[1] = new int[N+4];
412
    indices[2] = new int[N+4];
413

    
414
    indices[0][0] = 2;
415
    indices[0][1] = 0;
416
    indices[0][2] = 1;
417
    indices[1][0] = 3;
418
    indices[1][1] = 0;
419
    indices[1][2] = 2;
420
    indices[2][0] = 1;
421
    indices[2][1] = 0;
422
    indices[2][2] = 3;
423

    
424
    int N1 = 4;
425
    int N2 = N1 + N + 1;
426
    int N3 = N2 + N + 1;
427

    
428
    for(int i=0; i<=N; i++)
429
      {
430
      indices[0][i+3] = N1 + i;
431
      indices[1][i+3] = N2 + i;
432
      indices[2][i+3] = N3 + i;
433
      }
434

    
435
    for(int i=0; i<N; i++)
436
      {
437
      indices[3*i+3] = new int[] { N1+i+1, N1+i, 3*N+7 };
438
      indices[3*i+4] = new int[] { N2+i+1, N2+i, 3*N+7 };
439
      indices[3*i+5] = new int[] { N3+i+1, N3+i, 3*N+7 };
440
      }
441

    
442
    indices[3*N+3] = new int[] { 2    , 4+  N, 3*N+7 };
443
    indices[3*N+4] = new int[] { 5  +N, 2    , 3*N+7 };
444
    indices[3*N+5] = new int[] { 5+2*N, 3    , 3*N+7 };
445
    indices[3*N+6] = new int[] { 3    , 6+2*N, 3*N+7 };
446
    indices[3*N+7] = new int[] { 1    , 6+3*N, 3*N+7 };
447
    indices[3*N+8] = new int[] { 4    , 1    , 3*N+7 };
448

    
449
    return indices;
450
    }
451

    
452
///////////////////////////////////////////////////////////////////////////////////////////////////
453

    
454
  private int[][] produceCenterShape()
455
    {
456
    int[][] ret = new int[1+4*N][];
457

    
458
    ret[0] = new int[4*N];
459
    for(int i=0; i<4*N; i++) ret[0][i] = 4*N-1-i;
460

    
461
    for(int i=0; i<N; i++)
462
      {
463
      ret[i+1] = new int[3];
464
      ret[i+1][0] = i;
465
      ret[i+1][1] = i+1;
466
      ret[i+1][2] = 4*N;
467

    
468
      ret[N+i+1] = new int[3];
469
      ret[N+i+1][0] = N+i;
470
      ret[N+i+1][1] = N+i+1;
471
      ret[N+i+1][2] = 4*N;
472

    
473
      ret[2*N+i+1] = new int[3];
474
      ret[2*N+i+1][0] = 2*N+i;
475
      ret[2*N+i+1][1] = 2*N+i+1;
476
      ret[2*N+i+1][2] = 4*N;
477

    
478
      ret[3*N+i+1] = new int[3];
479
      ret[3*N+i+1][0] = 3*N+i;
480
      ret[3*N+i+1][1] = i<N-1 ? 3*N+i+1 : 0;
481
      ret[3*N+i+1][2] = 4*N;
482
      }
483

    
484
    return ret;
485
    }
486

    
487
///////////////////////////////////////////////////////////////////////////////////////////////////
488

    
489
  private int[][] produceLeafShape()
490
    {
491
    int[][] ret = new int[2*N+1][];
492

    
493
    ret[0] = new int[2*N];
494
    for(int i=0; i<2*N; i++) ret[0][i] = i;
495

    
496
    for(int i=1; i<=N-1; i++)
497
      {
498
      ret[i] = new int[3];
499
      ret[i][0] = i;
500
      ret[i][1] = i-1;
501
      ret[i][2] = 2*N;
502

    
503
      ret[N-1+i] = new int[3];
504
      ret[N-1+i][0] = N+i;
505
      ret[N-1+i][1] = N+i-1;
506
      ret[N-1+i][2] = 2*N;
507
      }
508

    
509
    ret[2*N-1] = new int[] { N,  N-1, 2*N };
510
    ret[2*N  ] = new int[] { 0,2*N-1, 2*N };
511

    
512
    return ret;
513
    }
514

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

    
517
  public ObjectShape getObjectShape(int variant)
518
    {
519
    if( variant==0 )
520
      {
521
      int[][] indices = produceCornerShape();
522
      return new ObjectShape(getVertices(variant), indices);
523
      }
524
    else if( variant==1 )
525
      {
526
      int[][] indices = produceCenterShape();
527
      return new ObjectShape(getVertices(variant), indices);
528
      }
529
    else
530
      {
531
      int[][] indices = produceLeafShape();
532
      return new ObjectShape(getVertices(variant), indices);
533
      }
534
    }
535

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

    
538
  public ObjectFaceShape getObjectFaceShape(int variant)
539
    {
540
    if( variant==0 )
541
      {
542
      float h1 = isInIconMode() ? 0.0001f : 0.03f;
543
      float h2 = isInIconMode() ? 0.0001f : 0.01f;
544
      float[][] bands = { {h1,35,0.2f,0.4f,5,2,1}, {h2,35,0.2f,0.4f,2,0,0} };
545
      int num = 3*N+9;
546
      int[] indices = new int[num];
547
      for(int i=3; i<num; i++) indices[i] = 1;
548
      float S = 1-SQ2/2 - C;
549
      float[] convexCenter = {-S,-S,-S };
550
      return new ObjectFaceShape(bands,indices,convexCenter);
551
      }
552
    else if( variant==1 )
553
      {
554
      float h1 = isInIconMode() ? 0.0001f : 0.001f;
555
      float h2 = 0.0001f;
556
      float[][] bands = { {h1,5,0.2f,0.4f,5,0,0}, {h2,5,0.05f,0.1f,2,0,0} };
557
      int num = 1+4*N;
558
      int[] indices   = new int[num];
559
      for(int i=1; i<num; i++) indices[i] = 1;
560
      return new ObjectFaceShape(bands,indices,null);
561
      }
562
    else
563
      {
564
      float h1 = isInIconMode() ? 0.0001f : 0.015f;
565
      float h2 = isInIconMode() ? 0.0001f : 0.001f;
566
      float[][] bands = { {h1,25,0.250f,0.7f,5,0,0}, {h2,25,0.125f,0.2f,2,0,0} };
567
      int num = 1+2*N;
568
      int[] indices   = new int[num];
569
      for(int i=1; i<num; i++) indices[i] = 1;
570
      return new ObjectFaceShape(bands,indices,null);
571
      }
572
    }
573

    
574
///////////////////////////////////////////////////////////////////////////////////////////////////
575

    
576
  public ObjectVertexEffects getVertexEffects(int variant)
577
    {
578
    if( variant==0 )
579
      {
580
      float[][] corners = { {0.05f,0.15f} };
581
      int num = 8+3*N;
582
      int[] indices = new int[num];
583
      for(int i=1; i<num; i++) indices[i] = -1;
584
      float[][] centers = {{ 0,0,0 }};
585
      return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
586
      }
587
    else if( variant==1 )
588
      {
589
      float[][] corners = { {0.05f,0.20f} };
590
      int num = 1+4*N;
591
      int[] indices = new int[num];
592
      for(int i=0; i<num; i++) indices[i] = -1;
593
      float[][] centers = { { 0,0,0 } };
594
      return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
595
      }
596
    else
597
      {
598
      float[][] corners = { {0.05f,0.20f} };
599
      int num = 1+2*N;
600
      int[] indices = new int[num];
601
      for(int i=0; i<num; i++) indices[i] = -1;
602
      float[][] centers = { { 0,0,0 } };
603
      return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
604
      }
605
    }
606

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

    
609
  public int getNumCubitVariants(int[] numLayers)
610
    {
611
    return 3;
612
    }
613

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

    
616
  public int getCubitVariant(int cubit, int[] numLayers)
617
    {
618
    return cubit<8 ? 0 : (cubit<14 ? 1:2);
619
    }
620

    
621
///////////////////////////////////////////////////////////////////////////////////////////////////
622

    
623
  public float getStickerRadius()
624
    {
625
    return 0.12f;
626
    }
627

    
628
///////////////////////////////////////////////////////////////////////////////////////////////////
629

    
630
  public float getStickerStroke()
631
    {
632
    return isInIconMode() ? 0.23f : 0.12f;
633
    }
634

    
635
///////////////////////////////////////////////////////////////////////////////////////////////////
636
// ditto, manually provide the sticker coordinates.
637

    
638
  @Override
639
  public void adjustStickerCoords()
640
    {
641
    float A = 0.38f;
642
    float B = 0.24f;
643
    float C = 0.50f;
644
    float D = 0.00f;
645

    
646
    mStickerCoords = new float[][][][]
647
          {
648
                  { { { A,-C}, { A, A}, {-C, A}, {-C, B}, {B,-C} } },
649
                  { { { C, D}, { D, C}, {-C, D}, { D,-C} } },
650
                  { { { C,-C}, {-C, C} } }
651
          };
652
    }
653

    
654
///////////////////////////////////////////////////////////////////////////////////////////////////
655

    
656
  public float[][][] getStickerAngles()
657
    {
658
    float D = (float)(Math.PI/4);
659
    return new float[][][] { {{ 0,0,0,-D,0 }} , {{-D,-D,-D,-D}} , {{D,D}} };
660
    }
661

    
662
///////////////////////////////////////////////////////////////////////////////////////////////////
663
// PUBLIC API
664

    
665
  public Static3D[] getRotationAxis()
666
    {
667
    return ROT_AXIS;
668
    }
669

    
670
///////////////////////////////////////////////////////////////////////////////////////////////////
671

    
672
  public int[][] getBasicAngles()
673
    {
674
    if( mBasicAngle ==null )
675
      {
676
      int[] tmp1 = {3,3,3};
677
      int[] tmp2 = {4,4,4};
678
      mBasicAngle = new int[][] { tmp1,tmp1,tmp1,tmp1,tmp2,tmp2,tmp2 };
679
      }
680

    
681
    return mBasicAngle;
682
    }
683

    
684
///////////////////////////////////////////////////////////////////////////////////////////////////
685

    
686
  public String getShortName()
687
    {
688
    return ListObjects.COIH_3.name();
689
    }
690

    
691
///////////////////////////////////////////////////////////////////////////////////////////////////
692

    
693
  public String[][] getTutorials()
694
    {
695
    return new String[][] {
696
                          {"gb","8hPxLbZDSLQ","Chinese Coin Cube","CanChrisSolve"},
697
                          {"es","rK0_IsjoZqM","Ancient Coin Cube","R de Rubik"},
698
                          {"ru","HVZj2vBxD5A","Как собрать Коин Куб","Алексей Ярыгин"},
699
                          {"pl","yaNeIw4C5Uk","Ancient coin cube TUTORIAL PL","MrUK"},
700
                          {"tw","B7oD3pAXBVY","銅幣魔方教學","不正常魔術方塊研究中心"},
701
                         };
702
    }
703
}
(9-9/59)