Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / TwistyRex.java @ abf36986

1 59b87d56 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 a38fe4b2 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 59b87d56 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
import org.distorted.main.R;
33
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35
36
public class TwistyRex extends TwistyObject
37
{
38
  // the four rotation axis of a RubikRex. Must be normalized.
39
  static final Static3D[] ROT_AXIS = new Static3D[]
40
         {
41
           new Static3D(+SQ3/3,+SQ3/3,+SQ3/3),
42
           new Static3D(+SQ3/3,+SQ3/3,-SQ3/3),
43
           new Static3D(+SQ3/3,-SQ3/3,+SQ3/3),
44
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
45
         };
46
47
  private static final int[] FACE_COLORS = new int[]
48
         {
49
           COLOR_YELLOW, COLOR_WHITE,
50
           COLOR_BLUE  , COLOR_GREEN,
51 323b217c Leszek Koltunski
           COLOR_RED   , COLOR_ORANGE
52 59b87d56 Leszek Koltunski
         };
53
54 f242ba04 Leszek Koltunski
  public static final float REX_D = 0.2f;
55 9c06394a Leszek Koltunski
56 91792184 Leszek Koltunski
  private ScrambleState[] mStates;
57 f242ba04 Leszek Koltunski
  private int[] mBasicAngle;
58
  private Static4D[] mQuats;
59
  private int[][] mFaceMap;
60
  private ObjectSticker[] mStickers;
61 01b2ef5a Leszek Koltunski
62 59b87d56 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
63
64
  TwistyRex(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
65
            DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
66
    {
67 db875721 Leszek Koltunski
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.REX, res, scrWidth);
68 91792184 Leszek Koltunski
    }
69 01b2ef5a Leszek Koltunski
70 91792184 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
71 01b2ef5a Leszek Koltunski
72 91792184 Leszek Koltunski
  ScrambleState[] getScrambleStates()
73
    {
74
    if( mStates==null )
75 01b2ef5a Leszek Koltunski
      {
76 91792184 Leszek Koltunski
      int[] tmp = {0,-1,0, 0,1,0, 2,-1,0, 2,1,0 };
77
78
      mStates = new ScrambleState[]
79
        {
80
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
81
        };
82
      }
83
84
    return mStates;
85 59b87d56 Leszek Koltunski
    }
86
87 f242ba04 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
88
89
  private void initializeQuats()
90
    {
91
    mQuats = new Static4D[]
92
         {
93
         new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),
94
         new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
95
         new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
96
         new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
97
98
         new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),
99
         new Static4D(  0.5f,  0.5f,  0.5f, -0.5f ),
100
         new Static4D(  0.5f,  0.5f, -0.5f,  0.5f ),
101
         new Static4D(  0.5f,  0.5f, -0.5f, -0.5f ),
102
         new Static4D(  0.5f, -0.5f,  0.5f,  0.5f ),
103
         new Static4D(  0.5f, -0.5f,  0.5f, -0.5f ),
104
         new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
105
         new Static4D(  0.5f, -0.5f, -0.5f, -0.5f )
106
         };
107
    }
108
109 a480ee80 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
110
111
  int[] getSolvedQuats(int cubit, int numLayers)
112
    {
113 f242ba04 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
114 a480ee80 Leszek Koltunski
    int status = retCubitSolvedStatus(cubit,numLayers);
115 f242ba04 Leszek Koltunski
    return status<0 ? null : buildSolvedQuats(MovementRex.FACE_AXIS[status],mQuats);
116 a480ee80 Leszek Koltunski
    }
117
118 59b87d56 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
119
120
  float getScreenRatio()
121
    {
122 80ec6abf Leszek Koltunski
    return 1.5f;
123 59b87d56 Leszek Koltunski
    }
124
125
///////////////////////////////////////////////////////////////////////////////////////////////////
126
127
  Static4D[] getQuats()
128
    {
129 f242ba04 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
130
    return mQuats;
131 59b87d56 Leszek Koltunski
    }
132
133
///////////////////////////////////////////////////////////////////////////////////////////////////
134
135 abf36986 Leszek Koltunski
  int getNumFaceColors()
