Project

General

Profile

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

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

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