Project

General

Profile

Download (17 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / TwistyDiamond.java @ e782e026

1 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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.objects;
21
22
import android.content.res.Resources;
23
24 f10a88a8 Leszek Koltunski
import org.distorted.helpers.ObjectShape;
25 9c06394a Leszek Koltunski
import org.distorted.helpers.ObjectSticker;
26 6cf89a3e Leszek Koltunski
import org.distorted.helpers.ScrambleState;
27 ece1b58d Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
28
import org.distorted.library.main.DistortedTexture;
29
import org.distorted.library.mesh.MeshSquare;
30
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32 6fd4a72c Leszek Koltunski
import org.distorted.main.R;
33 ece1b58d Leszek Koltunski
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35
36 9c2f0c91 Leszek Koltunski
public class TwistyDiamond extends TwistyObject
37 ece1b58d Leszek Koltunski
{
38
  // the four rotation axis of a Diamond. Must be normalized.
39
  static final Static3D[] ROT_AXIS = new Static3D[]
40
         {
41
           new Static3D(+SQ6/3,+SQ3/3,     0),
42
           new Static3D(-SQ6/3,+SQ3/3,     0),
43 cc99cf91 Leszek Koltunski
           new Static3D(     0,-SQ3/3,-SQ6/3),
44
           new Static3D(     0,-SQ3/3,+SQ6/3)
45 ece1b58d Leszek Koltunski
         };
46
47
  private static final int[] FACE_COLORS = new int[]
48
         {
49 2ef489e2 Leszek Koltunski
           COLOR_ORANGE, COLOR_VIOLET,
50
           COLOR_WHITE , COLOR_BLUE  ,
51
           COLOR_YELLOW, COLOR_RED   ,
52
           COLOR_GREEN , COLOR_GREY
53 ece1b58d Leszek Koltunski
         };
54
55 aec5cc91 Leszek Koltunski
  private static final int FACES_PER_CUBIT =8;
56 9c06394a Leszek Koltunski
57 91792184 Leszek Koltunski
  private ScrambleState[] mStates;
58 aec5cc91 Leszek Koltunski
  private int[] mBasicAngle;
59
  private int[] mFaceMap;
60
  private Static4D[] mQuats;
61
  private int[] mTetraToFaceMap;
62
  private ObjectSticker[] mStickers;
63 486b3417 Leszek Koltunski
64 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
65
66 9c2f0c91 Leszek Koltunski
  TwistyDiamond(int size, Static4D quat, DistortedTexture texture,
67
                MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
68 ece1b58d Leszek Koltunski
    {
69 db875721 Leszek Koltunski
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.DIAM, res, scrWidth);
70 91792184 Leszek Koltunski
    }
71 486b3417 Leszek Koltunski
72 91792184 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
73 486b3417 Leszek Koltunski
74 91792184 Leszek Koltunski
  ScrambleState[] getScrambleStates()
75
    {
76
    if( mStates==null )
77 486b3417 Leszek Koltunski
      {
78 91792184 Leszek Koltunski
      int size = getNumLayers();
79
      int[] tmp = new int[3*2*size];
80
81
      for(int i=0; i<2*size; i++)
82
        {
83
        tmp[3*i  ] = (i<size) ?  i:i-size;
84
        tmp[3*i+1] = (i%2==0) ? -1:1;
85
        tmp[3*i+2] = 0;
86
        }
87
88
      mStates = new ScrambleState[]
89
        {
90
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
91
        };
92 486b3417 Leszek Koltunski
      }
93
94 91792184 Leszek Koltunski
    return mStates;
95 ece1b58d Leszek Koltunski
    }
96
97 aec5cc91 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
98
99
  private void initializeQuats()
100
    {
101
    mQuats = new Static4D[]
102
         {
103
          new Static4D(  0.0f,  0.0f,   0.0f,  1.0f ),
104
          new Static4D(  0.0f,  1.0f,   0.0f,  0.0f ),
105
          new Static4D(+SQ2/2,  0.0f, -SQ2/2,  0.0f ),
106
          new Static4D(-SQ2/2,  0.0f, -SQ2/2,  0.0f ),
107
108
          new Static4D(+SQ2/2,  0.5f,   0.0f,  0.5f ),
109
          new Static4D(-SQ2/2,  0.5f,   0.0f,  0.5f ),
110
          new Static4D(  0.0f,  0.5f, +SQ2/2,  0.5f ),
111
          new Static4D(  0.0f,  0.5f, -SQ2/2,  0.5f ),
112
          new Static4D(+SQ2/2,  0.5f,   0.0f, -0.5f ),
113
          new Static4D(-SQ2/2,  0.5f,   0.0f, -0.5f ),
114
          new Static4D(  0.0f,  0.5f, +SQ2/2, -0.5f ),
115
          new Static4D(  0.0f,  0.5f, -SQ2/2, -0.5f )
116
         };
117
    }
118
119 a480ee80 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
120
121
  int[] getSolvedQuats(int cubit, int numLayers)
122
    {
123 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
124
    if( mFaceMap==null ) mFaceMap = new int[] {4,0,6,2,7,3,5,1};
125 a480ee80 Leszek Koltunski
    int status = retCubitSolvedStatus(cubit,numLayers);
126 aec5cc91 Leszek Koltunski
    return status<0 ? null : buildSolvedQuats(MovementDiamond.FACE_AXIS[mFaceMap[status]],mQuats);
127 a480ee80 Leszek Koltunski
    }
128
129 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
130
131
  float getScreenRatio()
132
    {
133 ab0c28f0 Leszek Koltunski
    return 0.65f;
134 ece1b58d Leszek Koltunski
    }
135
136
///////////////////////////////////////////////////////////////////////////////////////////////////
137
138
  Static4D[] getQuats()
139
    {
140 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
141
    return mQuats;
142 ece1b58d Leszek Koltunski
    }
143
144
///////////////////////////////////////////////////////////////////////////////////////////////////
145
146 abf36986 Leszek Koltunski
  int getNumFaceColors()
147 ece1b58d Leszek Koltunski
    {
148
    return FACE_COLORS.length;
149
    }
150
151
///////////////////////////////////////////////////////////////////////////////////////////////////
152
153
  boolean shouldResetTextureMaps()
154
    {
155
    return false;
156
    }
157
158 169219a7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
159
160
  int getSolvedFunctionIndex()
161
    {
162
    return 0;
163
    }
164
165 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
166
167 a64e07d0 Leszek Koltunski
  int getNumStickerTypes(int numLayers)
168 ece1b58d Leszek Koltunski
    {
169 aec5cc91 Leszek Koltunski
    return 1;
170 ece1b58d Leszek Koltunski
    }
171
172
///////////////////////////////////////////////////////////////////////////////////////////////////
173
174 e6734aa9 Leszek Koltunski
  float[][] getCuts(int numLayers)
175 ece1b58d Leszek Koltunski
    {
176 680f921e Leszek Koltunski
    if( numLayers<2 )
177
      {
178
      return null;
179
      }
180
    else
181
      {
182 e6734aa9 Leszek Koltunski
      float[][] cuts = new float[4][numLayers-1];
183 5da517d3 Leszek Koltunski
      float dist = SQ6/3;
184 680f921e Leszek Koltunski
      float cut  = 0.5f*dist*(2-numLayers);
185
186
      for(int i=0; i<numLayers-1; i++)
187
        {
188 e6734aa9 Leszek Koltunski
        cuts[0][i] = cut;
189
        cuts[1][i] = cut;
190
        cuts[2][i] = cut;
191
        cuts[3][i] = cut;
192 680f921e Leszek Koltunski
        cut += dist;
193
        }
194
195
      return cuts;
196
      }
197 ece1b58d Leszek Koltunski
    }
198
199
///////////////////////////////////////////////////////////////////////////////////////////////////
200
201
  int getNumCubitFaces()
202
    {
203
    return FACES_PER_CUBIT;
204
    }
205
206
///////////////////////////////////////////////////////////////////////////////////////////////////
207
208 680f921e Leszek Koltunski
  private int getNumOctahedrons(int layers)
209
    {
210
    return layers==1 ? 1 : 4*(layers-1)*(layers-1) + 2;
211
    }
212
213
///////////////////////////////////////////////////////////////////////////////////////////////////
214
215
  private int getNumTetrahedrons(int layers)
216
    {
217
    return 4*layers*(layers-1);
218
    }
219
220
///////////////////////////////////////////////////////////////////////////////////////////////////
221
222 31cd7256 Leszek Koltunski
  private int createOctaPositions(float[][] centers, int index, int layers, float height)
223 680f921e Leszek Koltunski
    {
224 5da517d3 Leszek Koltunski
    float x = (layers-1)*0.5f;
225
    float z = (layers+1)*0.5f;
226 680f921e Leszek Koltunski
227
    for(int i=0; i<layers; i++, index++)
228
      {
229 5da517d3 Leszek Koltunski
      z -= 1;
230 680f921e Leszek Koltunski
      centers[index][0] = x;
231
      centers[index][1] = height;
232
      centers[index][2] = z;
233
      }
234
235
    for(int i=0; i<layers-1; i++, index++)
236
      {
237 5da517d3 Leszek Koltunski
      x -= 1;
238 680f921e Leszek Koltunski
      centers[index][0] = x;
239
      centers[index][1] = height;
240
      centers[index][2] = z;
241
      }
242
243
    for(int i=0; i<layers-1; i++, index++)
244
      {
245 5da517d3 Leszek Koltunski
      z += 1;
246 680f921e Leszek Koltunski
      centers[index][0] = x;
247
      centers[index][1] = height;
248
      centers[index][2] = z;
249
      }
250
251
    for(int i=0; i<layers-2; i++, index++)
252
      {
253 5da517d3 Leszek Koltunski
      x += 1;
254 680f921e Leszek Koltunski
      centers[index][0] = x;
255
      centers[index][1] = height;
256
      centers[index][2] = z;
257
      }
258
259
    return index;
260
    }
261
262
///////////////////////////////////////////////////////////////////////////////////////////////////
263
264 31cd7256 Leszek Koltunski
  private int createTetraPositions(float[][] centers, int index, int layers, float height)
265 ece1b58d Leszek Koltunski
    {
266 5da517d3 Leszek Koltunski
    float x = (layers-1)*0.5f;
267
    float z =  layers*0.5f;
268 680f921e Leszek Koltunski
269
    for(int i=0; i<layers-1; i++, index++)
270
      {
271 5da517d3 Leszek Koltunski
      z -= 1;
272 680f921e Leszek Koltunski
      centers[index][0] = x;
273
      centers[index][1] = height;
274
      centers[index][2] = z;
275
      }
276
277 5da517d3 Leszek Koltunski
    x += 0.5f;
278
    z -= 0.5f;
279 680f921e Leszek Koltunski
280
    for(int i=0; i<layers-1; i++, index++)
281
      {
282 5da517d3 Leszek Koltunski
      x -= 1;
283 680f921e Leszek Koltunski
      centers[index][0] = x;
284
      centers[index][1] = height;
285
      centers[index][2] = z;
286
      }
287
288 5da517d3 Leszek Koltunski
    x -= 0.5f;
289
    z -= 0.5f;
290 680f921e Leszek Koltunski
291
    for(int i=0; i<layers-1; i++, index++)
292
      {
293 5da517d3 Leszek Koltunski
      z += 1;
294 680f921e Leszek Koltunski
      centers[index][0] = x;
295
      centers[index][1] = height;
296
      centers[index][2] = z;
297
      }
298
299 5da517d3 Leszek Koltunski
    x -= 0.5f;
300
    z += 0.5f;
301 680f921e Leszek Koltunski
302
    for(int i=0; i<layers-1; i++, index++)
303
      {
304 5da517d3 Leszek Koltunski
      x += 1;
305 680f921e Leszek Koltunski
      centers[index][0] = x;
306
      centers[index][1] = height;
307
      centers[index][2] = z;
308
      }
309
310
    return index;
311
    }
312
313
///////////////////////////////////////////////////////////////////////////////////////////////////
314
315
  float[][] getCubitPositions(int layers)
316
    {
317
    int numO = getNumOctahedrons(layers);
318
    int numT = getNumTetrahedrons(layers);
319
    int index = 0;
320
    float height = 0.0f;
321
322
    float[][] CENTERS = new float[numO+numT][3];
323
324 31cd7256 Leszek Koltunski
    index = createOctaPositions(CENTERS,index,layers,height);
325 680f921e Leszek Koltunski
326
    for(int i=layers-1; i>0; i--)
327
      {
328 5da517d3 Leszek Koltunski
      height += SQ2/2;
329 31cd7256 Leszek Koltunski
      index = createOctaPositions(CENTERS,index,i,+height);
330
      index = createOctaPositions(CENTERS,index,i,-height);
331 680f921e Leszek Koltunski
      }
332
333 5da517d3 Leszek Koltunski
    height = SQ2/4;
334 680f921e Leszek Koltunski
335
    for(int i=layers; i>1; i--)
336
      {
337 31cd7256 Leszek Koltunski
      index = createTetraPositions(CENTERS,index,i,+height);
338
      index = createTetraPositions(CENTERS,index,i,-height);
339 5da517d3 Leszek Koltunski
      height += SQ2/2;
340 680f921e Leszek Koltunski
      }
341
342 ece1b58d Leszek Koltunski
    return CENTERS;
343
    }
344
345
///////////////////////////////////////////////////////////////////////////////////////////////////
346
347 680f921e Leszek Koltunski
  private int retFaceTetraBelongsTo(int tetra, int numLayers)
348 ece1b58d Leszek Koltunski
    {
349 aec5cc91 Leszek Koltunski
    if( mTetraToFaceMap==null ) mTetraToFaceMap = new int[] {1,2,3,0,5,6,7,4};
350
351 68b5f9c5 Leszek Koltunski
    for(int i=numLayers-1; i>0; i--)
352 ece1b58d Leszek Koltunski
      {
353 68b5f9c5 Leszek Koltunski
      if( tetra < 8*i ) return mTetraToFaceMap[tetra/i];
354
      tetra -= 8*i;
355 680f921e Leszek Koltunski
      }
356 68b5f9c5 Leszek Koltunski
357
    return -1;
358 680f921e Leszek Koltunski
    }
359
360 f10a88a8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
361
362
  ObjectShape getObjectShape(int cubit, int numLayers)
363
    {
364
    int variant = getCubitVariant(cubit,numLayers);
365 f56b53cb Leszek Koltunski
    int N = numLayers>3 ? 5:6;
366 7d11f930 Leszek Koltunski
    int E = numLayers>2 ? (numLayers>3 ? 0:1):2;
367 ece1b58d Leszek Koltunski
368 f10a88a8 Leszek Koltunski
    if( variant==0 )
369 ece1b58d Leszek Koltunski
      {
370 aec5cc91 Leszek Koltunski
      double[][] vertices = new double[][]
371
          {
372
             { 0.5,   0.0, 0.5},
373
             { 0.5,   0.0,-0.5},
374
             {-0.5,   0.0,-0.5},
375
             {-0.5,   0.0, 0.5},
376
             { 0.0, SQ2/2, 0.0},
377
             { 0.0,-SQ2/2, 0.0}
378
          };
379
380
      int[][] vert_indices = new int[][]
381
          {
382
             {3,0,4},
383
             {0,1,4},
384
             {1,2,4},
385
             {2,3,4},
386
             {5,0,3},
387
             {5,1,0},
388
             {5,2,1},
389
             {5,3,2}
390
          };
391
392 f10a88a8 Leszek Koltunski
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
393
      int[] bandIndices   = new int[] { 0,0,0,0,0,0,0,0 };
394
      float[][] corners   = new float[][] { {0.04f,0.20f} };
395
      int[] cornerIndices = new int[] { 0,0,0,0,0,0 };
396
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
397
      int[] centerIndices = new int[] { 0,0,0,0,0,0 };
398 aec5cc91 Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
399 ece1b58d Leszek Koltunski
      }
400
    else
401
      {
402 aec5cc91 Leszek Koltunski
      double[][] vertices = new double[][] { {-0.5, SQ2/4, 0.0}, { 0.5, SQ2/4, 0.0}, { 0.0,-SQ2/4, 0.5}, { 0.0,-SQ2/4,-0.5} };
403
      int[][] vert_indices = new int[][]  { {2,1,0}, {2,3,1}, {3,2,0}, {3,0,1} };
404 f10a88a8 Leszek Koltunski
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
405
      int[] bandIndices   = new int[] { 0,0,0,0 };
406
      float[][] corners   = new float[][] { {0.08f,0.15f} };
407
      int[] cornerIndices = new int[] { 0,0,0,0 };
408
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
409
      int[] centerIndices = new int[] { 0,0,0,0 };
410 aec5cc91 Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
411 f10a88a8 Leszek Koltunski
      }
412
    }
413
414
///////////////////////////////////////////////////////////////////////////////////////////////////
415
416 3e605536 Leszek Koltunski
  Static4D getQuat(int cubit, int numLayers)
417 f10a88a8 Leszek Koltunski
    {
418 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
419 3e605536 Leszek Koltunski
    int numO = getNumOctahedrons(numLayers);
420 f10a88a8 Leszek Koltunski
421 aec5cc91 Leszek Koltunski
    if( cubit<numO ) return mQuats[0];
422 f10a88a8 Leszek Koltunski
423 3e605536 Leszek Koltunski
    switch( retFaceTetraBelongsTo(cubit-numO, numLayers) )
424 f10a88a8 Leszek Koltunski
      {
425 aec5cc91 Leszek Koltunski
      case 0: return mQuats[0];                         // unit quat
426 3e605536 Leszek Koltunski
      case 1: return new Static4D(0,-SQ2/2,0,SQ2/2);    //  90 along Y
427 aec5cc91 Leszek Koltunski
      case 2: return mQuats[1];                         // 180 along Y
428 3e605536 Leszek Koltunski
      case 3: return new Static4D(0,+SQ2/2,0,SQ2/2);    //  90 along
429
      case 4: return new Static4D(0,     0,1,    0);    // 180 along Z
430
      case 5: return new Static4D(SQ2/2, 0,SQ2/2,0);    //
431
      case 6: return new Static4D(     1,0,0,    0);    // 180 along X
432
      case 7: return new Static4D(-SQ2/2,0,SQ2/2,0);    //
433 ece1b58d Leszek Koltunski
      }
434
435 3e605536 Leszek Koltunski
    return null;
436
    }
437
438
///////////////////////////////////////////////////////////////////////////////////////////////////
439 ece1b58d Leszek Koltunski
440 3e605536 Leszek Koltunski
  int getNumCubitVariants(int numLayers)
441
    {
442
    return 2;
443
    }
444
445
///////////////////////////////////////////////////////////////////////////////////////////////////
446
447
  int getCubitVariant(int cubit, int numLayers)
448
    {
449
    return cubit<getNumOctahedrons(numLayers) ? 0 : 1;
450 ece1b58d Leszek Koltunski
    }
451
452
///////////////////////////////////////////////////////////////////////////////////////////////////
453
454 2ef489e2 Leszek Koltunski
  int getFaceColor(int cubit, int cubitface, int size)
455 ece1b58d Leszek Koltunski
    {
456 2ef489e2 Leszek Koltunski
    int numO = getNumOctahedrons(size);
457 680f921e Leszek Koltunski
458
    if( cubit<numO )
459
      {
460 2ef489e2 Leszek Koltunski
      int axis = 0;
461
      int layer= 1;
462
463
      switch(cubitface)
464
        {
465
        case 0: axis = 2; layer =             1; break;
466
        case 1: axis = 0; layer = (1<<(size-1)); break;
467
        case 2: axis = 3; layer =             1; break;
468
        case 3: axis = 1; layer = (1<<(size-1)); break;
469
        case 4: axis = 3; layer = (1<<(size-1)); break;
470
        case 5: axis = 1; layer =             1; break;
471
        case 6: axis = 2; layer = (1<<(size-1)); break;
472
        case 7: axis = 0; layer =             1; break;
473
        }
474
475 a4962b9c Leszek Koltunski
      return CUBITS[cubit].mRotationRow[axis] == layer ? cubitface : NUM_TEXTURES;
476 680f921e Leszek Koltunski
      }
477
    else
478
      {
479 a4962b9c Leszek Koltunski
      return cubitface>0 ? NUM_TEXTURES : retFaceTetraBelongsTo(cubit-numO, size);
480 680f921e Leszek Koltunski
      }
481 ece1b58d Leszek Koltunski
    }
482
483
///////////////////////////////////////////////////////////////////////////////////////////////////
484
485 9c06394a Leszek Koltunski
  int getColor(int face)
486 ece1b58d Leszek Koltunski
    {
487 9c06394a Leszek Koltunski
    return FACE_COLORS[face];
488
    }
489
490
///////////////////////////////////////////////////////////////////////////////////////////////////
491 76c2bd07 Leszek Koltunski
492 9c06394a Leszek Koltunski
  ObjectSticker retSticker(int face)
493
    {
494 aec5cc91 Leszek Koltunski
    if( mStickers==null )
495
      {
496
      float[][] STICKERS = new float[][] { { -0.4330127f, -0.25f, 0.4330127f, -0.25f, 0.0f, 0.5f } };
497
      float radius = 0.06f;
498
      float stroke = 0.07f;
499
      float[] radii = new float[] {radius,radius,radius};
500
      mStickers     = new ObjectSticker[STICKERS.length];
501
      mStickers[0]  = new ObjectSticker(STICKERS[0],null,radii,stroke);
502
      }
503
504 abf36986 Leszek Koltunski
    return mStickers[face/NUM_FACE_COLORS];
505 ece1b58d Leszek Koltunski
    }
506
507
///////////////////////////////////////////////////////////////////////////////////////////////////
508
509
  float returnMultiplier()
510
    {
511 cc99cf91 Leszek Koltunski
    return 1.5f;
512 ece1b58d Leszek Koltunski
    }
513
514
///////////////////////////////////////////////////////////////////////////////////////////////////
515 e1dc3366 Leszek Koltunski
// PUBLIC API
516 ece1b58d Leszek Koltunski
517 e1dc3366 Leszek Koltunski
  public Static3D[] getRotationAxis()
518
    {
519
    return ROT_AXIS;
520
    }
521
522
///////////////////////////////////////////////////////////////////////////////////////////////////
523
524
  public int[] getBasicAngle()
525
    {
526 aec5cc91 Leszek Koltunski
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
527
    return mBasicAngle;
528 e1dc3366 Leszek Koltunski
    }
529
530 6fd4a72c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
531
532
  public int getObjectName(int numLayers)
533
    {
534 2ef489e2 Leszek Koltunski
    switch(numLayers)
535
      {
536
      case 2: return R.string.diam2;
537
      case 3: return R.string.diam3;
538 2adf1263 Leszek Koltunski
      case 4: return R.string.diam4;
539 2ef489e2 Leszek Koltunski
      }
540
541
    return 0;
542 6fd4a72c Leszek Koltunski
    }
543
544
///////////////////////////////////////////////////////////////////////////////////////////////////
545
546
  public int getInventor(int numLayers)
547
    {
548 2ef489e2 Leszek Koltunski
    switch(numLayers)
549
      {
550
      case 2: return R.string.diam2_inventor;
551
      case 3: return R.string.diam3_inventor;
552 2adf1263 Leszek Koltunski
      case 4: return R.string.diam4_inventor;
553 2ef489e2 Leszek Koltunski
      }
554
555
    return 0;
556 6fd4a72c Leszek Koltunski
    }
557
558
///////////////////////////////////////////////////////////////////////////////////////////////////
559
560
  public int getComplexity(int numLayers)
561
    {
562 2ef489e2 Leszek Koltunski
    switch(numLayers)
563
      {
564 2adf1263 Leszek Koltunski
      case 2: return 4;
565
      case 3: return 6;
566
      case 4: return 8;
567 2ef489e2 Leszek Koltunski
      }
568
569
    return 0;
570 6fd4a72c Leszek Koltunski
    }
571 ece1b58d Leszek Koltunski
}