136 59b87d56 Leszek Koltunski
    {
137
    return FACE_COLORS.length;
138
    }
139
140
///////////////////////////////////////////////////////////////////////////////////////////////////
141
142
  boolean shouldResetTextureMaps()
143
    {
144
    return false;
145
    }
146
147 169219a7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
148
149
  int getSolvedFunctionIndex()
150
    {
151
    return 0;
152
    }
153
154 59b87d56 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
155
156 a64e07d0 Leszek Koltunski
  int getNumStickerTypes(int numLayers)
157 59b87d56 Leszek Koltunski
    {
158 f242ba04 Leszek Koltunski
    return 3;
159 59b87d56 Leszek Koltunski
    }
160
161
///////////////////////////////////////////////////////////////////////////////////////////////////
162
163 e6734aa9 Leszek Koltunski
  float[][] getCuts(int numLayers)
164 59b87d56 Leszek Koltunski
    {
165 c75ab933 Leszek Koltunski
    float C = SQ3*0.15f; // bit less than 1/6 of the length of the main diagonal
166
    float[] cut = new float[] {-C,+C};
167 e6734aa9 Leszek Koltunski
    return new float[][] { cut,cut,cut,cut };
168 59b87d56 Leszek Koltunski
    }
169
170
///////////////////////////////////////////////////////////////////////////////////////////////////
171
172
  int getNumCubitFaces()
173
    {
174 f242ba04 Leszek Koltunski
    return 6;
175 59b87d56 Leszek Koltunski
    }
176
177
///////////////////////////////////////////////////////////////////////////////////////////////////
178
179 e6cf7283 Leszek Koltunski
  float[][] getCubitPositions(int numLayers)
180 59b87d56 Leszek Koltunski
    {
181 c75ab933 Leszek Koltunski
    final float DIST1= 0.50f;
182 da36b97e Leszek Koltunski
    final float DIST2= (1+2*REX_D)/6;
183 c75ab933 Leszek Koltunski
    final float DIST3= 0.51f;
184
185
    final float[][] CENTERS = new float[24+6+12][];
186
187
    CENTERS[ 0] = new float[] { +DIST3, +DIST2, +DIST2};
188
    CENTERS[ 1] = new float[] { +DIST3, +DIST2, -DIST2};
189
    CENTERS[ 2] = new float[] { +DIST3, -DIST2, -DIST2};
190
    CENTERS[ 3] = new float[] { +DIST3, -DIST2, +DIST2};
191
    CENTERS[ 4] = new float[] { -DIST3, +DIST2, +DIST2};
192
    CENTERS[ 5] = new float[] { -DIST3, +DIST2, -DIST2};
193
    CENTERS[ 6] = new float[] { -DIST3, -DIST2, -DIST2};
194
    CENTERS[ 7] = new float[] { -DIST3, -DIST2, +DIST2};
195
    CENTERS[ 8] = new float[] { +DIST2, +DIST3, +DIST2};
196
    CENTERS[ 9] = new float[] { +DIST2, +DIST3, -DIST2};
197
    CENTERS[10] = new float[] { -DIST2, +DIST3, -DIST2};
198
    CENTERS[11] = new float[] { -DIST2, +DIST3, +DIST2};
199
    CENTERS[12] = new float[] { +DIST2, -DIST3, +DIST2};
200
    CENTERS[13] = new float[] { +DIST2, -DIST3, -DIST2};
201
    CENTERS[14] = new float[] { -DIST2, -DIST3, -DIST2};
202
    CENTERS[15] = new float[] { -DIST2, -DIST3, +DIST2};
203
    CENTERS[16] = new float[] { +DIST2, +DIST2, +DIST3};
204
    CENTERS[17] = new float[] { +DIST2, -DIST2, +DIST3};
205
    CENTERS[18] = new float[] { -DIST2, -DIST2, +DIST3};
206
    CENTERS[19] = new float[] { -DIST2, +DIST2, +DIST3};
207
    CENTERS[20] = new float[] { +DIST2, +DIST2, -DIST3};
208
    CENTERS[21] = new float[] { +DIST2, -DIST2, -DIST3};
209
    CENTERS[22] = new float[] { -DIST2, -DIST2, -DIST3};
210
    CENTERS[23] = new float[] { -DIST2, +DIST2, -DIST3};
211
212
    CENTERS[24] = new float[] { +DIST3, +0.00f, +0.00f};
213
    CENTERS[25] = new float[] { -DIST3, +0.00f, +0.00f};
214
    CENTERS[26] = new float[] { +0.00f, +DIST3, +0.00f};
215
    CENTERS[27] = new float[] { +0.00f, -DIST3, +0.00f};
216
    CENTERS[28] = new float[] { +0.00f, +0.00f, +DIST3};
217
    CENTERS[29] = new float[] { +0.00f, +0.00f, -DIST3};
218
219
    CENTERS[30] = new float[] { +0.00f, +DIST1, +DIST1};
220
    CENTERS[31] = new float[] { +DIST1, +0.00f, +DIST1};
221
    CENTERS[32] = new float[] { +0.00f, -DIST1, +DIST1};
222
    CENTERS[33] = new float[] { -DIST1, +0.00f, +DIST1};
223
    CENTERS[34] = new float[] { +DIST1, +DIST1, +0.00f};
224
    CENTERS[35] = new float[] { +DIST1, -DIST1, +0.00f};
225
    CENTERS[36] = new float[] { -DIST1, -DIST1, +0.00f};
226
    CENTERS[37] = new float[] { -DIST1, +DIST1, +0.00f};
227
    CENTERS[38] = new float[] { +0.00f, +DIST1, -DIST1};
228
    CENTERS[39] = new float[] { +DIST1, +0.00f, -DIST1};
229
    CENTERS[40] = new float[] { +0.00f, -DIST1, -DIST1};
230
    CENTERS[41] = new float[] { -DIST1, +0.00f, -DIST1};
231 59b87d56 Leszek Koltunski
232
    return CENTERS;
233
    }
