1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2020 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.objectlib.objects;
|
11
|
|
12
|
import org.distorted.library.type.Static3D;
|
13
|
import org.distorted.library.type.Static4D;
|
14
|
import org.distorted.objectlib.helpers.FactoryCubit;
|
15
|
import org.distorted.objectlib.helpers.ObjectFaceShape;
|
16
|
import org.distorted.objectlib.helpers.ObjectShape;
|
17
|
import org.distorted.objectlib.metadata.Metadata;
|
18
|
import org.distorted.objectlib.helpers.ObjectVertexEffects;
|
19
|
import org.distorted.objectlib.main.InitAssets;
|
20
|
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
|
21
|
import org.distorted.objectlib.metadata.ListObjects;
|
22
|
import org.distorted.objectlib.shape.ShapeOctahedron;
|
23
|
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
|
24
|
|
25
|
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_OCTAHEDRON;
|
26
|
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
|
27
|
|
28
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
29
|
|
30
|
public class TwistyTrajber extends ShapeOctahedron
|
31
|
{
|
32
|
// Trajber 3x3: each cut is at 1/5 of the length of the segment from the center to a vertex.
|
33
|
private static final float CUT3 = 0.20f;
|
34
|
// Trajber 4x4: each cut is at 0.27 of the length of the segment from the center to a vertex.
|
35
|
private static final float CUT4 = 0.27f;
|
36
|
|
37
|
static final Static3D[] ROT_AXIS = new Static3D[]
|
38
|
{
|
39
|
new Static3D(SQ2/2, 0, SQ2/2),
|
40
|
new Static3D( 0, 1, 0),
|
41
|
new Static3D(SQ2/2, 0,-SQ2/2)
|
42
|
};
|
43
|
|
44
|
private int[][] mEdges;
|
45
|
private int[][] mBasicAngle;
|
46
|
private float[][] mCuts;
|
47
|
private float[][] mPositions;
|
48
|
private int[] mQuatIndex;
|
49
|
|
50
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
51
|
|
52
|
public TwistyTrajber(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
|
53
|
{
|
54
|
super(iconMode, meta.getNumLayers()[0], quat, move, scale, meta, asset);
|
55
|
}
|
56
|
|
57
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58
|
|
59
|
@Override
|
60
|
public float[][] returnRotationFactor()
|
61
|
{
|
62
|
int numL = getNumLayers()[0];
|
63
|
float[] f = new float[numL];
|
64
|
for(int i=0; i<numL; i++) f[i] = 1.4f;
|
65
|
return new float[][] { f,f,f };
|
66
|
}
|
67
|
|
68
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
69
|
|
70
|
public int[][] getScrambleEdges()
|
71
|
{
|
72
|
if( mEdges==null )
|
73
|
{
|
74
|
int n = getNumLayers()[0];
|
75
|
mEdges = ScrambleEdgeGenerator.getScrambleEdgesCuboid(n,n,n);
|
76
|
}
|
77
|
return mEdges;
|
78
|
}
|
79
|
|
80
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
81
|
|
82
|
public float[][] getCuts(int[] numLayers)
|
83
|
{
|
84
|
if( mCuts==null )
|
85
|
{
|
86
|
float[] tmp;
|
87
|
|
88
|
if( numLayers[0]==3 )
|
89
|
{
|
90
|
final float cut= CUT3*numLayers[0]*SQ2/2;
|
91
|
tmp = new float[] {-cut,+cut};
|
92
|
}
|
93
|
else
|
94
|
{
|
95
|
final float cut= CUT4*numLayers[0]*SQ2/2;
|
96
|
tmp = new float[] {-cut,0,+cut};
|
97
|
}
|
98
|
|
99
|
mCuts = new float[][] { tmp,tmp,tmp };
|
100
|
}
|
101
|
|
102
|
return mCuts;
|
103
|
}
|
104
|
|
105
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
106
|
|
107
|
public boolean[][] getLayerRotatable(int[] numLayers)
|
108
|
{
|
109
|
int numL = numLayers[0];
|
110
|
boolean[] tmp = new boolean[numL];
|
111
|
for(int i=0; i<numL; i++) tmp[i] = true;
|
112
|
return new boolean[][] { tmp,tmp,tmp };
|
113
|
}
|
114
|
|
115
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
116
|
|
117
|
public int getTouchControlType()
|
118
|
{
|
119
|
return TC_OCTAHEDRON;
|
120
|
}
|
121
|
|
122
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
123
|
|
124
|
public int getTouchControlSplit()
|
125
|
{
|
126
|
return TYPE_NOT_SPLIT;
|
127
|
}
|
128
|
|
129
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
130
|
|
131
|
public int[][][] getEnabled()
|
132
|
{
|
133
|
int[][] e = {{0,1,2}};
|
134
|
return new int[][][] {e,e,e,e,e,e,e,e};
|
135
|
}
|
136
|
|
137
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
138
|
|
139
|
public float[] getDist3D(int[] numLayers)
|
140
|
{
|
141
|
return TouchControlOctahedron.D3D;
|
142
|
}
|
143
|
|
144
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
145
|
|
146
|
public Static3D[] getFaceAxis()
|
147
|
{
|
148
|
return TouchControlOctahedron.FACE_AXIS;
|
149
|
}
|
150
|
|
151
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
152
|
|
153
|
public float[][] getCubitPositions(int[] numLayers)
|
154
|
{
|
155
|
if( mPositions==null )
|
156
|
{
|
157
|
int numL = numLayers[0];
|
158
|
float LEN = numL*0.5f;
|
159
|
|
160
|
if( numL==3 )
|
161
|
{
|
162
|
mPositions = new float[][]
|
163
|
{
|
164
|
{ -LEN, 0, LEN},
|
165
|
{ LEN, 0, -LEN},
|
166
|
{ LEN, 0, LEN},
|
167
|
{ -LEN, 0, -LEN},
|
168
|
{ 0, SQ2*LEN, 0},
|
169
|
{ 0,-SQ2*LEN, 0},
|
170
|
|
171
|
{ 0, 0, LEN},
|
172
|
{ LEN, 0, 0},
|
173
|
{ -LEN, 0, 0},
|
174
|
{ 0, 0, -LEN},
|
175
|
{-LEN/2, (SQ2/2)*LEN, LEN/2},
|
176
|
{ LEN/2, (SQ2/2)*LEN,-LEN/2},
|
177
|
{-LEN/2,-(SQ2/2)*LEN, LEN/2},
|
178
|
{ LEN/2,-(SQ2/2)*LEN,-LEN/2},
|
179
|
{ LEN/2, (SQ2/2)*LEN, LEN/2},
|
180
|
{ LEN/2,-(SQ2/2)*LEN, LEN/2},
|
181
|
{-LEN/2, (SQ2/2)*LEN,-LEN/2},
|
182
|
{-LEN/2,-(SQ2/2)*LEN,-LEN/2},
|
183
|
|
184
|
{ 0, SQ2*LEN/3, 2*LEN/3},
|
185
|
{ 2*LEN/3, SQ2*LEN/3, 0},
|
186
|
{ 0,-SQ2*LEN/3, 2*LEN/3},
|
187
|
{ 2*LEN/3,-SQ2*LEN/3, 0},
|
188
|
{-2*LEN/3, SQ2*LEN/3, 0},
|
189
|
{ 0, SQ2*LEN/3,-2*LEN/3},
|
190
|
{-2*LEN/3,-SQ2*LEN/3, 0},
|
191
|
{ 0,-SQ2*LEN/3,-2*LEN/3},
|
192
|
};
|
193
|
}
|
194
|
else
|
195
|
{
|
196
|
final float A = 0.5f*SQ2*CUT4*LEN;
|
197
|
final float B = CUT4*LEN;
|
198
|
final float C = CUT4/2;
|
199
|
final float D =-1.5f*C+0.5f;
|
200
|
final float E = 0.5f*C+0.5f;
|
201
|
final float F = (SQ2/2)*(1-C);
|
202
|
final float G = C*SQ2;
|
203
|
final float H = 1-C;
|
204
|
final float I = LEN-0.5f*B;
|
205
|
final float J = SQ2*(LEN-B);
|
206
|
|
207
|
mPositions = new float[][]
|
208
|
{
|
209
|
{ -I+B, A, I },
|
210
|
{ -I+B, -A, I },
|
211
|
{ I , A, -I+B },
|
212
|
{ I , -A, -I+B },
|
213
|
{ I-B, -A, -I },
|
214
|
{ I-B, A, -I },
|
215
|
{ I , A, I-B },
|
216
|
{ I , -A, I-B },
|
217
|
{ I-B, -A, I },
|
218
|
{ I-B, A, I },
|
219
|
{ -I , -A, -I+B },
|
220
|
{ -I , A, -I+B },
|
221
|
{ -I+B, A, -I },
|
222
|
{ -I+B, -A, -I },
|
223
|
{ B, J, 0 },
|
224
|
{ -B, J, 0 },
|
225
|
{ 0, J, B },
|
226
|
{ 0, J, -B },
|
227
|
{ B, -J, 0 },
|
228
|
{ -B, -J, 0 },
|
229
|
{ 0, -J, B },
|
230
|
{ 0, -J, -B },
|
231
|
{ -I , -A, I-B },
|
232
|
{ -I , A, I-B },
|
233
|
|
234
|
{ 0, G*LEN, H*LEN},
|
235
|
{ 0,-G*LEN, H*LEN},
|
236
|
{ H*LEN, G*LEN, 0},
|
237
|
{ H*LEN,-G*LEN, 0},
|
238
|
{-H*LEN, G*LEN, 0},
|
239
|
{-H*LEN,-G*LEN, 0},
|
240
|
{ 0, G*LEN,-H*LEN},
|
241
|
{ 0,-G*LEN,-H*LEN},
|
242
|
|
243
|
{-D*LEN, F*LEN, E*LEN },
|
244
|
{-E*LEN, F*LEN, D*LEN },
|
245
|
{ E*LEN, F*LEN,-D*LEN},
|
246
|
{ D*LEN, F*LEN,-E*LEN},
|
247
|
{-D*LEN,-F*LEN, E*LEN },
|
248
|
{-E*LEN,-F*LEN, D*LEN },
|
249
|
{ E*LEN,-F*LEN,-D*LEN},
|
250
|
{ D*LEN,-F*LEN,-E*LEN},
|
251
|
|
252
|
{ D*LEN, F*LEN, E*LEN},
|
253
|
{ E*LEN, F*LEN, D*LEN},
|
254
|
{ D*LEN,-F*LEN, E*LEN},
|
255
|
{ E*LEN,-F*LEN, D*LEN},
|
256
|
{-D*LEN, F*LEN,-E*LEN},
|
257
|
{-E*LEN, F*LEN,-D*LEN},
|
258
|
{-D*LEN,-F*LEN,-E*LEN},
|
259
|
{-E*LEN,-F*LEN,-D*LEN},
|
260
|
|
261
|
{ 0, SQ2*LEN/3, 2*LEN/3},
|
262
|
{ 2*LEN/3, SQ2*LEN/3, 0},
|
263
|
{ 0,-SQ2*LEN/3, 2*LEN/3},
|
264
|
{ 2*LEN/3,-SQ2*LEN/3, 0},
|
265
|
{-2*LEN/3, SQ2*LEN/3, 0},
|
266
|
{ 0, SQ2*LEN/3,-2*LEN/3},
|
267
|
{-2*LEN/3,-SQ2*LEN/3, 0},
|
268
|
{ 0,-SQ2*LEN/3,-2*LEN/3},
|
269
|
};
|
270
|
}
|
271
|
}
|
272
|
|
273
|
return mPositions;
|
274
|
}
|
275
|
|
276
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
277
|
|
278
|
public Static4D getCubitQuats(int cubit, int[] numLayers)
|
279
|
{
|
280
|
if( mQuatIndex==null )
|
281
|
{
|
282
|
if( numLayers[0]==3 )
|
283
|
{
|
284
|
mQuatIndex = new int[] { 0, 2, 6, 4, 1, 3,
|
285
|
0, 2, 8, 5, 7,19, 9,18, 1, 3,14,11,
|
286
|
0, 1, 3, 2, 7, 5, 8,16 };
|
287
|
}
|
288
|
else
|
289
|
{
|
290
|
mQuatIndex = new int[] { 0, 9,19, 2,18, 5, 6,12,17,21,20, 4,10,16, 1,14,15,13,23,22, 3,11, 8, 7,
|
291
|
0,17, 6, 2, 4, 8, 5,16,15, 7,19,13, 9,22,23,18,21, 1, 3,12,10,14,11,20,
|
292
|
0, 1, 3, 2, 7, 5, 8,16 };
|
293
|
}
|
294
|
}
|
295
|
|
296
|
return mObjectQuats[mQuatIndex[cubit]];
|
297
|
}
|
298
|
|
299
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
300
|
|
301
|
private float[][] getVertices(int variant)
|
302
|
{
|
303
|
float numL = getNumLayers()[0];
|
304
|
final float LEN = numL*0.5f;
|
305
|
final float CUT = numL==3 ? CUT3 : CUT4;
|
306
|
|
307
|
if( variant==0 )
|
308
|
{
|
309
|
final float A = SQ2*CUT*LEN;
|
310
|
final float B = CUT*LEN;
|
311
|
|
312
|
if( numL==3 )
|
313
|
{
|
314
|
return new float[][]
|
315
|
{
|
316
|
{ 0, 0, 0},
|
317
|
{ B, A, -B},
|
318
|
{ B, -A, -B},
|
319
|
{ 2*B, 0, 0},
|
320
|
{ 0, 0, -2*B},
|
321
|
{ 3*B, A, -B},
|
322
|
{ 3*B, -A, -B},
|
323
|
{ B, A, -3*B},
|
324
|
{ B, -A, -3*B},
|
325
|
|
326
|
{ LEN , A, 2*B-LEN},
|
327
|
{ LEN , -A, 2*B-LEN},
|
328
|
{ LEN-2*B, A, -LEN},
|
329
|
{ LEN-2*B, -A, -LEN},
|
330
|
};
|
331
|
}
|
332
|
else
|
333
|
{
|
334
|
return new float[][]
|
335
|
{
|
336
|
{ -1.5f*B, -0.5f*A, 0.5f*B},
|
337
|
{ -0.5f*B, 0.5f*A, -0.5f*B},
|
338
|
{ 0.5f*B, -0.5f*A, 0.5f*B},
|
339
|
{ 1.5f*B, 0.5f*A, -0.5f*B},
|
340
|
|
341
|
{ LEN-1.5f*B, 0.5f*A, 2.5f*B-LEN},
|
342
|
{ LEN-2.5f*B, 0.5f*A, 1.5f*B-LEN},
|
343
|
{ LEN-2.5f*B, -0.5f*A, 1.5f*B-LEN},
|
344
|
{ LEN-1.5f*B, -0.5f*A, 2.5f*B-LEN},
|
345
|
};
|
346
|
}
|
347
|
}
|
348
|
else if( variant==1 )
|
349
|
{
|
350
|
final float A = SQ2*CUT*LEN;
|
351
|
final float B = LEN*(1-2*CUT);
|
352
|
final float C = 0.9f*(SQ2/2)*A;
|
353
|
|
354
|
if( numL==3 )
|
355
|
{
|
356
|
return new float[][]
|
357
|
{
|
358
|
{ -B, 0, 0 },
|
359
|
{ -B+C, A, -C },
|
360
|
{ -B+C,-A, -C },
|
361
|
{ B, 0, 0 },
|
362
|
{ B-C, A, -C },
|
363
|
{ B-C,-A, -C },
|
364
|
{ 0, A, -B },
|
365
|
{ 0,-A, -B },
|
366
|
};
|
367
|
}
|
368
|
else
|
369
|
{
|
370
|
return new float[][]
|
371
|
{
|
372
|
{ -B, -0.5f*A, C/2 },
|
373
|
{ -B+C, 0.5f*A, -C/2 },
|
374
|
{ B, -0.5f*A, C/2 },
|
375
|
{ B-C, 0.5f*A, -C/2 },
|
376
|
{ 0, 0.5f*A, -B+C/2 },
|
377
|
{ 0, -0.5f*A, -B+C/2 }
|
378
|
};
|
379
|
}
|
380
|
}
|
381
|
else
|
382
|
{
|
383
|
final float L = LEN*(1-3*CUT);
|
384
|
|
385
|
return new float[][]
|
386
|
{
|
387
|
{ -L, -(SQ2/3)*L, L/3 },
|
388
|
{ L, -(SQ2/3)*L, L/3 },
|
389
|
{ 0,(2*SQ2/3)*L,-2*L/3 },
|
390
|
{ 0, -(SQ2/3)*L,-2*L/3 },
|
391
|
};
|
392
|
}
|
393
|
}
|
394
|
|
395
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
396
|
|
397
|
public ObjectShape getObjectShape(int variant)
|
398
|
{
|
399
|
float numL = getNumLayers()[0];
|
400
|
|
401
|
if( variant==0 )
|
402
|
{
|
403
|
int[][] indices = numL==3 ?
|
404
|
|
405
|
new int[][]
|
406
|
{
|
407
|
{0,3,5,1},
|
408
|
{0,2,6,3},
|
409
|
{0,4,8,2},
|
410
|
{0,1,7,4},
|
411
|
{3,6,10,9,5},
|
412
|
{2,8,12,10,6},
|
413
|
{4,7,11,12,8},
|
414
|
{1,5,9,11,7},
|
415
|
{9,10,12,11}
|
416
|
}
|
417
|
:
|
418
|
new int[][]
|
419
|
{
|
420
|
{0,2,3,1},
|
421
|
{2,7,4,3},
|
422
|
{3,4,5,1},
|
423
|
{0,1,5,6},
|
424
|
{0,6,7,2},
|
425
|
{7,6,5,4}
|
426
|
};
|
427
|
|
428
|
return new ObjectShape(getVertices(variant), indices);
|
429
|
}
|
430
|
if( variant==1 )
|
431
|
{
|
432
|
int[][] indices = numL==3 ?
|
433
|
|
434
|
new int[][]
|
435
|
{
|
436
|
{0,3,4,1},
|
437
|
{0,2,5,3},
|
438
|
{1,4,6},
|
439
|
{2,7,5},
|
440
|
{0,1,6,7,2},
|
441
|
{3,5,7,6,4}
|
442
|
}
|
443
|
:
|
444
|
new int[][]
|
445
|
{
|
446
|
{0,2,3,1},
|
447
|
{1,3,4},
|
448
|
{0,5,2},
|
449
|
{0,1,4,5},
|
450
|
{2,5,4,3}
|
451
|
};
|
452
|
|
453
|
return new ObjectShape(getVertices(variant), indices);
|
454
|
}
|
455
|
else
|
456
|
{
|
457
|
int[][] indices =
|
458
|
{
|
459
|
{0,1,2},
|
460
|
{3,1,0},
|
461
|
{0,2,3},
|
462
|
{1,3,2},
|
463
|
};
|
464
|
|
465
|
return new ObjectShape(getVertices(variant), indices);
|
466
|
}
|
467
|
}
|
468
|
|
469
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
470
|
|
471
|
public ObjectFaceShape getObjectFaceShape(int variant)
|
472
|
{
|
473
|
int numL = getNumLayers()[0];
|
474
|
int angle1 = 30;
|
475
|
int angle2 = 25;
|
476
|
float R = 0.8f;
|
477
|
float S = 0.2f;
|
478
|
|
479
|
if( variant==0 )
|
480
|
{
|
481
|
float height = isInIconMode() ? 0.001f : 0.05f;
|
482
|
float[][] bands = { {height,angle1,R,S,4,1,1},{0.001f,angle1,R,S,4,1,1} };
|
483
|
int[] indices = numL==3 ? new int[] { 0,0,0,0,1,1,1,1,1 } : new int[] { 0,1,1,1,1,1 };
|
484
|
return new ObjectFaceShape(bands,indices,null);
|
485
|
}
|
486
|
if( variant==1 )
|
487
|
{
|
488
|
float height = isInIconMode() ? 0.001f : 0.03f;
|
489
|
float[][] bands = { {height,angle2,R,S,3,1,1},{0.001f,angle2,R,S,3,1,1} };
|
490
|
int[] indices = numL==3 ? new int[] { 0,0,1,1,1,1 } : new int[] { 0,1,1,1,1 };
|
491
|
return new ObjectFaceShape(bands,indices,null);
|
492
|
}
|
493
|
else
|
494
|
{
|
495
|
float height = isInIconMode() ? 0.001f : 0.03f;
|
496
|
float[][] bands = { {height,angle1,R,S,4,1,1},{0.001f,angle1,R,S,4,0,0} };
|
497
|
int[] indices = { 0,1,1,1 };
|
498
|
return new ObjectFaceShape(bands,indices,null);
|
499
|
}
|
500
|
}
|
501
|
|
502
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
503
|
|
504
|
public ObjectVertexEffects getVertexEffects(int variant)
|
505
|
{
|
506
|
int numL = getNumLayers()[0];
|
507
|
final float LEN = numL*0.5f;
|
508
|
final float CUT = numL==3 ? CUT3 : CUT4;
|
509
|
|
510
|
if( variant==0 )
|
511
|
{
|
512
|
float[][] vertices= getVertices(variant);
|
513
|
float[][] corners = { {0.03f,0.10f} };
|
514
|
float[][] centers = { { LEN/2, 0.0f, -LEN/2} };
|
515
|
int[] indices = numL==3 ? new int[] { 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 } : new int[] { 0,0,0,-1,-1,-1,-1,-1 };
|
516
|
return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
|
517
|
}
|
518
|
if( variant==1 )
|
519
|
{
|
520
|
float[][] vertices= getVertices(variant);
|
521
|
final float B = LEN*(1-2*CUT);
|
522
|
float[][] corners = { {0.02f,0.10f} };
|
523
|
float[][] centers = { { 0, 0, -B} };
|
524
|
int[] indices = numL==3 ? new int[] { 0,0,0,0,0,0,-1,-1 } : new int[] { 0,0,0,0,-1,-1 };
|
525
|
return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
|
526
|
}
|
527
|
else
|
528
|
{
|
529
|
float[][] vertices= getVertices(variant);
|
530
|
final float L = LEN*(1-3*CUT);
|
531
|
float[][] corners = { {0.02f,0.10f} };
|
532
|
float[][] centers = { {0, -(SQ2/3)*L,-2*L/3} };
|
533
|
int[] indices = { 0,0,0,-1 };
|
534
|
return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
|
535
|
}
|
536
|
}
|
537
|
|
538
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
539
|
|
540
|
public int getNumCubitVariants(int[] numLayers)
|
541
|
{
|
542
|
return 3;
|
543
|
}
|
544
|
|
545
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
546
|
|
547
|
public int getCubitVariant(int cubit, int[] numLayers)
|
548
|
{
|
549
|
if( numLayers[0]==3 ) return cubit< 6 ? 0 : cubit<18 ? 1 : 2;
|
550
|
else return cubit<24 ? 0 : cubit<48 ? 1 : 2;
|
551
|
}
|
552
|
|
553
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
554
|
|
555
|
public float getStickerRadius()
|
556
|
{
|
557
|
return 0.12f;
|
558
|
}
|
559
|
|
560
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
561
|
|
562
|
public float getStickerStroke()
|
563
|
{
|
564
|
return isInIconMode() ? 0.20f : 0.10f;
|
565
|
}
|
566
|
|
567
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
568
|
|
569
|
public float[][][] getStickerAngles()
|
570
|
{
|
571
|
return null;
|
572
|
}
|
573
|
|
574
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
575
|
// PUBLIC API
|
576
|
|
577
|
public Static3D[] getRotationAxis()
|
578
|
{
|
579
|
return ROT_AXIS;
|
580
|
}
|
581
|
|
582
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
583
|
|
584
|
public int[][] getBasicAngles()
|
585
|
{
|
586
|
if( mBasicAngle ==null )
|
587
|
{
|
588
|
int num = getNumLayers()[0];
|
589
|
int[] tmp = new int[num];
|
590
|
for(int i=0; i<num; i++) tmp[i] = 4;
|
591
|
mBasicAngle = new int[][] { tmp,tmp,tmp };
|
592
|
}
|
593
|
|
594
|
return mBasicAngle;
|
595
|
}
|
596
|
|
597
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
598
|
|
599
|
public String getShortName()
|
600
|
{
|
601
|
int[] numLayers = getNumLayers();
|
602
|
return numLayers[0]==3 ? ListObjects.TRAJ_3.name() : ListObjects.TRAJ_4.name();
|
603
|
}
|
604
|
|
605
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
606
|
|
607
|
public String[][] getTutorials()
|
608
|
{
|
609
|
int[] numLayers = getNumLayers();
|
610
|
|
611
|
switch(numLayers[0])
|
612
|
{
|
613
|
case 3: return new String[][] {
|
614
|
{"gb","Q2NSiuJWVvk","Trajber and UFO Tutorial","SuperAntoniovivaldi"},
|
615
|
{"es","FPBirEJ8ZfY","Resolver Octaedro 3x3","Solución Rubik"},
|
616
|
{"de","FjQXlwJGniQ","Trajbers Octahedron Tutorial","GerCubing"},
|
617
|
{"br","kO3nMpZKv3Q","Resolver Octaedro Trajber","Rafael Cinoto"},
|
618
|
};
|
619
|
case 4: return new String[][] {
|
620
|
{"gb","FZlw68I7snM","4x4 Trajber's Tutorial (1/2)","SuperAntoniovivaldi"},
|
621
|
{"gb","VM0XFu7gAII","4x4 Trajber's Tutorial (2/2)","SuperAntoniovivaldi"},
|
622
|
{"es","Q8ljV-feLpU","Tutorial Octaedro 4x4 (1/2)","Dany Cuber"},
|
623
|
{"es","QyWpDLa1eZQ","Tutorial Octaedro 4x4 (2/2)","Dany Cuber"},
|
624
|
{"ru","ikUogVow-58","Как собрать Октаэдр 4х4","RBcuber"},
|
625
|
{"fr","4hxZyMVGiTA","Résolution de l'Octaèdre 4x4","asthalis"},
|
626
|
{"pl","oPBvAT9lwt4","Octahedron 4x4 TUTORIAL PL","MrUK"},
|
627
|
{"br","0ZgaoQ6IS2w","Resolver o octaedro Trajber 4x4 (1/3)","Rafael Cinoto"},
|
628
|
{"br","TjxTx3IJy6M","Resolver o octaedro Trajber 4x4 (2/3)","Rafael Cinoto"},
|
629
|
{"br","E8k2TXfUS8g","Resolver o octaedro Trajber 4x4 (3/3)","Rafael Cinoto"},
|
630
|
{"vn","yorULpIm6Yw","Tutorial N.22 - Octahedron 4x4","Duy Thích Rubik"},
|
631
|
};
|
632
|
}
|
633
|
|
634
|
return null;
|
635
|
}
|
636
|
}
|