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