234
235
///////////////////////////////////////////////////////////////////////////////////////////////////
236
237 a38fe4b2 Leszek Koltunski
  ObjectShape getObjectShape(int cubit, int numLayers)
238
    {
239
    int variant = getCubitVariant(cubit,numLayers);
240
241
    if( variant==0 )
242
      {
243
      float G = (1-REX_D)*SQ2/2;
244
245
      double[][] vertices =
246
         {
247
             {  -0.033333f, 0.23333f, 0.0f },
248
             {  -0.233333f, 0.03333f, 0.0f },
249
             {  +0.216666f,-0.23666f, 0.0f },
250
             {  +0.236666f,-0.21666f, 0.0f }
251
         };
252
253
      int[][] vertIndexes = { {0,1,2,3},{3,2,1,0} };
254
      float[][] centers= new float[][] { {0.0f,0.0f,-G/3} };
255
      float[][] corners= new float[][] { {0.03f,0.10f} };
256
      int[] indices= {-1,-1,0,0};
257
      int[] bandIndices= new int[] { 0,1 };
258
259
      float[][] bands =
260
        {
261
            {+0.016f,10,G/3,0.5f,5,1,1},
262
            {+0.230f,45,G/3,0.0f,2,0,0}
263
        };
264
      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
265
      }
266
    else if( variant==1 )
267
      {
268
      double[][] vertices =
269
        {
270
            { -REX_D,   0.0f, 0.0f },
271
            {   0.0f, -REX_D, 0.0f },
272
            { +REX_D,   0.0f, 0.0f },
273
            {   0.0f, +REX_D, 0.0f }
274
        };
275
276
      int[][] vertIndexes= { {0,1,2,3},{3,2,1,0} };
277
      int[] indices= {-1,-1,-1,-1};
278
      int[] bandIndices= new int[] { 0,1 };
279
280
      float[][] bands =
281
        {
282
            {0.025f,10,REX_D/2,0.5f,5,0,0},
283
            {0.000f,45,REX_D/2,0.0f,2,0,0}
284
        };
285
286
      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,null,indices,null,indices,getNumCubitFaces(), null);
287
      }
