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 static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.COS54;
|
13
|
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.SIN54;
|
14
|
|
15
|
import org.distorted.library.type.Static3D;
|
16
|
import org.distorted.library.type.Static4D;
|
17
|
import org.distorted.library.helpers.QuatHelper;
|
18
|
|
19
|
import org.distorted.objectlib.helpers.FactoryCubit;
|
20
|
import org.distorted.objectlib.helpers.ObjectFaceShape;
|
21
|
import org.distorted.objectlib.metadata.Metadata;
|
22
|
import org.distorted.objectlib.helpers.ObjectVertexEffects;
|
23
|
import org.distorted.objectlib.main.InitAssets;
|
24
|
import org.distorted.objectlib.metadata.ListObjects;
|
25
|
import org.distorted.objectlib.helpers.ObjectShape;
|
26
|
|
27
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
28
|
|
29
|
public class TwistyKilominx extends TwistyDodecahedron
|
30
|
{
|
31
|
public TwistyKilominx(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
|
32
|
{
|
33
|
super(iconMode, quat, move, scale, meta, asset);
|
34
|
}
|
35
|
|
36
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
37
|
|
38
|
@Override
|
39
|
protected float[][][] getStickerRadii()
|
40
|
{
|
41
|
int[] numLayers = getNumLayers();
|
42
|
float R = 0.18f;
|
43
|
float L = 0.50f;
|
44
|
float[][] t1 = {{ R,L,R,R }};
|
45
|
float[][] t2 = {{ R,R,R,R }};
|
46
|
|
47
|
if( numLayers[0]==3 ) return new float[][][] { t1 };
|
48
|
else return new float[][][] { t2,t2,t2,t1 };
|
49
|
}
|
50
|
|
51
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
52
|
|
53
|
private int numCubitsPerCorner(int numLayers)
|
54
|
{
|
55
|
return 3*((numLayers-3)/2)*((numLayers-5)/2) + (numLayers<5 ? 0:1);
|
56
|
}
|
57
|
|
58
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
59
|
|
60
|
private int numCubitsPerEdge(int numLayers)
|
61
|
{
|
62
|
return numLayers<5 ? 0 : 2*(numLayers-4);
|
63
|
}
|
64
|
|
65
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
66
|
|
67
|
public float[][] getCuts(int[] numLayers)
|
68
|
{
|
69
|
return genericGetCuts(numLayers[0],0.5f);
|
70
|
}
|
71
|
|
72
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73
|
// Fill out mCurrCorner{X,Y,Z} by applying appropriate Quat to mBasicCorner{X,Y,Z}
|
74
|
// Appropriate one: QUATS[QUAT_INDICES[corner]].
|
75
|
|
76
|
private void computeBasicCornerVectors(int corner)
|
77
|
{
|
78
|
if( mQuatCornerIndices==null ) initializeQuatIndices();
|
79
|
if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
|
80
|
|
81
|
Static4D quat = mObjectQuats[mQuatCornerIndices[corner]];
|
82
|
|
83
|
mCurrCornerV[0] = QuatHelper.rotateVectorByQuat(mBasicCornerV[0],quat);
|
84
|
mCurrCornerV[1] = QuatHelper.rotateVectorByQuat(mBasicCornerV[1],quat);
|
85
|
mCurrCornerV[2] = QuatHelper.rotateVectorByQuat(mBasicCornerV[2],quat);
|
86
|
}
|
87
|
|
88
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
89
|
|
90
|
private float[] computeCorner(int numCubitsPerCorner, int numLayers, int corner, int part)
|
91
|
{
|
92
|
if( mCorners==null ) mCorners = initializeCorners();
|
93
|
if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
|
94
|
|
95
|
float D = numLayers/3.0f;
|
96
|
float[] corn = mCorners[corner];
|
97
|
|
98
|
if( part==0 )
|
99
|
{
|
100
|
return new float[] { corn[0]*D, corn[1]*D, corn[2]*D };
|
101
|
}
|
102
|
else
|
103
|
{
|
104
|
float E = D/(0.5f*(numLayers-1)); // ?? maybe 0.5*
|
105
|
int N = (numCubitsPerCorner-1)/3;
|
106
|
int block = (part-1) % N;
|
107
|
int index = (part-1) / N;
|
108
|
Static4D pri = mCurrCornerV[index];
|
109
|
Static4D sec = mCurrCornerV[(index+2)%3];
|
110
|
|
111
|
int layers= (numLayers-5)/2;
|
112
|
int multP = (block % layers) + 1;
|
113
|
int multS = (block / layers);
|
114
|
|
115
|
return new float[] {
|
116
|
corn[0]*D + (pri.get0()*multP + sec.get0()*multS)*E,
|
117
|
corn[1]*D + (pri.get1()*multP + sec.get1()*multS)*E,
|
118
|
corn[2]*D + (pri.get2()*multP + sec.get2()*multS)*E
|
119
|
};
|
120
|
}
|
121
|
}
|
122
|
|
123
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
124
|
|
125
|
private float[] computeCenter(int numLayers, int center, int part)
|
126
|
{
|
127
|
if( mCenterCoords==null ) initializeCenterCoords();
|
128
|
if( mCorners ==null ) mCorners = initializeCorners();
|
129
|
if( mCenterMap ==null ) mCenterMap = initializeCenterMap();
|
130
|
|
131
|
int corner = mCenterMap[center][part];
|
132
|
float[] cent = mCenterCoords[center];
|
133
|
float[] corn = mCorners[corner];
|
134
|
float D = numLayers/3.0f;
|
135
|
float F = 1.0f - (2.0f*numLayers-6.0f)/(numLayers-1)*COS54*COS54;
|
136
|
|
137
|
return new float[]
|
138
|
{
|
139
|
D * ( cent[0] + (corn[0]-cent[0])*F),
|
140
|
D * ( cent[1] + (corn[1]-cent[1])*F),
|
141
|
D * ( cent[2] + (corn[2]-cent[2])*F)
|
142
|
};
|
143
|
}
|
144
|
|
145
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
146
|
|
147
|
private int computeEdgeType(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
|
148
|
{
|
149
|
int part = (cubit - NUM_CORNERS*numCubitsPerCorner) % numCubitsPerEdge;
|
150
|
return part - 2*(part/4);
|
151
|
}
|
152
|
|
153
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
154
|
|
155
|
private float[] computeEdge(int numLayers, int edge, int part)
|
156
|
{
|
157
|
if( mCenterCoords==null ) initializeCenterCoords();
|
158
|
if( mCorners==null ) mCorners = initializeCorners();
|
159
|
if( mEdgeMap==null ) mEdgeMap = initializeEdgeMap();
|
160
|
|
161
|
float D = numLayers/3.0f;
|
162
|
float[] c1 = mCorners[ mEdgeMap[edge][0] ];
|
163
|
float[] c2 = mCorners[ mEdgeMap[edge][1] ];
|
164
|
|
165
|
int leftRight = 2*(part%2) -1;
|
166
|
part /= 2;
|
167
|
|
168
|
if( part==0 )
|
169
|
{
|
170
|
float T = 0.5f + leftRight/(numLayers-1.0f);
|
171
|
float x = D * (T*c1[0]+(1.0f-T)*c2[0]);
|
172
|
float y = D * (T*c1[1]+(1.0f-T)*c2[1]);
|
173
|
float z = D * (T*c1[2]+(1.0f-T)*c2[2]);
|
174
|
|
175
|
return new float[] { x, y, z };
|
176
|
}
|
177
|
else
|
178
|
{
|
179
|
int mult = (part+1)/2;
|
180
|
int dir = (part+1)%2;
|
181
|
float[] center = mCenterCoords[ mEdgeMap[edge][dir+2] ];
|
182
|
float x = 0.5f * D * (c1[0]+c2[0]);
|
183
|
float y = 0.5f * D * (c1[1]+c2[1]);
|
184
|
float z = 0.5f * D * (c1[2]+c2[2]);
|
185
|
|
186
|
float vX = D*center[0] - x;
|
187
|
float vY = D*center[1] - y;
|
188
|
float vZ = D*center[2] - z;
|
189
|
|
190
|
float T = 0.5f + leftRight*(mult*SIN18 + 1.0f)/(numLayers-1);
|
191
|
|
192
|
x = D * (T*c1[0]+(1.0f-T)*c2[0]);
|
193
|
y = D * (T*c1[1]+(1.0f-T)*c2[1]);
|
194
|
z = D * (T*c1[2]+(1.0f-T)*c2[2]);
|
195
|
|
196
|
float H = mult*D*COS18/(numLayers-1);
|
197
|
H /= (float)Math.sqrt(vX*vX+vY*vY+vZ*vZ);
|
198
|
|
199
|
return new float[] { x + H*vX, y + H*vY, z + H*vZ };
|
200
|
}
|
201
|
}
|
202
|
|
203
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
204
|
|
205
|
public float[][] getCubitPositions(int[] numLayers)
|
206
|
{
|
207
|
if( mCorners==null ) mCorners = initializeCorners();
|
208
|
|
209
|
int numL = numLayers[0];
|
210
|
if( numL<5 ) return mCorners;
|
211
|
|
212
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
213
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
214
|
int numCubitsPerCenter = 5;
|
215
|
int numCubits = NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge + NUM_CENTERS*numCubitsPerCenter;
|
216
|
int index=0;
|
217
|
|
218
|
final float[][] positions = new float[numCubits][];
|
219
|
|
220
|
for(int corner=0; corner<NUM_CORNERS; corner++)
|
221
|
{
|
222
|
computeBasicCornerVectors(corner);
|
223
|
|
224
|
for(int part=0; part<numCubitsPerCorner; part++, index++)
|
225
|
{
|
226
|
positions[index] = computeCorner(numCubitsPerCorner,numL,corner,part);
|
227
|
}
|
228
|
}
|
229
|
|
230
|
for(int edge=0; edge<NUM_EDGES; edge++)
|
231
|
{
|
232
|
for(int part=0; part<numCubitsPerEdge; part++, index++)
|
233
|
{
|
234
|
positions[index] = computeEdge(numL, edge, part );
|
235
|
}
|
236
|
}
|
237
|
|
238
|
for(int center=0; center<NUM_CENTERS; center++)
|
239
|
{
|
240
|
for(int part=0; part<numCubitsPerCenter; part++, index++)
|
241
|
{
|
242
|
positions[index] = computeCenter(numL,center, part);
|
243
|
}
|
244
|
}
|
245
|
|
246
|
return positions;
|
247
|
}
|
248
|
|
249
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
250
|
|
251
|
public Static4D getCubitQuats(int cubit, int[] numLayers)
|
252
|
{
|
253
|
int numL = numLayers[0];
|
254
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
255
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
256
|
int q = getQuat(cubit,numCubitsPerCorner,numCubitsPerEdge);
|
257
|
return mObjectQuats[q];
|
258
|
}
|
259
|
|
260
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
261
|
|
262
|
private int getQuat(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
|
263
|
{
|
264
|
if( mQuatCornerIndices==null || mQuatEdgeIndices==null ) initializeQuatIndices();
|
265
|
if( mCenterMap==null ) mCenterMap = initializeCenterMap();
|
266
|
|
267
|
if( cubit < NUM_CORNERS*numCubitsPerCorner )
|
268
|
{
|
269
|
int corner = cubit/numCubitsPerCorner;
|
270
|
return mQuatCornerIndices[corner];
|
271
|
}
|
272
|
|
273
|
if( cubit < NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
|
274
|
{
|
275
|
int edge = (cubit-NUM_CORNERS*numCubitsPerCorner)/numCubitsPerEdge;
|
276
|
return mQuatEdgeIndices[edge];
|
277
|
}
|
278
|
|
279
|
if( numCubitsPerCorner==0 )
|
280
|
{
|
281
|
return mQuatCornerIndices[cubit];
|
282
|
}
|
283
|
else
|
284
|
{
|
285
|
cubit -= (NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge);
|
286
|
int numCubitsPerCenter = 5;
|
287
|
int face = cubit/numCubitsPerCenter;
|
288
|
int index= cubit%numCubitsPerCenter;
|
289
|
int center=mCenterMap[face][index];
|
290
|
return mQuatCornerIndices[center];
|
291
|
}
|
292
|
}
|
293
|
|
294
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
295
|
|
296
|
private float[][] getVertices(int variant)
|
297
|
{
|
298
|
int[] numLayers = getNumLayers();
|
299
|
int numVariants = getNumCubitVariants(numLayers);
|
300
|
int numL = numLayers[0];
|
301
|
boolean small = numL<=3;
|
302
|
|
303
|
if( variant==0 && !small )
|
304
|
{
|
305
|
float width = numL/(numL-1.0f);
|
306
|
float X = width*COS18*SIN_HALFD;
|
307
|
float Y = width*SIN18;
|
308
|
float Z = width*COS18*COS_HALFD;
|
309
|
|
310
|
return new float[][]
|
311
|
{
|
312
|
{ 0, 0 , 0 },
|
313
|
{ X, Y , -Z },
|
314
|
{ 0, 2*Y ,-2*Z },
|
315
|
{ -X, Y , -Z },
|
316
|
{ 0, 0-width, 0 },
|
317
|
{ X, Y-width, -Z },
|
318
|
{ 0, 2*Y-width,-2*Z },
|
319
|
{ -X, Y-width, -Z },
|
320
|
};
|
321
|
}
|
322
|
else if( variant<numVariants-1 )
|
323
|
{
|
324
|
int type = variant-1;
|
325
|
float tmpVal= numL/(numL-1.0f);
|
326
|
float height= tmpVal*COS18;
|
327
|
float width = tmpVal + (type/2)*tmpVal*SIN18;
|
328
|
boolean left = (type%2)==0;
|
329
|
|
330
|
float X = height*SIN_HALFD;
|
331
|
float Y = height*SIN18/COS18;
|
332
|
float Z = height*COS_HALFD;
|
333
|
|
334
|
float[][] vertices =
|
335
|
{
|
336
|
{ 0, 0 , 0 },
|
337
|
{ X, Y , -Z },
|
338
|
{ 0, 2*Y ,-2*Z },
|
339
|
{ -X, Y , -Z },
|
340
|
{ 0, -width, 0 },
|
341
|
{ X, -width, -Z },
|
342
|
{ 0, -width,-2*Z },
|
343
|
{ -X, -width, -Z },
|
344
|
};
|
345
|
|
346
|
if( !left )
|
347
|
{
|
348
|
int len = vertices.length;
|
349
|
for(int i=0; i<len; i++) vertices[i][1] = -vertices[i][1];
|
350
|
}
|
351
|
return vertices;
|
352
|
}
|
353
|
else
|
354
|
{
|
355
|
float width = (1+0.5f*(numL-3)*SIN18)*numL/(numL-1);
|
356
|
float X = width*COS18*SIN_HALFD;
|
357
|
float Y = width*SIN18;
|
358
|
float Z = width*COS18*COS_HALFD;
|
359
|
float H = width*(SIN54/COS54);
|
360
|
float H3= H/COS_HALFD;
|
361
|
float X3= H*SIN_HALFD;
|
362
|
float Z3= H*COS_HALFD;
|
363
|
float C = 1/(COS54*(float)Math.sqrt(2-2*SIN18));
|
364
|
|
365
|
return new float[][]
|
366
|
{
|
367
|
{ 0, 0 , 0 },
|
368
|
{ X, Y , -Z },
|
369
|
{ 0,C*2*Y ,-2*C*Z },
|
370
|
{ -X, Y , -Z },
|
371
|
{ 0,-width, 0 },
|
372
|
{ X3,-width, -Z3 },
|
373
|
{ 0,-width, -H3 },
|
374
|
{ -X3,-width, -Z3 }
|
375
|
};
|
376
|
}
|
377
|
}
|
378
|
|
379
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
380
|
|
381
|
public ObjectShape getObjectShape(int variant)
|
382
|
{
|
383
|
int[] numLayers = getNumLayers();
|
384
|
int numVariants = getNumCubitVariants(numLayers);
|
385
|
int numL = numLayers[0];
|
386
|
|
387
|
int[][] indices =
|
388
|
{
|
389
|
{4,5,1,0},
|
390
|
{7,4,0,3},
|
391
|
{0,1,2,3},
|
392
|
{7,6,5,4},
|
393
|
{2,1,5,6},
|
394
|
{3,2,6,7}
|
395
|
};
|
396
|
|
397
|
if( (variant!=0 || numL<=3) && (variant<numVariants-1) && (variant%2)!=1 )
|
398
|
{
|
399
|
int tmp, len = indices.length;
|
400
|
|
401
|
for(int i=0; i<len; i++)
|
402
|
{
|
403
|
tmp = indices[i][0];
|
404
|
indices[i][0] = indices[i][3];
|
405
|
indices[i][3] = tmp;
|
406
|
tmp = indices[i][1];
|
407
|
indices[i][1] = indices[i][2];
|
408
|
indices[i][2] = tmp;
|
409
|
}
|
410
|
}
|
411
|
|
412
|
return new ObjectShape(getVertices(variant), indices);
|
413
|
}
|
414
|
|
415
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
416
|
|
417
|
public ObjectFaceShape getObjectFaceShape(int variant)
|
418
|
{
|
419
|
int[] numLayers = getNumLayers();
|
420
|
int numVariants = getNumCubitVariants(numLayers);
|
421
|
int numL = numLayers[0];
|
422
|
boolean small = numL<=3;
|
423
|
int angle = 25;
|
424
|
float R = 0.7f;
|
425
|
float S = 0.5f;
|
426
|
|
427
|
if( variant==0 && !small )
|
428
|
{
|
429
|
float h1 = isInIconMode() ? 0.001f : 0.04f;
|
430
|
float[][] bands = { {h1,angle,R,S,3,0,0}, {0.001f,angle,R,S,2,0,0} };
|
431
|
int[] indices = { 0,0,0,1,1,1};
|
432
|
return new ObjectFaceShape(bands,indices,null);
|
433
|
}
|
434
|
if( variant<numVariants-1 )
|
435
|
{
|
436
|
int E = small ? 1 : 0;
|
437
|
int N0 = small ? 4 : 3;
|
438
|
int N1 = small ? 3 : 2;
|
439
|
float h1 = isInIconMode() ? 0.001f : 0.04f;
|
440
|
|
441
|
float[][] bands = { {h1,angle,R,S,N0,E,E}, {0.001f,angle,R,S,N1,0,0} };
|
442
|
int[] indices = { 0,0,1,1,1,1};
|
443
|
|
444
|
return new ObjectFaceShape(bands,indices,null);
|
445
|
}
|
446
|
else
|
447
|
{
|
448
|
int N = small ? 4 : 3;
|
449
|
int E = small ? 1 : 0;
|
450
|
float h1 = isInIconMode() ? 0.001f : 0.04f;
|
451
|
float h2 = isInIconMode() ? 0.001f : 0.01f;
|
452
|
|
453
|
float[][] bands = { {h1,angle,R,S,N,E,E},{h2,angle,R,S,N,E,E} };
|
454
|
int[] indices = { 0,0,0,1,1,1};
|
455
|
|
456
|
return new ObjectFaceShape(bands,indices,null);
|
457
|
}
|
458
|
}
|
459
|
|
460
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
461
|
|
462
|
public ObjectVertexEffects getVertexEffects(int variant)
|
463
|
{
|
464
|
int[] numLayers = getNumLayers();
|
465
|
int numVariants = getNumCubitVariants(numLayers);
|
466
|
int numL = numLayers[0];
|
467
|
boolean small = numL<=3;
|
468
|
|
469
|
if( variant==0 && !small )
|
470
|
{
|
471
|
float A = (2*SQ3/3)*SIN54;
|
472
|
float B = 0.4f;
|
473
|
float[][] corners = { {0.06f,0.15f} };
|
474
|
int[] indices = { 0,-1,-1,-1,-1,-1,-1,-1 };
|
475
|
float[][] centers = { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
|
476
|
return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
|
477
|
}
|
478
|
if( variant<numVariants-1 )
|
479
|
{
|
480
|
int type = variant-1;
|
481
|
float tmpVal= numL/(numL-1.0f);
|
482
|
float height= tmpVal*COS18;
|
483
|
float width = tmpVal + (type/2)*tmpVal*SIN18;
|
484
|
float Z = height*COS_HALFD;
|
485
|
float[][] corners = { {0.02f,0.15f} };
|
486
|
int[] indices = { 0,-1,-1,-1, 0,-1,-1,-1 };
|
487
|
float[][] centers = { {0.0f, -width/2, -2*Z} };
|
488
|
return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
|
489
|
}
|
490
|
else
|
491
|
{
|
492
|
float A = (2*SQ3/3)*SIN54;
|
493
|
float B = 0.4f;
|
494
|
float[][] corners = { {0.10f,0.30f},{0.05f,0.15f} };
|
495
|
int[] cornerIndices = { 0, 1,-1, 1, 1,-1,-1,-1 };
|
496
|
float[][] centers = { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
|
497
|
int[] centerIndices = { 0, 0,-1, 0, 0,-1,-1,-1 };
|
498
|
return FactoryCubit.generateVertexEffect(getVertices(variant),corners,cornerIndices,centers,centerIndices);
|
499
|
}
|
500
|
}
|
501
|
|
502
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
503
|
|
504
|
public int getNumCubitVariants(int[] numLayers)
|
505
|
{
|
506
|
switch(numLayers[0])
|
507
|
{
|
508
|
case 3: return 1;
|
509
|
case 5: return 4;
|
510
|
}
|
511
|
|
512
|
return 1;
|
513
|
}
|
514
|
|
515
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
516
|
|
517
|
public int getCubitVariant(int cubit, int[] numLayers)
|
518
|
{
|
519
|
int numL = numLayers[0];
|
520
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
521
|
|
522
|
if( cubit<NUM_CORNERS*numCubitsPerCorner ) return 0;
|
523
|
|
524
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
525
|
|
526
|
if( cubit<NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
|
527
|
{
|
528
|
int type = computeEdgeType(cubit,numCubitsPerCorner,numCubitsPerEdge);
|
529
|
return type+1;
|
530
|
}
|
531
|
|
532
|
return getNumCubitVariants(numLayers)-1;
|
533
|
}
|
534
|
|
535
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
536
|
// we override getStickerRadii() anyway
|
537
|
|
538
|
public float getStickerRadius()
|
539
|
{
|
540
|
return 0.0f;
|
541
|
}
|
542
|
|
543
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
544
|
|
545
|
public float getStickerStroke()
|
546
|
{
|
547
|
float stroke = 0.25f;
|
548
|
|
549
|
if( isInIconMode() )
|
550
|
{
|
551
|
int[] numLayers = getNumLayers();
|
552
|
if( numLayers[0]>3 ) stroke*=1.5f;
|
553
|
}
|
554
|
|
555
|
return stroke;
|
556
|
}
|
557
|
|
558
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
559
|
|
560
|
public float[][][] getStickerAngles()
|
561
|
{
|
562
|
return null;
|
563
|
}
|
564
|
|
565
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
566
|
|
567
|
public String getShortName()
|
568
|
{
|
569
|
switch(getNumLayers()[0])
|
570
|
{
|
571
|
case 3: return ListObjects.KILO_3.name();
|
572
|
case 5: return ListObjects.KILO_5.name();
|
573
|
}
|
574
|
|
575
|
return ListObjects.KILO_3.name();
|
576
|
}
|
577
|
|
578
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
579
|
|
580
|
public String[][] getTutorials()
|
581
|
{
|
582
|
int[] numLayers = getNumLayers();
|
583
|
|
584
|
switch(numLayers[0])
|
585
|
{
|
586
|
case 3: return new String[][] {
|
587
|
{"gb","grgGgUSxiQg","How to Solve the Kilominx","Z3"},
|
588
|
{"es","g6WMYjkCLok","Resolver Kilominx","Cuby"},
|
589
|
{"ru","gjaknjuZXPs","Киломинкс как собрать","CUBES WORLD"},
|
590
|
{"fr","F7z6LztN-7A","Résoudre le Kilominx","Twins Cuber"},
|
591
|
{"de","fcmJdpLfZwk","Megaminx 2x2 lösen","JamesKnopf"},
|
592
|
{"pl","tdWh8f8qpq4","Kilominx TUTORIAL PL","MrUK"},
|
593
|
{"kr","8-X4GhQnE5I","2X2 킬로밍크스 TUTORIAL","큐브놀이터"},
|
594
|
{"vn","eW7RLayPPmA","Tutorial N.11 - Kilominx","Duy Thích Rubik"},
|
595
|
{"tw","iDueAHkim4g","二階五魔方進階解法","不正常魔術方塊研究中心"},
|
596
|
};
|
597
|
case 5: return new String[][] {
|
598
|
{"gb","VAnzC2SYVc4","How To Solve A Master Kilominx","Grizz Media"},
|
599
|
{"es","ozINTg-61Fs","Tutorial Master Kilominx","RubikArt"},
|
600
|
{"ru","0aemQayCZRc","Как собрать Мастер Киломинкс ч.1","Артем Мартиросов"},
|
601
|
{"ru","ohOUFTx-oQI","Как собрать Мастер Киломинкс ч.2","Артем Мартиросов"},
|
602
|
{"ru","YRXRdT2jCn8","Как собрать Мастер Киломинкс ч.3","Артем Мартиросов"},
|
603
|
{"fr","usMiWt44aqo","Résolution du Master Kilominx","Asthalis"},
|
604
|
{"pl","rdln0IG86_s","Master Kilominx TUTORIAL PL","MrUK"},
|
605
|
{"br","0nmaZf2-44M","Como resolver o Master Kilominx 1/3","Rafael Cinoto"},
|
606
|
{"br","SkR6RybAKHc","Como resolver o Master Kilominx 2/3","Rafael Cinoto"},
|
607
|
{"br","5C7J7Cb4a7Q","Como resolver o Master Kilominx 3/3","Rafael Cinoto"},
|
608
|
{"kr","dvy-GxCjm5c","마스터 킬로밍크스 배우기 1","vincentcube"},
|
609
|
{"kr","Jm0B12vNxsE","마스터 킬로밍크스 배우기 2","vincentcube"},
|
610
|
{"kr","H1I18FVpr6g","마스터 킬로밍크스 배우기 3","vincentcube"},
|
611
|
{"tw","nVrtIVu_avo","四階五魔方 教學","不正常魔術方塊研究中心"},
|
612
|
};
|
613
|
}
|
614
|
return null;
|
615
|
}
|
616
|
}
|