1 |
9b45d559
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2022 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
6133be67
|
Leszek Koltunski
|
// 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 |
9b45d559
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9 |
|
|
|
10 |
|
|
package org.distorted.objectlib.objects;
|
11 |
|
|
|
12 |
|
|
import org.distorted.library.type.Static3D;
|
13 |
|
|
import org.distorted.library.type.Static4D;
|
14 |
84a17011
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.FactoryCubit;
|
15 |
9b45d559
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectFaceShape;
|
16 |
|
|
import org.distorted.objectlib.helpers.ObjectShape;
|
17 |
1d581993
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectSignature;
|
18 |
84a17011
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectVertexEffects;
|
19 |
cf93ea4e
|
Leszek Koltunski
|
import org.distorted.objectlib.main.InitAssets;
|
20 |
a8295031
|
Leszek Koltunski
|
import org.distorted.objectlib.main.InitData;
|
21 |
2dffaf22
|
Leszek Koltunski
|
import org.distorted.objectlib.main.ObjectSignatures;
|
22 |
9b45d559
|
Leszek Koltunski
|
import org.distorted.objectlib.main.ObjectType;
|
23 |
b31249d6
|
Leszek Koltunski
|
import org.distorted.objectlib.shape.ShapeHexahedron;
|
24 |
9b45d559
|
Leszek Koltunski
|
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
|
25 |
|
|
|
26 |
|
|
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_HEXAHEDRON;
|
27 |
|
|
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
|
28 |
|
|
|
29 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
30 |
|
|
|
31 |
|
|
public class TwistyVoid extends ShapeHexahedron
|
32 |
|
|
{
|
33 |
|
|
static final Static3D[] ROT_AXIS = new Static3D[]
|
34 |
|
|
{
|
35 |
|
|
new Static3D(1,0,0),
|
36 |
|
|
new Static3D(0,1,0),
|
37 |
|
|
new Static3D(0,0,1)
|
38 |
|
|
};
|
39 |
|
|
|
40 |
9ba7f3f6
|
Leszek Koltunski
|
private int[][] mEdges;
|
41 |
beee90ab
|
Leszek Koltunski
|
private int[][] mBasicAngle;
|
42 |
9b45d559
|
Leszek Koltunski
|
private float[][] mCuts;
|
43 |
82e62580
|
Leszek Koltunski
|
private float[][] mPositions;
|
44 |
9b45d559
|
Leszek Koltunski
|
private int[] mQuatIndex;
|
45 |
|
|
|
46 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
47 |
|
|
|
48 |
cf93ea4e
|
Leszek Koltunski
|
public TwistyVoid(int meshState, int iconMode, Static4D quat, Static3D move, float scale, InitData data, InitAssets asset)
|
49 |
9b45d559
|
Leszek Koltunski
|
{
|
50 |
cf93ea4e
|
Leszek Koltunski
|
super(meshState, iconMode, data.getNumLayers()[0], quat, move, scale, data, asset);
|
51 |
9b45d559
|
Leszek Koltunski
|
}
|
52 |
|
|
|
53 |
0dc23f74
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
54 |
|
|
|
55 |
|
|
@Override
|
56 |
|
|
public void adjustStickerCoords()
|
57 |
|
|
{
|
58 |
|
|
final float A = 0.497f;
|
59 |
|
|
final float B = 0.38950402f;
|
60 |
|
|
final float C = 0.25900806f;
|
61 |
|
|
final float D = 0.51f;
|
62 |
|
|
|
63 |
|
|
mStickerCoords = new float[][]
|
64 |
|
|
{
|
65 |
6ddadae2
|
Leszek Koltunski
|
{ -0.5f, -0.5f, A, -0.5f, -0.5f, A },
|
66 |
|
|
{ -C, -B, D, -B, D, B, -C, B }
|
67 |
0dc23f74
|
Leszek Koltunski
|
};
|
68 |
|
|
}
|
69 |
|
|
|
70 |
9b45d559
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
71 |
|
|
|
72 |
|
|
@Override
|
73 |
|
|
public int getInternalColor()
|
74 |
|
|
{
|
75 |
|
|
return 0xff222222;
|
76 |
|
|
}
|
77 |
|
|
|
78 |
9ba7f3f6
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
ea889ebf
|
Leszek Koltunski
|
// +5 missing - it is the 180 deg rotation of the middle layer which we don't want.
|
80 |
9ba7f3f6
|
Leszek Koltunski
|
|
81 |
ea889ebf
|
Leszek Koltunski
|
private void insertSection(int[] table, int index, int alg, int state)
|
82 |
9ba7f3f6
|
Leszek Koltunski
|
{
|
83 |
ea889ebf
|
Leszek Koltunski
|
table[index ] = alg;
|
84 |
|
|
table[index+ 1] = state;
|
85 |
|
|
table[index+ 2] = alg+1;
|
86 |
|
|
table[index+ 3] = state;
|
87 |
|
|
table[index+ 4] = alg+2;
|
88 |
|
|
table[index+ 5] = state;
|
89 |
|
|
table[index+ 6] = alg+3;
|
90 |
|
|
table[index+ 7] = state;
|
91 |
|
|
table[index+ 8] = alg+4;
|
92 |
|
|
table[index+ 9] = state;
|
93 |
|
|
table[index+10] = alg+6;
|
94 |
|
|
table[index+11] = state;
|
95 |
|
|
table[index+12] = alg+7;
|
96 |
|
|
table[index+13] = state;
|
97 |
|
|
table[index+14] = alg+8;
|
98 |
|
|
table[index+15] = state;
|
99 |
9ba7f3f6
|
Leszek Koltunski
|
}
|
100 |
|
|
|
101 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
102 |
|
|
|
103 |
|
|
private int[] createEdge(int stateX, int stateY, int stateZ)
|
104 |
|
|
{
|
105 |
ea889ebf
|
Leszek Koltunski
|
int size= 8;
|
106 |
9ba7f3f6
|
Leszek Koltunski
|
int num = 0;
|
107 |
ea889ebf
|
Leszek Koltunski
|
if( stateX>=0 ) num += 2*size;
|
108 |
|
|
if( stateY>=0 ) num += 2*size;
|
109 |
|
|
if( stateZ>=0 ) num += 2*size;
|
110 |
|
|
|
111 |
|
|
int[] ret = new int[num];
|
112 |
|
|
|
113 |
|
|
int index = 0;
|
114 |
|
|
int alg = 0;
|
115 |
|
|
if( stateX>=0 ) { insertSection(ret,index,alg,stateX); index+= (2*size);}
|
116 |
|
|
alg += (size+1);
|
117 |
|
|
if( stateY>=0 ) { insertSection(ret,index,alg,stateY); index+= (2*size);}
|
118 |
|
|
alg += (size+1);
|
119 |
|
|
if( stateZ>=0 ) { insertSection(ret,index,alg,stateZ); }
|
120 |
9ba7f3f6
|
Leszek Koltunski
|
|
121 |
|
|
return ret;
|
122 |
|
|
}
|
123 |
|
|
|
124 |
9b45d559
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
125 |
ab8e7276
|
Leszek Koltunski
|
// Normal 3x3, but without the 180 deg move of the middle layer.
|
126 |
|
|
// We need to rotate the middle layer here (by swiping it is not possible) because otherwise the
|
127 |
|
|
// phantom centers would always stay at their initial positions which would defeat the point here.
|
128 |
9b45d559
|
Leszek Koltunski
|
|
129 |
9ba7f3f6
|
Leszek Koltunski
|
public int[][] getScrambleEdges()
|
130 |
9b45d559
|
Leszek Koltunski
|
{
|
131 |
9ba7f3f6
|
Leszek Koltunski
|
if( mEdges==null )
|
132 |
9b45d559
|
Leszek Koltunski
|
{
|
133 |
9ba7f3f6
|
Leszek Koltunski
|
mEdges = new int[][]
|
134 |
|
|
{
|
135 |
|
|
createEdge( 1, 2, 3), // 0 0
|
136 |
|
|
createEdge(-1, 4, 5), // 1 x
|
137 |
|
|
createEdge( 6,-1, 7), // 2 y
|
138 |
|
|
createEdge( 8, 9,-1), // 3 z
|
139 |
|
|
createEdge(10,-1, 7), // 4 xy
|
140 |
|
|
createEdge(11, 9,-1), // 5 xz
|
141 |
|
|
createEdge(-1,12, 5), // 6 yx
|
142 |
|
|
createEdge( 8,13,-1), // 7 yz
|
143 |
|
|
createEdge(-1, 4,14), // 8 zx
|
144 |
|
|
createEdge( 6,-1,15), // 9 zy
|
145 |
|
|
createEdge(-1,-1, 5), // 10 xyx
|
146 |
|
|
createEdge(-1, 4,-1), // 11 xzx
|
147 |
|
|
createEdge(-1,-1, 7), // 12 yxy
|
148 |
|
|
createEdge( 6,-1,-1), // 13 yzy
|
149 |
|
|
createEdge(-1, 9,-1), // 14 zxz
|
150 |
|
|
createEdge( 8,-1,-1), // 15 zyz
|
151 |
|
|
};
|
152 |
9b45d559
|
Leszek Koltunski
|
}
|
153 |
|
|
|
154 |
9ba7f3f6
|
Leszek Koltunski
|
return mEdges;
|
155 |
9b45d559
|
Leszek Koltunski
|
}
|
156 |
|
|
|
157 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
158 |
|
|
|
159 |
|
|
public float[][] getCuts(int[] numLayers)
|
160 |
|
|
{
|
161 |
|
|
if( mCuts==null )
|
162 |
|
|
{
|
163 |
|
|
float C = 0.5f;
|
164 |
|
|
float[] cut = new float[] {-C,+C};
|
165 |
|
|
mCuts = new float[][] { cut,cut,cut };
|
166 |
|
|
}
|
167 |
|
|
|
168 |
|
|
return mCuts;
|
169 |
|
|
}
|
170 |
|
|
|
171 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
172 |
|
|
|
173 |
|
|
public boolean[][] getLayerRotatable(int[] numLayers)
|
174 |
|
|
{
|
175 |
9ba7f3f6
|
Leszek Koltunski
|
boolean[] tmp = new boolean[] {true,false,true};
|
176 |
9b45d559
|
Leszek Koltunski
|
return new boolean[][] { tmp,tmp,tmp };
|
177 |
|
|
}
|
178 |
|
|
|
179 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
180 |
|
|
|
181 |
|
|
public int getTouchControlType()
|
182 |
|
|
{
|
183 |
|
|
return TC_HEXAHEDRON;
|
184 |
|
|
}
|
185 |
|
|
|
186 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
187 |
|
|
|
188 |
|
|
public int getTouchControlSplit()
|
189 |
|
|
{
|
190 |
|
|
return TYPE_NOT_SPLIT;
|
191 |
|
|
}
|
192 |
|
|
|
193 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
194 |
|
|
|
195 |
|
|
public int[][][] getEnabled()
|
196 |
|
|
{
|
197 |
|
|
return new int[][][] { {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}} };
|
198 |
|
|
}
|
199 |
|
|
|
200 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
201 |
|
|
|
202 |
|
|
public float[] getDist3D(int[] numLayers)
|
203 |
|
|
{
|
204 |
|
|
return TouchControlHexahedron.D3D;
|
205 |
|
|
}
|
206 |
|
|
|
207 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
208 |
|
|
|
209 |
|
|
public Static3D[] getFaceAxis()
|
210 |
|
|
{
|
211 |
|
|
return TouchControlHexahedron.FACE_AXIS;
|
212 |
|
|
}
|
213 |
|
|
|
214 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
215 |
|
|
|
216 |
|
|
public float[][] getCubitPositions(int[] numLayers)
|
217 |
|
|
{
|
218 |
82e62580
|
Leszek Koltunski
|
if( mPositions==null )
|
219 |
9b45d559
|
Leszek Koltunski
|
{
|
220 |
82e62580
|
Leszek Koltunski
|
mPositions = new float[][]
|
221 |
9b45d559
|
Leszek Koltunski
|
{
|
222 |
24b63545
|
Leszek Koltunski
|
{ 1.0f, 1.0f, 1.0f},
|
223 |
|
|
{ 1.0f, 1.0f,-1.0f},
|
224 |
|
|
{ 1.0f,-1.0f, 1.0f},
|
225 |
|
|
{ 1.0f,-1.0f,-1.0f},
|
226 |
|
|
{-1.0f, 1.0f, 1.0f},
|
227 |
|
|
{-1.0f, 1.0f,-1.0f},
|
228 |
|
|
{-1.0f,-1.0f, 1.0f},
|
229 |
|
|
{-1.0f,-1.0f,-1.0f},
|
230 |
|
|
|
231 |
|
|
{ 1.0f, 1.0f, 0.0f},
|
232 |
|
|
{ 1.0f,-1.0f, 0.0f},
|
233 |
|
|
{ 1.0f, 0.0f, 1.0f},
|
234 |
|
|
{ 1.0f, 0.0f,-1.0f},
|
235 |
|
|
{-1.0f, 1.0f, 0.0f},
|
236 |
|
|
{-1.0f,-1.0f, 0.0f},
|
237 |
|
|
{-1.0f, 0.0f, 1.0f},
|
238 |
|
|
{-1.0f, 0.0f,-1.0f},
|
239 |
|
|
{ 0.0f, 1.0f, 1.0f},
|
240 |
|
|
{ 0.0f, 1.0f,-1.0f},
|
241 |
|
|
{ 0.0f,-1.0f, 1.0f},
|
242 |
|
|
{ 0.0f,-1.0f,-1.0f},
|
243 |
9b45d559
|
Leszek Koltunski
|
};
|
244 |
|
|
}
|
245 |
|
|
|
246 |
82e62580
|
Leszek Koltunski
|
return mPositions;
|
247 |
9b45d559
|
Leszek Koltunski
|
}
|
248 |
|
|
|
249 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
250 |
|
|
|
251 |
|
|
public Static4D getCubitQuats(int cubit, int[] numLayers)
|
252 |
|
|
{
|
253 |
24b63545
|
Leszek Koltunski
|
if( mQuatIndex==null ) mQuatIndex = new int[] {0,1,17,22,4,5,8,19, 1,3,0,2,10,11,4,5,9,15,7,19 };
|
254 |
|
|
return mObjectQuats[mQuatIndex[cubit]];
|
255 |
9b45d559
|
Leszek Koltunski
|
}
|
256 |
|
|
|
257 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
258 |
|
|
|
259 |
84a17011
|
Leszek Koltunski
|
private float[][] getVertices(int variant)
|
260 |
9b45d559
|
Leszek Koltunski
|
{
|
261 |
84a17011
|
Leszek Koltunski
|
if( variant==0 )
|
262 |
9b45d559
|
Leszek Koltunski
|
{
|
263 |
bed91182
|
Leszek Koltunski
|
final float X = 0.3f;
|
264 |
|
|
final double A = 54*Math.PI/180;
|
265 |
|
|
final float COS = (float)Math.cos(A);
|
266 |
|
|
final float SIN = (float)Math.sin(A);
|
267 |
|
|
|
268 |
84a17011
|
Leszek Koltunski
|
return new float[][]
|
269 |
9b45d559
|
Leszek Koltunski
|
{
|
270 |
bed91182
|
Leszek Koltunski
|
{ -0.5f, -0.5f, -0.5f },
|
271 |
|
|
{ -0.5f, -0.5f, +0.5f },
|
272 |
|
|
{ -0.5f, +0.5f, -0.5f },
|
273 |
|
|
{ +0.5f, -0.5f, -0.5f },
|
274 |
|
|
{ +0.5f, +0.5f, -0.5f },
|
275 |
|
|
{ +0.5f, -0.5f, +0.5f },
|
276 |
|
|
{ -0.5f, +0.5f, +0.5f },
|
277 |
|
|
{ +0.5f, +0.5f, -0.5f+X },
|
278 |
|
|
{ +0.5f, -0.5f+X, +0.5f },
|
279 |
|
|
{ -0.5f+X, +0.5f, +0.5f },
|
280 |
|
|
{ SIN-0.5f, 0.5f, COS-0.5f },
|
281 |
|
|
{ COS-0.5f, 0.5f, SIN-0.5f },
|
282 |
|
|
{ COS-0.5f, SIN-0.5f, 0.5f },
|
283 |
|
|
{ SIN-0.5f, COS-0.5f, 0.5f },
|
284 |
|
|
{ 0.5f, COS-0.5f, SIN-0.5f },
|
285 |
|
|
{ 0.5f, SIN-0.5f, COS-0.5f },
|
286 |
9b45d559
|
Leszek Koltunski
|
};
|
287 |
|
|
}
|
288 |
84a17011
|
Leszek Koltunski
|
else
|
289 |
9b45d559
|
Leszek Koltunski
|
{
|
290 |
0dc23f74
|
Leszek Koltunski
|
final float A = 0.13f;
|
291 |
|
|
final float B = 0.18f;
|
292 |
ab8e7276
|
Leszek Koltunski
|
final float C = 0.52f;
|
293 |
24b63545
|
Leszek Koltunski
|
|
294 |
84a17011
|
Leszek Koltunski
|
return new float[][]
|
295 |
9b45d559
|
Leszek Koltunski
|
{
|
296 |
ab8e7276
|
Leszek Koltunski
|
{ C, 0.5f, C},
|
297 |
24b63545
|
Leszek Koltunski
|
{ 0.5f, 0.5f,-0.5f},
|
298 |
ab8e7276
|
Leszek Koltunski
|
{ C,-0.5f, C},
|
299 |
24b63545
|
Leszek Koltunski
|
{ 0.5f,-0.5f,-0.5f},
|
300 |
|
|
{-0.5f, 0.5f, 0.5f},
|
301 |
|
|
{-0.5f, 0.5f,-0.5f},
|
302 |
|
|
{-0.5f,-0.5f, 0.5f},
|
303 |
|
|
{-0.5f,-0.5f,-0.5f},
|
304 |
|
|
|
305 |
|
|
{-0.5f+A, 0.25f, 0.5f},
|
306 |
|
|
{-0.5f+B, 0.00f, 0.5f},
|
307 |
|
|
{-0.5f+A,-0.25f, 0.5f},
|
308 |
|
|
|
309 |
|
|
{-0.5f+A, 0.25f,-0.5f+A},
|
310 |
|
|
{-0.5f+B, 0.00f,-0.5f+B},
|
311 |
|
|
{-0.5f+A,-0.25f,-0.5f+A},
|
312 |
|
|
|
313 |
|
|
{ 0.5f , 0.25f,-0.5f+A},
|
314 |
|
|
{ 0.5f , 0.00f,-0.5f+B},
|
315 |
|
|
{ 0.5f ,-0.25f,-0.5f+A},
|
316 |
9b45d559
|
Leszek Koltunski
|
};
|
317 |
84a17011
|
Leszek Koltunski
|
}
|
318 |
|
|
}
|
319 |
|
|
|
320 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
321 |
|
|
|
322 |
|
|
public ObjectShape getObjectShape(int variant)
|
323 |
|
|
{
|
324 |
|
|
if( variant==0 ) // corner
|
325 |
|
|
{
|
326 |
|
|
int[][] indices =
|
327 |
|
|
{
|
328 |
|
|
{6,1,5,8,13,12,9},
|
329 |
|
|
{5,3,4,7,15,14,8},
|
330 |
|
|
{4,2,6,9,11,10,7},
|
331 |
|
|
{0,1,6,2},
|
332 |
|
|
{0,3,5,1},
|
333 |
|
|
{0,2,4,3},
|
334 |
|
|
{9,12,11},
|
335 |
|
|
{8,14,13},
|
336 |
|
|
{7,10,15},
|
337 |
|
|
{10,11,12,13,14,15}
|
338 |
|
|
};
|
339 |
9b45d559
|
Leszek Koltunski
|
|
340 |
84a17011
|
Leszek Koltunski
|
return new ObjectShape(getVertices(variant), indices);
|
341 |
|
|
}
|
342 |
|
|
else // edge
|
343 |
|
|
{
|
344 |
9b45d559
|
Leszek Koltunski
|
int[][] indices =
|
345 |
|
|
{
|
346 |
24b63545
|
Leszek Koltunski
|
{6,2,0,4,8,9,10},
|
347 |
|
|
{1,0,2,3,16,15,14},
|
348 |
|
|
{4,0,1,5},
|
349 |
|
|
{2,6,7,3},
|
350 |
|
|
|
351 |
|
|
{11,8,4,5},
|
352 |
|
|
{12,9,8,11},
|
353 |
|
|
{13,10,9,12},
|
354 |
|
|
{7,6,10,13},
|
355 |
|
|
{13,16,3,7},
|
356 |
|
|
{12,15,16,13},
|
357 |
|
|
{11,14,15,12},
|
358 |
|
|
{5,1,14,11}
|
359 |
9b45d559
|
Leszek Koltunski
|
};
|
360 |
|
|
|
361 |
84a17011
|
Leszek Koltunski
|
return new ObjectShape(getVertices(variant), indices);
|
362 |
9b45d559
|
Leszek Koltunski
|
}
|
363 |
|
|
}
|
364 |
|
|
|
365 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
366 |
|
|
|
367 |
|
|
public ObjectFaceShape getObjectFaceShape(int variant)
|
368 |
|
|
{
|
369 |
|
|
if( variant==0 )
|
370 |
|
|
{
|
371 |
3bf19410
|
Leszek Koltunski
|
float h1 = isInIconMode() ? 0.001f : 0.015f;
|
372 |
|
|
float h2 = isInIconMode() ? 0.001f : 0.010f;
|
373 |
|
|
float h3 = isInIconMode() ? 0.001f : 0.030f;
|
374 |
84a17011
|
Leszek Koltunski
|
float[][] bands = { {h1,20,0.2f,0.4f,5,1,0}, {h2,5,0.3f,0.2f,5,0,0}, {h3,8,0.3f,0.2f,6,0,0} };
|
375 |
|
|
int[] indices = { 0,0,0,1,1,1,1,1,1,2 };
|
376 |
|
|
return new ObjectFaceShape(bands,indices,null);
|
377 |
|
|
}
|
378 |
|
|
else
|
379 |
|
|
{
|
380 |
|
|
float h1 = isInIconMode() ? 0.001f : 0.01f;
|
381 |
|
|
float[][] bands = { {h1,5,0.2f,0.4f,5,1,0}, {0.001f,1,0.3f,0.5f,5,0,0}, {0.001f,1,0.3f,0.5f,5,0,0} };
|
382 |
|
|
int[] indices = { 0,0,1,1,2,2,2,2,2,2,2,2 };
|
383 |
|
|
return new ObjectFaceShape(bands,indices,null);
|
384 |
|
|
}
|
385 |
|
|
}
|
386 |
|
|
|
387 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
388 |
|
|
|
389 |
|
|
public ObjectVertexEffects getVertexEffects(int variant)
|
390 |
|
|
{
|
391 |
|
|
if( variant==0 )
|
392 |
|
|
{
|
393 |
bed91182
|
Leszek Koltunski
|
float[][] corners = { {0.02f,0.09f} };
|
394 |
|
|
int[] indices = { -1,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1 };
|
395 |
|
|
float[][] centers = { { -0.5f, -0.5f, -0.5f } };
|
396 |
84a17011
|
Leszek Koltunski
|
return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
|
397 |
9b45d559
|
Leszek Koltunski
|
}
|
398 |
|
|
else
|
399 |
|
|
{
|
400 |
ab8e7276
|
Leszek Koltunski
|
float[][] corners = { {0.02f,0.09f} };
|
401 |
|
|
int[] indices = { 0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 };
|
402 |
24b63545
|
Leszek Koltunski
|
float[][] centers = { { 0.0f, 0.0f, 0.0f } };
|
403 |
84a17011
|
Leszek Koltunski
|
return FactoryCubit.generateVertexEffect(getVertices(variant),corners,indices,centers,indices);
|
404 |
9b45d559
|
Leszek Koltunski
|
}
|
405 |
|
|
}
|
406 |
|
|
|
407 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
408 |
|
|
|
409 |
|
|
public int getNumCubitVariants(int[] numLayers)
|
410 |
|
|
{
|
411 |
24b63545
|
Leszek Koltunski
|
return 2;
|
412 |
9b45d559
|
Leszek Koltunski
|
}
|
413 |
|
|
|
414 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
415 |
|
|
|
416 |
|
|
public int getCubitVariant(int cubit, int[] numLayers)
|
417 |
|
|
{
|
418 |
|
|
return cubit<8 ? 0:1;
|
419 |
|
|
}
|
420 |
|
|
|
421 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
422 |
|
|
|
423 |
|
|
public float getStickerRadius()
|
424 |
|
|
{
|
425 |
a0ccffb4
|
Leszek Koltunski
|
return 0.05f;
|
426 |
9b45d559
|
Leszek Koltunski
|
}
|
427 |
|
|
|
428 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
429 |
|
|
|
430 |
|
|
public float getStickerStroke()
|
431 |
|
|
{
|
432 |
3bf19410
|
Leszek Koltunski
|
return isInIconMode() ? 0.22f : 0.12f;
|
433 |
9b45d559
|
Leszek Koltunski
|
}
|
434 |
|
|
|
435 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
436 |
|
|
|
437 |
|
|
public float[][] getStickerAngles()
|
438 |
|
|
{
|
439 |
0dc23f74
|
Leszek Koltunski
|
float D = (float)(Math.PI/6);
|
440 |
6ddadae2
|
Leszek Koltunski
|
return new float[][] { { 0,D,0 },{ 0,0,0,-D } };
|
441 |
9b45d559
|
Leszek Koltunski
|
}
|
442 |
|
|
|
443 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
444 |
|
|
// PUBLIC API
|
445 |
|
|
|
446 |
|
|
public Static3D[] getRotationAxis()
|
447 |
|
|
{
|
448 |
|
|
return ROT_AXIS;
|
449 |
|
|
}
|
450 |
|
|
|
451 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
452 |
|
|
|
453 |
beee90ab
|
Leszek Koltunski
|
public int[][] getBasicAngles()
|
454 |
9b45d559
|
Leszek Koltunski
|
{
|
455 |
beee90ab
|
Leszek Koltunski
|
if( mBasicAngle ==null )
|
456 |
|
|
{
|
457 |
|
|
int num = getNumLayers()[0];
|
458 |
|
|
int[] tmp = new int[num];
|
459 |
|
|
for(int i=0; i<num; i++) tmp[i] = 4;
|
460 |
|
|
mBasicAngle = new int[][] { tmp,tmp,tmp };
|
461 |
|
|
}
|
462 |
|
|
|
463 |
9b45d559
|
Leszek Koltunski
|
return mBasicAngle;
|
464 |
|
|
}
|
465 |
|
|
|
466 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
467 |
|
|
|
468 |
5f54927b
|
Leszek Koltunski
|
public String getShortName()
|
469 |
9b45d559
|
Leszek Koltunski
|
{
|
470 |
5f54927b
|
Leszek Koltunski
|
return ObjectType.VOID_3.name();
|
471 |
|
|
}
|
472 |
|
|
|
473 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
474 |
|
|
|
475 |
1d581993
|
Leszek Koltunski
|
public ObjectSignature getSignature()
|
476 |
5f54927b
|
Leszek Koltunski
|
{
|
477 |
2dffaf22
|
Leszek Koltunski
|
return new ObjectSignature(ObjectSignatures.VOID_3);
|
478 |
9b45d559
|
Leszek Koltunski
|
}
|
479 |
|
|
|
480 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
481 |
|
|
|
482 |
|
|
public String getObjectName()
|
483 |
|
|
{
|
484 |
|
|
return "Void Cube";
|
485 |
|
|
}
|
486 |
|
|
|
487 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
488 |
|
|
|
489 |
|
|
public String getInventor()
|
490 |
|
|
{
|
491 |
|
|
return "Katsuhiko Okamoto";
|
492 |
|
|
}
|
493 |
|
|
|
494 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
495 |
|
|
|
496 |
|
|
public int getYearOfInvention()
|
497 |
|
|
{
|
498 |
|
|
return 2012;
|
499 |
|
|
}
|
500 |
|
|
|
501 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
502 |
|
|
|
503 |
|
|
public int getComplexity()
|
504 |
|
|
{
|
505 |
|
|
return 2;
|
506 |
|
|
}
|
507 |
|
|
|
508 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
509 |
|
|
|
510 |
|
|
public String[][] getTutorials()
|
511 |
|
|
{
|
512 |
|
|
return new String[][]{
|
513 |
|
|
{"gb","3sLMpQrX_dU","How to Solve the Void Cube","Z3"},
|
514 |
|
|
{"gb","EB0bmcI1RnM","aVOIDing parity: Void Cube","SuperAntoniovivaldi"},
|
515 |
|
|
{"es","tDV4vmo7Qz4","Resolver 3x3 Void (Hueco)","Cuby"},
|
516 |
|
|
{"ru","BCa6Zh8-I_g","Как собрать Войд-Куб","RBcuber"},
|
517 |
|
|
{"fr","yqSyPu5ciAc","Résoudre le Void Cube","TwinsCuber"},
|
518 |
|
|
{"de","1mh-jRrcP0w","Void Cube: Parity intuitiv lösen","rofrisch"},
|
519 |
|
|
{"br","uTC01oMGBJ8","3x3 Void cube Tutorial","Cubo vicio"},
|
520 |
|
|
{"kr","eCfepw1gVBA","보이드 큐브(홀큐브)","듀나메스 큐브 해법연구소"},
|
521 |
|
|
};
|
522 |
|
|
}
|
523 |
|
|
}
|