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.touchcontrol.TouchControlDodecahedron.COS54;
|
23
|
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.SIN54;
|
24
|
|
25
|
import java.io.InputStream;
|
26
|
|
27
|
import org.distorted.library.type.Static3D;
|
28
|
import org.distorted.library.type.Static4D;
|
29
|
import org.distorted.library.main.QuatHelper;
|
30
|
|
31
|
import org.distorted.objectlib.helpers.ObjectFaceShape;
|
32
|
import org.distorted.objectlib.main.ObjectControl;
|
33
|
import org.distorted.objectlib.main.ObjectType;
|
34
|
import org.distorted.objectlib.helpers.ObjectShape;
|
35
|
|
36
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
37
|
|
38
|
public class TwistyKilominx extends TwistyMinx
|
39
|
{
|
40
|
public TwistyKilominx(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream)
|
41
|
{
|
42
|
super(numL, meshState, quat, move, scale, stream);
|
43
|
}
|
44
|
|
45
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
46
|
|
47
|
private int numCubitsPerCorner(int numLayers)
|
48
|
{
|
49
|
return 3*((numLayers-3)/2)*((numLayers-5)/2) + (numLayers<5 ? 0:1);
|
50
|
}
|
51
|
|
52
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
53
|
|
54
|
private int numCubitsPerEdge(int numLayers)
|
55
|
{
|
56
|
return numLayers<5 ? 0 : 2*(numLayers-4);
|
57
|
}
|
58
|
|
59
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
60
|
|
61
|
public float[][] getCuts(int[] numLayers)
|
62
|
{
|
63
|
return genericGetCuts(numLayers[0],0.5f);
|
64
|
}
|
65
|
|
66
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
67
|
// Fill out mCurrCorner{X,Y,Z} by applying appropriate Quat to mBasicCorner{X,Y,Z}
|
68
|
// Appropriate one: QUATS[QUAT_INDICES[corner]].
|
69
|
|
70
|
private void computeBasicCornerVectors(int corner)
|
71
|
{
|
72
|
if( mQuatCornerIndices==null ) initializeQuatIndices();
|
73
|
if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
|
74
|
|
75
|
Static4D quat = mObjectQuats[mQuatCornerIndices[corner]];
|
76
|
|
77
|
mCurrCornerV[0] = QuatHelper.rotateVectorByQuat(mBasicCornerV[0],quat);
|
78
|
mCurrCornerV[1] = QuatHelper.rotateVectorByQuat(mBasicCornerV[1],quat);
|
79
|
mCurrCornerV[2] = QuatHelper.rotateVectorByQuat(mBasicCornerV[2],quat);
|
80
|
}
|
81
|
|
82
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
83
|
|
84
|
private float[] computeCorner(int numCubitsPerCorner, int numLayers, int corner, int part)
|
85
|
{
|
86
|
if( mCorners==null ) initializeCorners();
|
87
|
if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
|
88
|
|
89
|
float D = numLayers/3.0f;
|
90
|
float[] corn = mCorners[corner];
|
91
|
|
92
|
if( part==0 )
|
93
|
{
|
94
|
return new float[] { corn[0]*D, corn[1]*D, corn[2]*D };
|
95
|
}
|
96
|
else
|
97
|
{
|
98
|
float E = D/(0.5f*(numLayers-1)); // ?? maybe 0.5*
|
99
|
int N = (numCubitsPerCorner-1)/3;
|
100
|
int block = (part-1) % N;
|
101
|
int index = (part-1) / N;
|
102
|
Static4D pri = mCurrCornerV[index];
|
103
|
Static4D sec = mCurrCornerV[(index+2)%3];
|
104
|
|
105
|
int layers= (numLayers-5)/2;
|
106
|
int multP = (block % layers) + 1;
|
107
|
int multS = (block / layers);
|
108
|
|
109
|
return new float[] {
|
110
|
corn[0]*D + (pri.get0()*multP + sec.get0()*multS)*E,
|
111
|
corn[1]*D + (pri.get1()*multP + sec.get1()*multS)*E,
|
112
|
corn[2]*D + (pri.get2()*multP + sec.get2()*multS)*E
|
113
|
};
|
114
|
}
|
115
|
}
|
116
|
|
117
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
118
|
|
119
|
private float[] computeCenter(int numLayers, int center, int part)
|
120
|
{
|
121
|
if( mCenterCoords==null ) initializeCenterCoords();
|
122
|
if( mCorners ==null ) initializeCorners();
|
123
|
if( mCenterMap ==null ) initializeCenterMap();
|
124
|
|
125
|
int corner = mCenterMap[center][part];
|
126
|
float[] cent = mCenterCoords[center];
|
127
|
float[] corn = mCorners[corner];
|
128
|
float D = numLayers/3.0f;
|
129
|
float F = 1.0f - (2.0f*numLayers-6.0f)/(numLayers-1)*COS54*COS54;
|
130
|
|
131
|
return new float[]
|
132
|
{
|
133
|
D * ( cent[0] + (corn[0]-cent[0])*F),
|
134
|
D * ( cent[1] + (corn[1]-cent[1])*F),
|
135
|
D * ( cent[2] + (corn[2]-cent[2])*F)
|
136
|
};
|
137
|
}
|
138
|
|
139
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
140
|
|
141
|
private int computeEdgeType(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
|
142
|
{
|
143
|
int part = (cubit - NUM_CORNERS*numCubitsPerCorner) % numCubitsPerEdge;
|
144
|
return part - 2*(part/4);
|
145
|
}
|
146
|
|
147
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
148
|
|
149
|
private float[] computeEdge(int numLayers, int edge, int part)
|
150
|
{
|
151
|
if( mCenterCoords==null ) initializeCenterCoords();
|
152
|
if( mCorners==null ) initializeCorners();
|
153
|
if( mEdgeMap==null ) initializeEdgeMap();
|
154
|
|
155
|
float D = numLayers/3.0f;
|
156
|
float[] c1 = mCorners[ mEdgeMap[edge][0] ];
|
157
|
float[] c2 = mCorners[ mEdgeMap[edge][1] ];
|
158
|
|
159
|
int leftRight = 2*(part%2) -1;
|
160
|
part /= 2;
|
161
|
|
162
|
if( part==0 )
|
163
|
{
|
164
|
float T = 0.5f + leftRight/(numLayers-1.0f);
|
165
|
float x = D * (T*c1[0]+(1.0f-T)*c2[0]);
|
166
|
float y = D * (T*c1[1]+(1.0f-T)*c2[1]);
|
167
|
float z = D * (T*c1[2]+(1.0f-T)*c2[2]);
|
168
|
|
169
|
return new float[] { x, y, z };
|
170
|
}
|
171
|
else
|
172
|
{
|
173
|
int mult = (part+1)/2;
|
174
|
int dir = (part+1)%2;
|
175
|
float[] center = mCenterCoords[ mEdgeMap[edge][dir+2] ];
|
176
|
float x = 0.5f * D * (c1[0]+c2[0]);
|
177
|
float y = 0.5f * D * (c1[1]+c2[1]);
|
178
|
float z = 0.5f * D * (c1[2]+c2[2]);
|
179
|
|
180
|
float vX = D*center[0] - x;
|
181
|
float vY = D*center[1] - y;
|
182
|
float vZ = D*center[2] - z;
|
183
|
|
184
|
float T = 0.5f + leftRight*(mult*SIN18 + 1.0f)/(numLayers-1);
|
185
|
|
186
|
x = D * (T*c1[0]+(1.0f-T)*c2[0]);
|
187
|
y = D * (T*c1[1]+(1.0f-T)*c2[1]);
|
188
|
z = D * (T*c1[2]+(1.0f-T)*c2[2]);
|
189
|
|
190
|
float H = mult*D*COS18/(numLayers-1);
|
191
|
H /= (float)Math.sqrt(vX*vX+vY*vY+vZ*vZ);
|
192
|
|
193
|
return new float[] { x + H*vX, y + H*vY, z + H*vZ };
|
194
|
}
|
195
|
}
|
196
|
|
197
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
198
|
|
199
|
public float[][] getCubitPositions(int[] numLayers)
|
200
|
{
|
201
|
if( mCorners==null ) initializeCorners();
|
202
|
|
203
|
int numL = numLayers[0];
|
204
|
if( numL<5 ) return mCorners;
|
205
|
|
206
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
207
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
208
|
int numCubitsPerCenter = 5;
|
209
|
int numCubits = NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge + NUM_CENTERS*numCubitsPerCenter;
|
210
|
int index=0;
|
211
|
|
212
|
final float[][] CENTERS = new float[numCubits][];
|
213
|
|
214
|
for(int corner=0; corner<NUM_CORNERS; corner++)
|
215
|
{
|
216
|
computeBasicCornerVectors(corner);
|
217
|
|
218
|
for(int part=0; part<numCubitsPerCorner; part++, index++)
|
219
|
{
|
220
|
CENTERS[index] = computeCorner(numCubitsPerCorner,numL,corner,part);
|
221
|
}
|
222
|
}
|
223
|
|
224
|
for(int edge=0; edge<NUM_EDGES; edge++)
|
225
|
{
|
226
|
for(int part=0; part<numCubitsPerEdge; part++, index++)
|
227
|
{
|
228
|
CENTERS[index] = computeEdge(numL, edge, part );
|
229
|
}
|
230
|
}
|
231
|
|
232
|
for(int center=0; center<NUM_CENTERS; center++)
|
233
|
{
|
234
|
for(int part=0; part<numCubitsPerCenter; part++, index++)
|
235
|
{
|
236
|
CENTERS[index] = computeCenter(numL,center, part);
|
237
|
}
|
238
|
}
|
239
|
|
240
|
return CENTERS;
|
241
|
}
|
242
|
|
243
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
244
|
|
245
|
public Static4D getCubitQuats(int cubit, int[] numLayers)
|
246
|
{
|
247
|
int numL = numLayers[0];
|
248
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
249
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
250
|
int q = getQuat(cubit,numCubitsPerCorner,numCubitsPerEdge);
|
251
|
return mObjectQuats[q];
|
252
|
}
|
253
|
|
254
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
255
|
|
256
|
private int getQuat(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
|
257
|
{
|
258
|
if( mQuatCornerIndices==null || mQuatEdgeIndices==null ) initializeQuatIndices();
|
259
|
if( mCenterMap==null ) initializeCenterMap();
|
260
|
|
261
|
if( cubit < NUM_CORNERS*numCubitsPerCorner )
|
262
|
{
|
263
|
int corner = cubit/numCubitsPerCorner;
|
264
|
return mQuatCornerIndices[corner];
|
265
|
}
|
266
|
|
267
|
if( cubit < NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
|
268
|
{
|
269
|
int edge = (cubit-NUM_CORNERS*numCubitsPerCorner)/numCubitsPerEdge;
|
270
|
return mQuatEdgeIndices[edge];
|
271
|
}
|
272
|
|
273
|
if( numCubitsPerCorner==0 )
|
274
|
{
|
275
|
return mQuatCornerIndices[cubit];
|
276
|
}
|
277
|
else
|
278
|
{
|
279
|
cubit -= (NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge);
|
280
|
int numCubitsPerCenter = 5;
|
281
|
int face = cubit/numCubitsPerCenter;
|
282
|
int index= cubit%numCubitsPerCenter;
|
283
|
int center=mCenterMap[face][index];
|
284
|
return mQuatCornerIndices[center];
|
285
|
}
|
286
|
}
|
287
|
|
288
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
289
|
|
290
|
public ObjectShape getObjectShape(int variant)
|
291
|
{
|
292
|
int[] numLayers = getNumLayers();
|
293
|
int numVariants = getNumCubitVariants(numLayers);
|
294
|
int numL = numLayers[0];
|
295
|
boolean small = numL<=3;
|
296
|
|
297
|
if( variant==0 && !small )
|
298
|
{
|
299
|
float width = numL/(numL-1.0f);
|
300
|
float X = width*COS18*SIN_HALFD;
|
301
|
float Y = width*SIN18;
|
302
|
float Z = width*COS18*COS_HALFD;
|
303
|
|
304
|
float[][] vertices =
|
305
|
{
|
306
|
{ 0, 0 , 0 },
|
307
|
{ X, Y , -Z },
|
308
|
{ 0, 2*Y ,-2*Z },
|
309
|
{ -X, Y , -Z },
|
310
|
{ 0, 0-width, 0 },
|
311
|
{ X, Y-width, -Z },
|
312
|
{ 0, 2*Y-width,-2*Z },
|
313
|
{ -X, Y-width, -Z },
|
314
|
};
|
315
|
|
316
|
int[][] indices =
|
317
|
{
|
318
|
{4,5,1,0},
|
319
|
{7,4,0,3},
|
320
|
{0,1,2,3},
|
321
|
{4,5,6,7},
|
322
|
{6,5,1,2},
|
323
|
{7,6,2,3}
|
324
|
};
|
325
|
|
326
|
return new ObjectShape(vertices, indices);
|
327
|
}
|
328
|
if( variant<numVariants-1 )
|
329
|
{
|
330
|
int type = variant-1;
|
331
|
float tmpVal= numL/(numL-1.0f);
|
332
|
float height= tmpVal*COS18;
|
333
|
float width = tmpVal + (type/2)*tmpVal*SIN18;
|
334
|
boolean left = (type%2)==0;
|
335
|
|
336
|
float X = height*SIN_HALFD;
|
337
|
float Y = height*SIN18/COS18;
|
338
|
float Z = height*COS_HALFD;
|
339
|
|
340
|
float[][] vertices =
|
341
|
{
|
342
|
{ 0, 0 , 0 },
|
343
|
{ X, Y , -Z },
|
344
|
{ 0, 2*Y ,-2*Z },
|
345
|
{ -X, Y , -Z },
|
346
|
{ 0, -width, 0 },
|
347
|
{ X, -width, -Z },
|
348
|
{ 0, -width,-2*Z },
|
349
|
{ -X, -width, -Z },
|
350
|
};
|
351
|
|
352
|
int[][] indices =
|
353
|
{
|
354
|
{4,5,1,0},
|
355
|
{7,4,0,3},
|
356
|
{7,6,2,3},
|
357
|
{6,5,1,2},
|
358
|
{0,1,2,3},
|
359
|
{4,5,6,7}
|
360
|
};
|
361
|
|
362
|
if( !left )
|
363
|
{
|
364
|
int tmp, len = vertices.length;
|
365
|
for(int i=0; i<len; i++) vertices[i][1] = -vertices[i][1];
|
366
|
|
367
|
len = indices.length;
|
368
|
for(int i=0; i<len; i++)
|
369
|
{
|
370
|
tmp = indices[i][0];
|
371
|
indices[i][0] = indices[i][3];
|
372
|
indices[i][3] = tmp;
|
373
|
tmp = indices[i][1];
|
374
|
indices[i][1] = indices[i][2];
|
375
|
indices[i][2] = tmp;
|
376
|
}
|
377
|
}
|
378
|
|
379
|
return new ObjectShape(vertices, indices);
|
380
|
}
|
381
|
else
|
382
|
{
|
383
|
float width = (1+0.5f*(numL-3)*SIN18)*numL/(numL-1);
|
384
|
float X = width*COS18*SIN_HALFD;
|
385
|
float Y = width*SIN18;
|
386
|
float Z = width*COS18*COS_HALFD;
|
387
|
float H = width*(SIN54/COS54);
|
388
|
float H3= H/COS_HALFD;
|
389
|
float X3= H*SIN_HALFD;
|
390
|
float Z3= H*COS_HALFD;
|
391
|
float C = 1/(COS54*(float)Math.sqrt(2-2*SIN18));
|
392
|
|
393
|
float[][] vertices =
|
394
|
{
|
395
|
{ 0, 0 , 0 },
|
396
|
{ X, Y , -Z },
|
397
|
{ 0,C*2*Y ,-2*C*Z },
|
398
|
{ -X, Y , -Z },
|
399
|
{ 0,-width, 0 },
|
400
|
{ X3,-width, -Z3 },
|
401
|
{ 0,-width, -H3 },
|
402
|
{ -X3,-width, -Z3 }
|
403
|
};
|
404
|
|
405
|
int[][] indices =
|
406
|
{
|
407
|
{4,5,1,0},
|
408
|
{7,4,0,3},
|
409
|
{0,1,2,3},
|
410
|
{7,6,2,3},
|
411
|
{6,5,1,2},
|
412
|
{4,5,6,7}
|
413
|
};
|
414
|
|
415
|
return new ObjectShape(vertices, indices);
|
416
|
}
|
417
|
}
|
418
|
|
419
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
420
|
|
421
|
public ObjectFaceShape getObjectFaceShape(int variant)
|
422
|
{
|
423
|
int[] numLayers = getNumLayers();
|
424
|
int numVariants = getNumCubitVariants(numLayers);
|
425
|
int numL = numLayers[0];
|
426
|
boolean small = numL<=3;
|
427
|
|
428
|
if( variant==0 && !small )
|
429
|
{
|
430
|
float A = (2*SQ3/3)*SIN54;
|
431
|
float B = 0.4f;
|
432
|
|
433
|
float[][] bands = { {0.04f,34,0.3f,0.2f, 3, 0, 0}, {0.00f,34,0.0f,0.0f, 2, 0, 0} };
|
434
|
int[] bandIndices = { 0,0,0,1,1,1};
|
435
|
float[][] corners = { {0.04f,0.10f} };
|
436
|
int[] cornerIndices = { 0,-1,-1,-1,-1,-1,-1,-1 };
|
437
|
float[][] centers = { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
|
438
|
int[] centerIndices = { 0,-1,-1,-1,-1,-1,-1,-1 };
|
439
|
|
440
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
441
|
}
|
442
|
if( variant<numVariants-1 )
|
443
|
{
|
444
|
int type = variant-1;
|
445
|
float tmpVal= numL/(numL-1.0f);
|
446
|
float height= tmpVal*COS18;
|
447
|
float width = tmpVal + (type/2)*tmpVal*SIN18;
|
448
|
float Z = height*COS_HALFD;
|
449
|
int E = small ? 1 : 0;
|
450
|
int N0 = small ? 4 : 3;
|
451
|
int N1 = small ? 3 : 2;
|
452
|
|
453
|
float[][] bands = { {0.04f,34,0.2f,0.2f,N0,E,E}, {0.00f,34,0.0f,0.0f,N1,0,0} };
|
454
|
int[] bandIndices = { 0,0,1,1,1,1};
|
455
|
float[][] corners = { {0.04f,0.10f} };
|
456
|
int[] cornerIndices = { 0,-1,-1,-1, 0,-1,-1,-1 };
|
457
|
float[][] centers = { {0.0f, -width/2, -2*Z} };
|
458
|
int[] centerIndices = { 0,-1,-1,-1, 0,-1,-1,-1 };
|
459
|
|
460
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
461
|
}
|
462
|
else
|
463
|
{
|
464
|
float A = (2*SQ3/3)*SIN54;
|
465
|
float B = 0.4f;
|
466
|
int N = small ? 4 : 3;
|
467
|
int E = small ? 1 : 0;
|
468
|
|
469
|
float[][] bands = { {0.04f,17,0.3f,0.2f,N,E,E},{0.00f,17,0.3f,0.2f,N,E,E} };
|
470
|
int[] bandIndices = { 0,0,0,1,1,1};
|
471
|
float[][] corners = { {0.03f,0.10f} };
|
472
|
int[] cornerIndices = { 0, 0,-1, 0, 0,-1,-1,-1 };
|
473
|
float[][] centers = { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
|
474
|
int[] centerIndices = { 0, 0,-1, 0, 0,-1,-1,-1 };
|
475
|
|
476
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
477
|
}
|
478
|
}
|
479
|
|
480
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
481
|
|
482
|
public int getNumCubitVariants(int[] numLayers)
|
483
|
{
|
484
|
switch(numLayers[0])
|
485
|
{
|
486
|
case 3: return 1;
|
487
|
case 5: return 4;
|
488
|
}
|
489
|
|
490
|
return 1;
|
491
|
}
|
492
|
|
493
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
494
|
|
495
|
public int getCubitVariant(int cubit, int[] numLayers)
|
496
|
{
|
497
|
int numL = numLayers[0];
|
498
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
499
|
|
500
|
if( cubit<NUM_CORNERS*numCubitsPerCorner ) return 0;
|
501
|
|
502
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
503
|
|
504
|
if( cubit<NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
|
505
|
{
|
506
|
int type = computeEdgeType(cubit,numCubitsPerCorner,numCubitsPerEdge);
|
507
|
return type+1;
|
508
|
}
|
509
|
|
510
|
return getNumCubitVariants(numLayers)-1;
|
511
|
}
|
512
|
|
513
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
514
|
// make the 'center' sticker artificially larger, so that we paint over the area in the center of the face.
|
515
|
|
516
|
public void adjustStickerCoords()
|
517
|
{
|
518
|
int[] numLayers = getNumLayers();
|
519
|
int index = numLayers[0]==3 ? 0:2;
|
520
|
float CENTER_CORR = 0.87f;
|
521
|
|
522
|
mStickerCoords[index][2] *= CENTER_CORR;
|
523
|
mStickerCoords[index][3] *= CENTER_CORR;
|
524
|
}
|
525
|
|
526
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
527
|
|
528
|
public float getStickerRadius()
|
529
|
{
|
530
|
return 0.18f;
|
531
|
}
|
532
|
|
533
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
534
|
|
535
|
public float getStickerStroke()
|
536
|
{
|
537
|
float stroke = 0.25f;
|
538
|
|
539
|
if( ObjectControl.isInIconMode() )
|
540
|
{
|
541
|
int[] numLayers = getNumLayers();
|
542
|
if( numLayers[0]>3 ) stroke*=1.5f;
|
543
|
}
|
544
|
|
545
|
return stroke;
|
546
|
}
|
547
|
|
548
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
549
|
|
550
|
public float[][] getStickerAngles()
|
551
|
{
|
552
|
return null;
|
553
|
}
|
554
|
|
555
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
556
|
|
557
|
public ObjectType intGetObjectType(int[] numLayers)
|
558
|
{
|
559
|
switch(numLayers[0])
|
560
|
{
|
561
|
case 3: return ObjectType.KILO_3;
|
562
|
case 5: return ObjectType.KILO_5;
|
563
|
}
|
564
|
|
565
|
return ObjectType.KILO_3;
|
566
|
}
|
567
|
|
568
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
569
|
|
570
|
public String getObjectName()
|
571
|
{
|
572
|
switch(getNumLayers()[0])
|
573
|
{
|
574
|
case 3: return "Kilominx";
|
575
|
case 5: return "Master Kilominx";
|
576
|
}
|
577
|
return "Kilominx";
|
578
|
}
|
579
|
|
580
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
581
|
|
582
|
public String getInventor()
|
583
|
{
|
584
|
switch(getNumLayers()[0])
|
585
|
{
|
586
|
case 3: return "Thomas de Bruin";
|
587
|
case 5: return "David Gugl";
|
588
|
}
|
589
|
return "Thomas de Bruin";
|
590
|
}
|
591
|
|
592
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
593
|
|
594
|
public int getYearOfInvention()
|
595
|
{
|
596
|
switch(getNumLayers()[0])
|
597
|
{
|
598
|
case 3: return 2008;
|
599
|
case 5: return 2010;
|
600
|
}
|
601
|
return 2008;
|
602
|
}
|
603
|
|
604
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
605
|
|
606
|
public int getComplexity()
|
607
|
{
|
608
|
switch(getNumLayers()[0])
|
609
|
{
|
610
|
case 3: return 2;
|
611
|
case 5: return 3;
|
612
|
}
|
613
|
return 8;
|
614
|
}
|
615
|
}
|