Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / TwistyRex.java @ 588ace55

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