Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / TwistyRex.java @ 6cf89a3e

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