Project

General

Profile

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

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

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