288
    else
289
      {
290
      float E = 0.5f - REX_D;
291
      float F = 0.5f;
292
      float G = (float)Math.sqrt(E*E+F*F);
293
294
      double[][] vertices =
295
         {
296
             { -F, 0, 0 },
297
             {  0,-E, 0 },
298
             { +F, 0, 0 },
299
             {  0, 0,-E },
300
         };
301
302
      int[][] vertIndexes = { {0,1,2}, {0,2,3}, {0,3,1}, {1,3,2} };
303
      float[][] centers= new float[][] { {0.0f,-0.5f,-0.5f} };
304
      float[][] corners= new float[][] { {0.06f,0.10f} };
305
      int[] indices= {0,-1,0,-1};
306
      int[] bandIndices= new int[] { 0,0,1,1 };
307
308
      float[][] bands =
309
        {
310
           {0.03f,27,F/3,0.8f,5,2,3},
311
           {0.01f,45,G/3,0.2f,3,1,2}
312
        };
313
314
      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
315
      }
316
    }
317
318
///////////////////////////////////////////////////////////////////////////////////////////////////
319
320 3e605536 Leszek Koltunski
  Static4D getQuat(int cubit, int numLayers)
321 59b87d56 Leszek Koltunski
    {
322 f242ba04 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
323
324 59b87d56 Leszek Koltunski
    switch(cubit)
325
      {
326 80ec6abf Leszek Koltunski
      case  0: return new Static4D(+SQ2/2,     0,+SQ2/2,     0);
327 f242ba04 Leszek Koltunski
      case  1: return mQuats[5];
328 80ec6abf Leszek Koltunski
      case  2: return new Static4D(     0,-SQ2/2,     0, SQ2/2);
329 f242ba04 Leszek Koltunski
      case  3: return mQuats[8];
330
      case  4: return mQuats[6];
331 80ec6abf Leszek Koltunski
      case  5: return new Static4D(-SQ2/2,     0,+SQ2/2,     0);
332 f242ba04 Leszek Koltunski
      case  6: return mQuats[11];
333 80ec6abf Leszek Koltunski
      case  7: return new Static4D(     0,+SQ2/2,     0, SQ2/2);
334
      case  8: return new Static4D(+SQ2/2,     0,     0, SQ2/2);
335 f242ba04 Leszek Koltunski
      case  9: return mQuats[10];
336 59b87d56 Leszek Koltunski
      case 10: return new Static4D(     0,+SQ2/2,+SQ2/2,     0);
337 f242ba04 Leszek Koltunski
      case 11: return mQuats[4];
338
      case 12: return mQuats[9];
339 59b87d56 Leszek Koltunski
      case 13: return new Static4D(-SQ2/2,     0,     0, SQ2/2);
340 f242ba04 Leszek Koltunski
      case 14: return mQuats[7];
341 59b87d56 Leszek Koltunski
      case 15: return new Static4D(     0,-SQ2/2,+SQ2/2,     0);
342
      case 16: return new Static4D(     0,     0,-SQ2/2, SQ2/2);
343 f242ba04 Leszek Koltunski
      case 17: return mQuats[0];
344 59b87d56 Leszek Koltunski
      case 18: return new Static4D(     0,     0,+SQ2/2, SQ2/2);
345 f242ba04 Leszek Koltunski
      case 19: return mQuats[3];
346
      case 20: return mQuats[1];
347 80ec6abf Leszek Koltunski
      case 21: return new Static4D(+SQ2/2,-SQ2/2,     0,     0);
348 f242ba04 Leszek Koltunski
      case 22: return mQuats[2];
349 80ec6abf Leszek Koltunski
      case 23: return new Static4D(+SQ2/2,+SQ2/2,     0,     0);
350 59b87d56 Leszek Koltunski
351 80ec6abf Leszek Koltunski
      case 24: return new Static4D(     0,-SQ2/2,     0, SQ2/2);
352
      case 25: return new Static4D(     0,+SQ2/2,     0, SQ2/2);
353 59b87d56 Leszek Koltunski
      case 26: return new Static4D(+SQ2/2,     0,     0, SQ2/2);
354
      case 27: return new Static4D(-SQ2/2,     0,     0, SQ2/2);
355 f242ba04 Leszek Koltunski
      case 28: return mQuats[0];
356
      case 29: return mQuats[1];
357 59b87d56 Leszek Koltunski
358 f242ba04 Leszek Koltunski
      case 30: return mQuats[0];
359 59b87d56 Leszek Koltunski
      case 31: return new Static4D(     0,     0,+SQ2/2, SQ2/2);
360 f242ba04 Leszek Koltunski
      case 32: return mQuats[3];
361 59b87d56 Leszek Koltunski
      case 33: return new Static4D(     0,     0,-SQ2/2, SQ2/2);
362 80ec6abf Leszek Koltunski
      case 34: return new Static4D(     0,-SQ2/2,     0, SQ2/2);
363 f242ba04 Leszek Koltunski
      case 35: return mQuats[7];
364
      case 36: return mQuats[9];
365 80ec6abf Leszek Koltunski
      case 37: return new Static4D(     0,+SQ2/2,     0, SQ2/2);
366 59b87d56 Leszek Koltunski
      case 38: return new Static4D(+SQ2/2,     0,     0, SQ2/2);
367 f242ba04 Leszek Koltunski
      case 39: return mQuats[8];
368
      case 40: return mQuats[1];
369
      case 41: return mQuats[6];
370 59b87d56 Leszek Koltunski
      }
371
372 f242ba04 Leszek Koltunski
    return mQuats[0];
373 59b87d56 Leszek Koltunski
    }
