1 |
bc649d9a
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2019 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.objects;
|
21 |
|
|
|
22 |
|
|
import android.content.res.Resources;
|
23 |
|
|
|
24 |
acf165d9
|
Leszek Koltunski
|
import org.distorted.helpers.ObjectShape;
|
25 |
9c06394a
|
Leszek Koltunski
|
import org.distorted.helpers.ObjectSticker;
|
26 |
0ad6b867
|
Leszek Koltunski
|
import org.distorted.helpers.ScrambleStateGraph;
|
27 |
bc649d9a
|
Leszek Koltunski
|
import org.distorted.library.main.DistortedEffects;
|
28 |
|
|
import org.distorted.library.main.DistortedTexture;
|
29 |
|
|
import org.distorted.library.mesh.MeshSquare;
|
30 |
|
|
import org.distorted.library.type.Static3D;
|
31 |
|
|
import org.distorted.library.type.Static4D;
|
32 |
|
|
import org.distorted.main.R;
|
33 |
|
|
|
34 |
|
|
import java.util.Random;
|
35 |
|
|
|
36 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_DBLUE;
|
37 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_DGREEN;
|
38 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_DRED;
|
39 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_DYELLOW;
|
40 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_GREY;
|
41 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_LBLUE;
|
42 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_LGREEN;
|
43 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_ORANGE;
|
44 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_PINK;
|
45 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_SANDY;
|
46 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_VIOLET;
|
47 |
|
|
import static org.distorted.objects.TwistyMinx.MINX_WHITE;
|
48 |
|
|
|
49 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
50 |
|
|
|
51 |
|
|
class TwistyUltimate extends TwistyObject
|
52 |
|
|
{
|
53 |
|
|
private static final float A = (float)Math.sqrt(21*SQ5+47);
|
54 |
|
|
private static final float B = SQ6*(5*SQ5+11)/(6*A);
|
55 |
|
|
private static final float C = SQ6*( SQ5+ 2)/(3*A);
|
56 |
|
|
private static final float D = SQ3/3;
|
57 |
|
|
private static final float E = (SQ5+1)/4;
|
58 |
|
|
private static final float F = (SQ5-1)/4;
|
59 |
74ffd68e
|
Leszek Koltunski
|
private static final float G = (SQ5+3)/4;
|
60 |
bc649d9a
|
Leszek Koltunski
|
|
61 |
|
|
static final Static3D[] ROT_AXIS = new Static3D[]
|
62 |
|
|
{
|
63 |
|
|
new Static3D( B,0,C ),
|
64 |
|
|
new Static3D( C,B,0 ),
|
65 |
|
|
new Static3D(-D,D,D ),
|
66 |
|
|
new Static3D( 0,C,-B)
|
67 |
|
|
};
|
68 |
|
|
|
69 |
925ed78f
|
Leszek Koltunski
|
private static final int[] BASIC_ANGLE = new int[] { 3,3,3,3 };
|
70 |
|
|
|
71 |
bc649d9a
|
Leszek Koltunski
|
private static final int[] FACE_COLORS = new int[]
|
72 |
|
|
{
|
73 |
|
|
MINX_LGREEN, MINX_PINK , MINX_SANDY , MINX_LBLUE,
|
74 |
|
|
MINX_ORANGE, MINX_VIOLET , MINX_DGREEN, MINX_DRED ,
|
75 |
|
|
MINX_DBLUE , MINX_DYELLOW, MINX_WHITE , MINX_GREY
|
76 |
|
|
};
|
77 |
|
|
|
78 |
|
|
private static final Static4D[] QUATS = new Static4D[]
|
79 |
|
|
{
|
80 |
|
|
new Static4D( 0.0f, 0.0f, 0.0f, 1.0f ),
|
81 |
|
|
new Static4D(-0.5f, 0.5f, 0.5f, 0.5f ),
|
82 |
|
|
new Static4D( 0.5f,-0.5f,-0.5f, 0.5f ),
|
83 |
|
|
new Static4D( 0.0f, F, -E, 0.5f ),
|
84 |
|
|
new Static4D( 0.0f, -F, E, 0.5f ),
|
85 |
|
|
new Static4D( E, 0.0f, F, 0.5f ),
|
86 |
|
|
new Static4D( -E, 0.0f, -F, 0.5f ),
|
87 |
|
|
new Static4D( F, E, 0.0f, 0.5f ),
|
88 |
|
|
new Static4D( -F, -E, 0.0f, 0.5f ),
|
89 |
|
|
new Static4D( E, F,-0.5f, 0.0f ),
|
90 |
|
|
new Static4D( 0.5f, -E, F, 0.0f ),
|
91 |
|
|
new Static4D( F, 0.5f, E, 0.0f )
|
92 |
|
|
};
|
93 |
|
|
|
94 |
20f42f61
|
Leszek Koltunski
|
// Colors of the faces of cubits.
|
95 |
74ffd68e
|
Leszek Koltunski
|
private static final int[][] mFaceMap = new int[][]
|
96 |
|
|
{
|
97 |
20f42f61
|
Leszek Koltunski
|
{ 25,24,35, 36,36,36,36,36 },
|
98 |
|
|
{ 27,28,29, 36,36,36,36,36 },
|
99 |
|
|
{ 31,26,30, 36,36,36,36,36 },
|
100 |
|
|
{ 32,34,33, 36,36,36,36,36 },
|
101 |
|
|
|
102 |
|
|
{ 31,32,25, 36,36,36,36,36 },
|
103 |
|
|
{ 33,28,24, 36,36,36,36,36 },
|
104 |
|
|
{ 26,35,27, 36,36,36,36,36 },
|
105 |
|
|
{ 30,29,34, 36,36,36,36,36 },
|
106 |
|
|
|
107 |
|
|
{ 8, 0,13,21, 36,36,36,36 },
|
108 |
|
|
{ 1, 2,19,23, 36,36,36,36 },
|
109 |
|
|
{ 4,11,12,15, 36,36,36,36 },
|
110 |
|
|
{ 3, 6,14,17, 36,36,36,36 },
|
111 |
|
|
{ 5, 9,22,16, 36,36,36,36 },
|
112 |
|
|
{ 7,10,20,18, 36,36,36,36 }
|
113 |
74ffd68e
|
Leszek Koltunski
|
};
|
114 |
|
|
|
115 |
|
|
// centers of the 14 cubits.
|
116 |
|
|
static final float[][] CENTERS = new float[][]
|
117 |
|
|
{
|
118 |
|
|
{ 0.0f,-0.5f, G },
|
119 |
62efeeae
|
Leszek Koltunski
|
{ E, -E, -E },
|
120 |
|
|
{ -G, 0.0f,-0.5f },
|
121 |
|
|
{ 0.5f, G, 0.0f },
|
122 |
|
|
|
123 |
74ffd68e
|
Leszek Koltunski
|
{ -E, E, E },
|
124 |
|
|
{ G, 0.0f, 0.5f },
|
125 |
|
|
{-0.5f, -G, 0.0f },
|
126 |
|
|
{ 0.0f, 0.5f, -G },
|
127 |
|
|
|
128 |
|
|
{ E/2, (E+0.5f)/2, (E+G)/2 },
|
129 |
|
|
{ -(E+G)/2, -E/2, (E+0.5f)/2 },
|
130 |
|
|
{ (E+0.5f)/2, -(E+G)/2, E/2 },
|
131 |
|
|
{ -E/2,-(E+0.5f)/2, -(E+G)/2 },
|
132 |
|
|
{ (E+G)/2, E/2,-(E+0.5f)/2 },
|
133 |
|
|
{-(E+0.5f)/2, (E+G)/2, -E/2 }
|
134 |
|
|
};
|
135 |
|
|
|
136 |
62efeeae
|
Leszek Koltunski
|
private static final double[][] VERTICES_SMALL_LEFT = new double[][]
|
137 |
74ffd68e
|
Leszek Koltunski
|
{
|
138 |
62efeeae
|
Leszek Koltunski
|
{ 0.000, 0.000, 0.000},
|
139 |
|
|
{ - 0.250,-SQ5/8 - 0.125,-SQ5/8 - 0.375},
|
140 |
|
|
{ SQ5/8 + 0.125,-SQ5/8 - 0.375, + 0.250},
|
141 |
|
|
{ SQ5/8 + 0.375, + 0.250,-SQ5/8 - 0.125},
|
142 |
|
|
{ SQ5/4 + 0.250,-SQ5/4 - 0.250,-SQ5/4 - 0.250},
|
143 |
|
|
{ SQ5/8 - 0.125, + 0.250,-SQ5/8 - 0.125},
|
144 |
|
|
{ - 0.250,-SQ5/8 - 0.125,-SQ5/8 + 0.125},
|
145 |
|
|
{ SQ5/8 + 0.125,-SQ5/8 + 0.125, + 0.250}
|
146 |
74ffd68e
|
Leszek Koltunski
|
};
|
147 |
|
|
|
148 |
62efeeae
|
Leszek Koltunski
|
private static final int[][] VERT_INDEXES_SMALL_LEFT = new int[][]
|
149 |
|
|
{
|
150 |
|
|
{6,0,5,1}, // counterclockwise!
|
151 |
|
|
{0,7,3,5},
|
152 |
|
|
{0,6,2,7},
|
153 |
|
|
{1,5,3,4},
|
154 |
|
|
{3,7,2,4},
|
155 |
|
|
{2,6,1,4},
|
156 |
|
|
};
|
157 |
|
|
|
158 |
|
|
private static final double[][] VERTICES_SMALL_RIGHT = new double[][]
|
159 |
bc649d9a
|
Leszek Koltunski
|
{
|
160 |
|
|
{ 0.0 , 0.0 , 0.0 },
|
161 |
|
|
{ -0.5*E , 0.5*E+0.25, -0.25 },
|
162 |
|
|
{-0.25 , -E/2 , (-2*E-1)/4},
|
163 |
|
|
{ 0.5*E+0.25, 0.25 , -E/2 },
|
164 |
|
|
{ 0.0 , 0.5 , -E-0.5 },
|
165 |
|
|
{ 0.0 , 0.5 , 0.0 },
|
166 |
|
|
{ -0.5*E ,-0.5*E+0.25, -0.25 },
|
167 |
|
|
{ 0.5*E ,-0.5*E+0.25, -0.25 }
|
168 |
|
|
};
|
169 |
|
|
|
170 |
62efeeae
|
Leszek Koltunski
|
private static final int[][] VERT_INDEXES_SMALL_RIGHT = new int[][]
|
171 |
bc649d9a
|
Leszek Koltunski
|
{
|
172 |
|
|
{6,0,5,1}, // counterclockwise!
|
173 |
|
|
{0,7,3,5},
|
174 |
|
|
{0,6,2,7},
|
175 |
|
|
{4,3,5,1},
|
176 |
|
|
{4,2,7,3},
|
177 |
|
|
{4,1,6,2},
|
178 |
|
|
};
|
179 |
|
|
|
180 |
|
|
private static final double[][] VERTICES_BIG = new double[][]
|
181 |
|
|
{
|
182 |
|
|
{-E/2 ,-E/2+0.25, 0.25},
|
183 |
|
|
{ E/2 , E/2-0.25, -0.25},
|
184 |
|
|
{-E , 0.00, 0.00},
|
185 |
|
|
{ 0.25, E/2 ,-E/2-0.25},
|
186 |
|
|
{-E/2 ,-E/2-0.25, 0.25},
|
187 |
|
|
{ E/2+0.25, -0.25,-E/2 },
|
188 |
|
|
{-E , -0.50, 0.00},
|
189 |
|
|
{ 0.50, 0.00,-E },
|
190 |
|
|
{-E +0.25, E/2 ,-E/2-0.25},
|
191 |
|
|
{ 0.25,-E/2-0.50,-E/2+0.25},
|
192 |
|
|
{-E/2 ,-E/2-0.25,-E -0.25}
|
193 |
|
|
};
|
194 |
|
|
|
195 |
|
|
private static final int[][] VERT_INDEXES_BIG = new int[][]
|
196 |
|
|
{
|
197 |
|
|
{0,1,3,8,2}, // counterclockwise!
|
198 |
|
|
{0,4,9,5,1},
|
199 |
|
|
{ 0,2,6,4},
|
200 |
|
|
{ 1,5,7,3},
|
201 |
|
|
{10,9,4,6},
|
202 |
|
|
{10,9,5,7},
|
203 |
|
|
{10,8,3,7},
|
204 |
|
|
{10,8,2,6}
|
205 |
|
|
};
|
206 |
|
|
|
207 |
62efeeae
|
Leszek Koltunski
|
private static final int[] QUAT_INDEX = new int[]
|
208 |
|
|
{
|
209 |
|
|
0,6,1,2,0,4,6,5,0,1,4,9,5,2
|
210 |
|
|
};
|
211 |
|
|
|
212 |
bc649d9a
|
Leszek Koltunski
|
private static final float[][] STICKERS = new float[][]
|
213 |
|
|
{
|
214 |
74ffd68e
|
Leszek Koltunski
|
{ -0.14400357f, -0.47894150f, 0.50000000f,-0.011045523f, 0.37700626f, 0.36749030f,-0.26699730f, 0.36749026f, -0.46600536f, -0.24499352f }, // Big cubit 1st
|
215 |
|
|
{ 0.36327127f, 0.26393202f,-0.36327127f, 0.500000000f,-0.36327127f,-0.26393202f, 0.36327127f,-0.50000000f }, // Big cubit 2nd
|
216 |
|
|
{ -0.29389262f, -0.50000000f, 0.29389262f,-0.309017000f, 0.29389262f, 0.30901700f,-0.29389262f, 0.50000000f }, // Small cubit 1st
|
217 |
bc649d9a
|
Leszek Koltunski
|
};
|
218 |
|
|
|
219 |
9c06394a
|
Leszek Koltunski
|
private static final ObjectSticker[] mStickers;
|
220 |
|
|
|
221 |
|
|
static
|
222 |
|
|
{
|
223 |
|
|
mStickers = new ObjectSticker[STICKERS.length];
|
224 |
|
|
final float R1 = 0.08f;
|
225 |
|
|
final float R2 = 0.13f;
|
226 |
|
|
final float R3 = 0.11f;
|
227 |
|
|
final float[][] radii = { {R1,R1,R1,R1,R1},{R2,R2,R2,R2},{R3,R3,R3,R3} };
|
228 |
|
|
final float[] strokes = { 0.07f, 0.09f, 0.08f };
|
229 |
|
|
|
230 |
|
|
for(int s=0; s<STICKERS.length; s++)
|
231 |
|
|
{
|
232 |
|
|
mStickers[s] = new ObjectSticker(STICKERS[s],null,radii[s],strokes[s]);
|
233 |
|
|
}
|
234 |
|
|
}
|
235 |
|
|
|
236 |
0ad6b867
|
Leszek Koltunski
|
private int mCurrState;
|
237 |
|
|
private int mIndexExcluded;
|
238 |
|
|
private final ScrambleStateGraph[] mStates;
|
239 |
|
|
|
240 |
bc649d9a
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
241 |
|
|
|
242 |
|
|
TwistyUltimate(int size, Static4D quat, DistortedTexture texture,
|
243 |
|
|
MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
244 |
|
|
{
|
245 |
|
|
super(size, size, quat, texture, mesh, effects, moves, ObjectList.ULTI, res, scrWidth);
|
246 |
0ad6b867
|
Leszek Koltunski
|
|
247 |
|
|
int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
|
248 |
|
|
|
249 |
|
|
mStates = new ScrambleStateGraph[]
|
250 |
|
|
{
|
251 |
|
|
new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
|
252 |
|
|
};
|
253 |
bc649d9a
|
Leszek Koltunski
|
}
|
254 |
|
|
|
255 |
a480ee80
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
256 |
|
|
|
257 |
|
|
int[] getSolvedQuats(int cubit, int numLayers)
|
258 |
|
|
{
|
259 |
|
|
int status = retCubitSolvedStatus(cubit,numLayers);
|
260 |
|
|
return status<0 ? null : buildSolvedQuats(MovementUltimate.FACE_AXIS[status],QUATS);
|
261 |
|
|
}
|
262 |
|
|
|
263 |
bc649d9a
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
264 |
|
|
|
265 |
acf165d9
|
Leszek Koltunski
|
ObjectShape getObjectShape(int cubit, int numLayers)
|
266 |
bc649d9a
|
Leszek Koltunski
|
{
|
267 |
acf165d9
|
Leszek Koltunski
|
int variant = getCubitVariant(cubit,numLayers);
|
268 |
bc649d9a
|
Leszek Koltunski
|
|
269 |
acf165d9
|
Leszek Koltunski
|
if( variant==0 )
|
270 |
bc649d9a
|
Leszek Koltunski
|
{
|
271 |
acf165d9
|
Leszek Koltunski
|
float[][] bands = new float[][] { {0.03f,17,0.5f,0.2f,5,2,2}, {0.01f, 1,0.5f,0.2f,5,2,2} };
|
272 |
|
|
int[] bandIndices = new int[] { 0,0,0,1,1,1 };
|
273 |
|
|
float[][] corners = new float[][] { { 0.013f, 0.08f } };
|
274 |
|
|
int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 };
|
275 |
|
|
float[][] centers = new float[][] { { 0.0f,-0.5f, -(SQ5+3)/4 } };
|
276 |
|
|
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
|
277 |
|
|
return new ObjectShape(VERTICES_SMALL_RIGHT,VERT_INDEXES_SMALL_RIGHT,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
278 |
bc649d9a
|
Leszek Koltunski
|
}
|
279 |
acf165d9
|
Leszek Koltunski
|
else if( variant==1 )
|
280 |
bc649d9a
|
Leszek Koltunski
|
{
|
281 |
acf165d9
|
Leszek Koltunski
|
float[][] bands = new float[][] { {0.03f,17,0.5f,0.2f,5,2,2}, {0.01f, 1,0.5f,0.2f,5,2,2} };
|
282 |
|
|
int[] bandIndices = new int[] { 0,0,0,1,1,1 };
|
283 |
|
|
float[][] corners = new float[][] { { 0.013f, 0.08f } };
|
284 |
|
|
int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 };
|
285 |
|
|
float[][] centers = new float[][] { { 0.0f,-0.5f, -(SQ5+3)/4 } };
|
286 |
|
|
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
|
287 |
|
|
return new ObjectShape(VERTICES_SMALL_LEFT,VERT_INDEXES_SMALL_LEFT,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
288 |
62efeeae
|
Leszek Koltunski
|
}
|
289 |
|
|
else
|
290 |
|
|
{
|
291 |
acf165d9
|
Leszek Koltunski
|
float[][] bands = new float[][] { {0.04f,17,0.5f,0.2f,5,2,2}, {0.03f,17,0.5f,0.2f,5,2,2}, {0.01f, 1,0.5f,0.2f,5,2,2} };
|
292 |
|
|
int[] bandIndices = new int[] { 0,0,1,1,2,2,2,2 };
|
293 |
|
|
float[][] corners = new float[][] { { 0.013f, 0.08f } };
|
294 |
|
|
int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,-1 };
|
295 |
|
|
float[][] centers = new float[][] { { -(SQ5+1)/8, 0.25f, -(SQ5+5)/8 } };
|
296 |
|
|
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,0 };
|
297 |
|
|
return new ObjectShape(VERTICES_BIG,VERT_INDEXES_BIG,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
298 |
bc649d9a
|
Leszek Koltunski
|
}
|
299 |
acf165d9
|
Leszek Koltunski
|
}
|
300 |
bc649d9a
|
Leszek Koltunski
|
|
301 |
acf165d9
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
302 |
bc649d9a
|
Leszek Koltunski
|
|
303 |
3e605536
|
Leszek Koltunski
|
Static4D getQuat(int cubit, int numLayers)
|
304 |
acf165d9
|
Leszek Koltunski
|
{
|
305 |
|
|
return QUATS[QUAT_INDEX[cubit]];
|
306 |
bc649d9a
|
Leszek Koltunski
|
}
|
307 |
|
|
|
308 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
309 |
|
|
|
310 |
3e605536
|
Leszek Koltunski
|
int getNumCubitVariants(int numLayers)
|
311 |
bc649d9a
|
Leszek Koltunski
|
{
|
312 |
acf165d9
|
Leszek Koltunski
|
return 3;
|
313 |
|
|
}
|
314 |
|
|
|
315 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
316 |
|
|
|
317 |
|
|
int getCubitVariant(int cubit, int numLayers)
|
318 |
|
|
{
|
319 |
|
|
return cubit<4 ? 0 : (cubit<8 ? 1:2);
|
320 |
bc649d9a
|
Leszek Koltunski
|
}
|
321 |
|
|
|
322 |
acf165d9
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
323 |
|
|
|
324 |
|
|
float[][] getCubitPositions(int numLayers)
|
325 |
|
|
{
|
326 |
|
|
return CENTERS;
|
327 |
bc649d9a
|
Leszek Koltunski
|
}
|
328 |
|
|
|
329 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
330 |
|
|
|
331 |
9c06394a
|
Leszek Koltunski
|
int getFaceColor(int cubit, int cubitface, int size)
|
332 |
bc649d9a
|
Leszek Koltunski
|
{
|
333 |
9c06394a
|
Leszek Koltunski
|
return mFaceMap[cubit][cubitface];
|
334 |
|
|
}
|
335 |
74ffd68e
|
Leszek Koltunski
|
|
336 |
9c06394a
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
337 |
bc649d9a
|
Leszek Koltunski
|
|
338 |
9c06394a
|
Leszek Koltunski
|
int getColor(int face)
|
339 |
|
|
{
|
340 |
|
|
return FACE_COLORS[face];
|
341 |
bc649d9a
|
Leszek Koltunski
|
}
|
342 |
|
|
|
343 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
344 |
|
|
|
345 |
9c06394a
|
Leszek Koltunski
|
ObjectSticker retSticker(int face)
|
346 |
bc649d9a
|
Leszek Koltunski
|
{
|
347 |
9c06394a
|
Leszek Koltunski
|
return mStickers[face/NUM_FACES];
|
348 |
bc649d9a
|
Leszek Koltunski
|
}
|
349 |
|
|
|
350 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
351 |
|
|
|
352 |
|
|
float returnMultiplier()
|
353 |
|
|
{
|
354 |
74ffd68e
|
Leszek Koltunski
|
return 1.0f;
|
355 |
bc649d9a
|
Leszek Koltunski
|
}
|
356 |
|
|
|
357 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
358 |
|
|
|
359 |
|
|
Static4D[] getQuats()
|
360 |
|
|
{
|
361 |
|
|
return QUATS;
|
362 |
|
|
}
|
363 |
|
|
|
364 |
169219a7
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
365 |
|
|
|
366 |
|
|
int getSolvedFunctionIndex()
|
367 |
|
|
{
|
368 |
|
|
return 0;
|
369 |
|
|
}
|
370 |
|
|
|
371 |
bc649d9a
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
372 |
|
|
|
373 |
|
|
boolean shouldResetTextureMaps()
|
374 |
|
|
{
|
375 |
|
|
return false;
|
376 |
|
|
}
|
377 |
|
|
|
378 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
379 |
|
|
|
380 |
|
|
int getNumFaces()
|
381 |
|
|
{
|
382 |
|
|
return FACE_COLORS.length;
|
383 |
|
|
}
|
384 |
|
|
|
385 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
386 |
|
|
|
387 |
e6734aa9
|
Leszek Koltunski
|
float[][] getCuts(int numLayers)
|
388 |
bc649d9a
|
Leszek Koltunski
|
{
|
389 |
e6734aa9
|
Leszek Koltunski
|
float[] cut = new float[] {0.0f};
|
390 |
|
|
return new float[][] { cut,cut,cut,cut };
|
391 |
bc649d9a
|
Leszek Koltunski
|
}
|
392 |
|
|
|
393 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
394 |
|
|
|
395 |
|
|
int getNumStickerTypes(int numLayers)
|
396 |
|
|
{
|
397 |
|
|
return STICKERS.length;
|
398 |
|
|
}
|
399 |
|
|
|
400 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
401 |
|
|
|
402 |
|
|
int getNumCubitFaces()
|
403 |
|
|
{
|
404 |
|
|
return 8;
|
405 |
|
|
}
|
406 |
|
|
|
407 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
408 |
|
|
|
409 |
|
|
float getScreenRatio()
|
410 |
|
|
{
|
411 |
62efeeae
|
Leszek Koltunski
|
return 0.67f;
|
412 |
bc649d9a
|
Leszek Koltunski
|
}
|
413 |
|
|
|
414 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
415 |
|
|
// PUBLIC API
|
416 |
|
|
|
417 |
|
|
public Static3D[] getRotationAxis()
|
418 |
|
|
{
|
419 |
|
|
return ROT_AXIS;
|
420 |
|
|
}
|
421 |
|
|
|
422 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
423 |
|
|
|
424 |
925ed78f
|
Leszek Koltunski
|
public int[] getBasicAngle()
|
425 |
bc649d9a
|
Leszek Koltunski
|
{
|
426 |
925ed78f
|
Leszek Koltunski
|
return BASIC_ANGLE;
|
427 |
bc649d9a
|
Leszek Koltunski
|
}
|
428 |
|
|
|
429 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
430 |
|
|
|
431 |
0ad6b867
|
Leszek Koltunski
|
public void randomizeNewScramble(int[][] scramble, Random rnd, int curr, int totalScrambles)
|
432 |
bc649d9a
|
Leszek Koltunski
|
{
|
433 |
9f171eba
|
Leszek Koltunski
|
if( curr==0 )
|
434 |
bc649d9a
|
Leszek Koltunski
|
{
|
435 |
0ad6b867
|
Leszek Koltunski
|
mCurrState = 0;
|
436 |
|
|
mIndexExcluded =-1;
|
437 |
bc649d9a
|
Leszek Koltunski
|
}
|
438 |
|
|
|
439 |
0ad6b867
|
Leszek Koltunski
|
int total = mStates[mCurrState].getTotal(mIndexExcluded);
|
440 |
|
|
int random= rnd.nextInt(total);
|
441 |
|
|
int[] info= mStates[mCurrState].getInfo(random,mIndexExcluded);
|
442 |
bc649d9a
|
Leszek Koltunski
|
|
443 |
0ad6b867
|
Leszek Koltunski
|
scramble[curr][0] = info[0];
|
444 |
|
|
scramble[curr][1] = info[1];
|
445 |
|
|
scramble[curr][2] = info[2];
|
446 |
|
|
|
447 |
|
|
mCurrState = info[3];
|
448 |
|
|
mIndexExcluded = info[0];
|
449 |
bc649d9a
|
Leszek Koltunski
|
}
|
450 |
|
|
|
451 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
452 |
|
|
|
453 |
|
|
public int getObjectName(int numLayers)
|
454 |
|
|
{
|
455 |
|
|
return R.string.ulti2;
|
456 |
|
|
}
|
457 |
|
|
|
458 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
459 |
|
|
|
460 |
|
|
public int getInventor(int numLayers)
|
461 |
|
|
{
|
462 |
|
|
return R.string.ulti2_inventor;
|
463 |
|
|
}
|
464 |
|
|
|
465 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
466 |
|
|
|
467 |
|
|
public int getComplexity(int numLayers)
|
468 |
|
|
{
|
469 |
|
|
return 6;
|
470 |
|
|
}
|
471 |
|
|
}
|