374
375
///////////////////////////////////////////////////////////////////////////////////////////////////
376
377 3e605536 Leszek Koltunski
  int getNumCubitVariants(int numLayers)
378 59b87d56 Leszek Koltunski
    {
379 a38fe4b2 Leszek Koltunski
    return 3;
380
    }
381 c75ab933 Leszek Koltunski
382 a38fe4b2 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
383 c75ab933 Leszek Koltunski
384 a38fe4b2 Leszek Koltunski
  int getCubitVariant(int cubit, int numLayers)
385
    {
386
    return cubit<24 ? 0 : (cubit<30?1:2);
387
    }
388 c75ab933 Leszek Koltunski
389 59b87d56 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
390
391
  int getFaceColor(int cubit, int cubitface, int numLayers)
392
    {
393 f242ba04 Leszek Koltunski
    if( mFaceMap==null )
394
      {
395
      mFaceMap = new int[][]
396
         {
397
           {  0, 18,18,18,18,18 },
398
           {  0, 18,18,18,18,18 },
399
           {  0, 18,18,18,18,18 },
400
           {  0, 18,18,18,18,18 },
401
           {  1, 18,18,18,18,18 },
402
           {  1, 18,18,18,18,18 },
403
           {  1, 18,18,18,18,18 },
404
           {  1, 18,18,18,18,18 },
405
           {  2, 18,18,18,18,18 },
406
           {  2, 18,18,18,18,18 },
407
           {  2, 18,18,18,18,18 },
408
           {  2, 18,18,18,18,18 },
409
           {  3, 18,18,18,18,18 },
410
           {  3, 18,18,18,18,18 },
411
           {  3, 18,18,18,18,18 },
412
           {  3, 18,18,18,18,18 },
413
           {  4, 18,18,18,18,18 },
414
           {  4, 18,18,18,18,18 },
415
           {  4, 18,18,18,18,18 },
416
           {  4, 18,18,18,18,18 },
417
           {  5, 18,18,18,18,18 },
418
           {  5, 18,18,18,18,18 },
419
           {  5, 18,18,18,18,18 },
420
           {  5, 18,18,18,18,18 },
421
422
           {  6, 18,18,18,18,18 },
423
           {  7, 18,18,18,18,18 },
424
           {  8, 18,18,18,18,18 },
425
           {  9, 18,18,18,18,18 },
426
           { 10, 18,18,18,18,18 },
427
           { 11, 18,18,18,18,18 },
428
429
           { 16,14, 18,18,18,18 },
430
           { 16,12, 18,18,18,18 },
431
           { 16,15, 18,18,18,18 },
432
           { 16,13, 18,18,18,18 },
433
           { 12,14, 18,18,18,18 },
434
           { 15,12, 18,18,18,18 },
435
           { 15,13, 18,18,18,18 },
436
           { 13,14, 18,18,18,18 },
437
           { 14,17, 18,18,18,18 },
438
           { 12,17, 18,18,18,18 },
439
           { 17,15, 18,18,18,18 },
440
           { 13,17, 18,18,18,18 },
441
         };
442
      }
443
444 59b87d56 Leszek Koltunski
    return mFaceMap[cubit][cubitface];
445
    }
446
447
///////////////////////////////////////////////////////////////////////////////////////////////////
448
449 9c06394a Leszek Koltunski
  int getColor(int face)
450 59b87d56 Leszek Koltunski
    {
451 9c06394a Leszek Koltunski
    return FACE_COLORS[face];
452
    }
453 29bc084f Leszek Koltunski
454 9c06394a Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
455 29bc084f Leszek Koltunski
456 9c06394a Leszek Koltunski
  ObjectSticker retSticker(int face)
457
    {
458 f242ba04 Leszek Koltunski
    if( mStickers==null )
459
      {
460
      float[][] STICKERS = new float[][]
461
          {
462
             { -0.5f, 0.1428f, -0.1428f, 0.5f, 0.35f, -0.35f },
463
             { -0.5f, 0.0f, 0.0f, -0.5f, 0.5f, 0.0f, 0.0f, 0.5f },
464
             { -0.525f, 0.105f, 0.525f, 0.105f, 0.000f, -0.210f  }
465
          };
466
467
      final float F = (float)(Math.PI/20);
468
      final float R1= 0.02f;
469
      final float R2= 0.09f;
470
      final float R3= 0.06f;
471
      final float[][] angles = { { -F/2,F,F },null,{ F/10,-F,-F } };
472
      final float[][] radii  = { {R1,R1,R1},{R2,R2,R2,R2},{0,0,R3} };
473
      final float[] strokes = { 0.06f, 0.07f, 0.05f };
474
475
      mStickers = new ObjectSticker[STICKERS.length];
476
477
      for(int s=0; s<STICKERS.length; s++)
478
        {
479
        mStickers[s] = new ObjectSticker(STICKERS[s],angles[s],radii[s],strokes[s]);
480
        }
481
      }
482
483 abf36986 Leszek Koltunski
    return mStickers[face/NUM_FACE_COLORS];
484 59b87d56 Leszek Koltunski
    }
485
486
///////////////////////////////////////////////////////////////////////////////////////////////////
487
488
  float returnMultiplier()
489
    {
490
    return 2.0f;
491
    }
492
493
///////////////////////////////////////////////////////////////////////////////////////////////////
494 e1dc3366 Leszek Koltunski
// PUBLIC API
495 59b87d56 Leszek Koltunski
496 e1dc3366 Leszek Koltunski
  public Static3D[] getRotationAxis()
497
    {
498
    return ROT_AXIS;
499
    }
500
501
///////////////////////////////////////////////////////////////////////////////////////////////////
502
503
  public int[] getBasicAngle()
504
    {
505 f242ba04 Leszek Koltunski
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
506
    return mBasicAngle;
507 e1dc3366 Leszek Koltunski
    }
508
509 59b87d56 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
510
511
  public int getObjectName(int numLayers)
512
    {
513
    return R.string.rex3;
514
    }
515
516
///////////////////////////////////////////////////////////////////////////////////////////////////
517
518
  public int getInventor(int numLayers)
519
    {
520
    return R.string.rex3_inventor;
521
    }
522
523
///////////////////////////////////////////////////////////////////////////////////////////////////
524
525
  public int getComplexity(int numLayers)
526
    {
527
    return 3;
528
    }
529
}