37 |
37 |
|
38 |
38 |
public class TwistyHelicopter extends TwistyObject
|
39 |
39 |
{
|
40 |
|
private static final int FACES_PER_CUBIT =6;
|
41 |
|
|
42 |
40 |
// the six rotation axis of a Helicopter. Must be normalized.
|
43 |
41 |
static final Static3D[] ROT_AXIS = new Static3D[]
|
44 |
42 |
{
|
... | ... | |
50 |
48 |
new Static3D(-SQ2/2, -SQ2/2, 0)
|
51 |
49 |
};
|
52 |
50 |
|
53 |
|
private static final int[] BASIC_ANGLE = new int[] { 2,2,2,2,2,2 };
|
54 |
|
|
55 |
51 |
private static final int[] FACE_COLORS = new int[]
|
56 |
52 |
{
|
57 |
53 |
COLOR_YELLOW, COLOR_WHITE,
|
... | ... | |
59 |
55 |
COLOR_RED , COLOR_ORANGE
|
60 |
56 |
};
|
61 |
57 |
|
62 |
|
// All legal rotation quats of a HELICOPTER (same as the Cube!)
|
63 |
|
private static final Static4D[] QUATS = new Static4D[]
|
64 |
|
{
|
65 |
|
new Static4D( 0.00f, 0.00f, 0.00f, 1.00f ),
|
66 |
|
new Static4D( 1.00f, 0.00f, 0.00f, 0.00f ),
|
67 |
|
new Static4D( 0.00f, 1.00f, 0.00f, 0.00f ),
|
68 |
|
new Static4D( 0.00f, 0.00f, 1.00f, 0.00f ),
|
69 |
|
|
70 |
|
new Static4D( SQ2/2, SQ2/2, 0.00f, 0.00f ),
|
71 |
|
new Static4D( SQ2/2, -SQ2/2, 0.00f, 0.00f ),
|
72 |
|
new Static4D( SQ2/2, 0.00f, SQ2/2, 0.00f ),
|
73 |
|
new Static4D( SQ2/2, 0.00f, -SQ2/2, 0.00f ),
|
74 |
|
new Static4D( SQ2/2, 0.00f, 0.00f, SQ2/2 ),
|
75 |
|
new Static4D( SQ2/2, 0.00f, 0.00f, -SQ2/2 ),
|
76 |
|
new Static4D( 0.00f, SQ2/2, SQ2/2, 0.00f ),
|
77 |
|
new Static4D( 0.00f, SQ2/2, -SQ2/2, 0.00f ),
|
78 |
|
new Static4D( 0.00f, SQ2/2, 0.00f, SQ2/2 ),
|
79 |
|
new Static4D( 0.00f, SQ2/2, 0.00f, -SQ2/2 ),
|
80 |
|
new Static4D( 0.00f, 0.00f, SQ2/2, SQ2/2 ),
|
81 |
|
new Static4D( 0.00f, 0.00f, SQ2/2, -SQ2/2 ),
|
82 |
|
|
83 |
|
new Static4D( 0.50f, 0.50f, 0.50f, 0.50f ),
|
84 |
|
new Static4D( 0.50f, 0.50f, 0.50f, -0.50f ),
|
85 |
|
new Static4D( 0.50f, 0.50f, -0.50f, 0.50f ),
|
86 |
|
new Static4D( 0.50f, 0.50f, -0.50f, -0.50f ),
|
87 |
|
new Static4D( 0.50f, -0.50f, 0.50f, 0.50f ),
|
88 |
|
new Static4D( 0.50f, -0.50f, 0.50f, -0.50f ),
|
89 |
|
new Static4D( 0.50f, -0.50f, -0.50f, 0.50f ),
|
90 |
|
new Static4D( 0.50f, -0.50f, -0.50f, -0.50f )
|
91 |
|
};
|
92 |
|
|
93 |
|
private static final float DIST_CORNER = 0.50f;
|
94 |
|
private static final float DIST_CENTER = 0.50f;
|
95 |
|
private static final float XY_CENTER = DIST_CORNER/3;
|
96 |
|
|
97 |
|
// centers of the 8 corners + 6*4 face triangles ( i.e. of the all 32 cubits)
|
98 |
|
private static final float[][] CENTERS = new float[][]
|
99 |
|
{
|
100 |
|
{ DIST_CORNER, DIST_CORNER, DIST_CORNER },
|
101 |
|
{ DIST_CORNER, DIST_CORNER, -DIST_CORNER },
|
102 |
|
{ DIST_CORNER, -DIST_CORNER, DIST_CORNER },
|
103 |
|
{ DIST_CORNER, -DIST_CORNER, -DIST_CORNER },
|
104 |
|
{ -DIST_CORNER, DIST_CORNER, DIST_CORNER },
|
105 |
|
{ -DIST_CORNER, DIST_CORNER, -DIST_CORNER },
|
106 |
|
{ -DIST_CORNER, -DIST_CORNER, DIST_CORNER },
|
107 |
|
{ -DIST_CORNER, -DIST_CORNER, -DIST_CORNER },
|
108 |
|
|
109 |
|
{ DIST_CENTER, XY_CENTER, XY_CENTER },
|
110 |
|
{ DIST_CENTER, XY_CENTER, -XY_CENTER },
|
111 |
|
{ DIST_CENTER, -XY_CENTER, XY_CENTER },
|
112 |
|
{ DIST_CENTER, -XY_CENTER, -XY_CENTER },
|
113 |
|
|
114 |
|
{ -DIST_CENTER, XY_CENTER, XY_CENTER },
|
115 |
|
{ -DIST_CENTER, XY_CENTER, -XY_CENTER },
|
116 |
|
{ -DIST_CENTER, -XY_CENTER, XY_CENTER },
|
117 |
|
{ -DIST_CENTER, -XY_CENTER, -XY_CENTER },
|
118 |
|
|
119 |
|
{ XY_CENTER , DIST_CENTER, XY_CENTER },
|
120 |
|
{ XY_CENTER , DIST_CENTER, -XY_CENTER },
|
121 |
|
{ -XY_CENTER , DIST_CENTER, XY_CENTER },
|
122 |
|
{ -XY_CENTER , DIST_CENTER, -XY_CENTER },
|
123 |
|
|
124 |
|
{ XY_CENTER , -DIST_CENTER, XY_CENTER },
|
125 |
|
{ XY_CENTER , -DIST_CENTER, -XY_CENTER },
|
126 |
|
{ -XY_CENTER , -DIST_CENTER, XY_CENTER },
|
127 |
|
{ -XY_CENTER , -DIST_CENTER, -XY_CENTER },
|
128 |
|
|
129 |
|
{ XY_CENTER , XY_CENTER, DIST_CENTER },
|
130 |
|
{ XY_CENTER , -XY_CENTER, DIST_CENTER },
|
131 |
|
{ -XY_CENTER , XY_CENTER, DIST_CENTER },
|
132 |
|
{ -XY_CENTER , -XY_CENTER, DIST_CENTER },
|
133 |
|
|
134 |
|
{ XY_CENTER , XY_CENTER, -DIST_CENTER },
|
135 |
|
{ XY_CENTER , -XY_CENTER, -DIST_CENTER },
|
136 |
|
{ -XY_CENTER , XY_CENTER, -DIST_CENTER },
|
137 |
|
{ -XY_CENTER , -XY_CENTER, -DIST_CENTER },
|
138 |
|
};
|
139 |
|
|
140 |
|
// Colors of the faces of cubits. Each cubit has 6 faces
|
141 |
|
private static final int[][] mFaceMap = new int[][]
|
142 |
|
{
|
143 |
|
{ 4,2,0, 6,6,6 },
|
144 |
|
{ 0,2,5, 6,6,6 },
|
145 |
|
{ 4,0,3, 6,6,6 },
|
146 |
|
{ 5,3,0, 6,6,6 },
|
147 |
|
{ 1,2,4, 6,6,6 },
|
148 |
|
{ 5,2,1, 6,6,6 },
|
149 |
|
{ 4,3,1, 6,6,6 },
|
150 |
|
{ 1,3,5, 6,6,6 },
|
151 |
|
|
152 |
|
{ 0 , 6,6,6,6,6 },
|
153 |
|
{ 0 , 6,6,6,6,6 },
|
154 |
|
{ 0 , 6,6,6,6,6 },
|
155 |
|
{ 0 , 6,6,6,6,6 },
|
156 |
|
|
157 |
|
{ 1 , 6,6,6,6,6 },
|
158 |
|
{ 1 , 6,6,6,6,6 },
|
159 |
|
{ 1 , 6,6,6,6,6 },
|
160 |
|
{ 1 , 6,6,6,6,6 },
|
161 |
|
|
162 |
|
{ 2 , 6,6,6,6,6 },
|
163 |
|
{ 2 , 6,6,6,6,6 },
|
164 |
|
{ 2 , 6,6,6,6,6 },
|
165 |
|
{ 2 , 6,6,6,6,6 },
|
166 |
|
|
167 |
|
{ 3 , 6,6,6,6,6 },
|
168 |
|
{ 3 , 6,6,6,6,6 },
|
169 |
|
{ 3 , 6,6,6,6,6 },
|
170 |
|
{ 3 , 6,6,6,6,6 },
|
171 |
|
|
172 |
|
{ 4 , 6,6,6,6,6 },
|
173 |
|
{ 4 , 6,6,6,6,6 },
|
174 |
|
{ 4 , 6,6,6,6,6 },
|
175 |
|
{ 4 , 6,6,6,6,6 },
|
176 |
|
|
177 |
|
{ 5 , 6,6,6,6,6 },
|
178 |
|
{ 5 , 6,6,6,6,6 },
|
179 |
|
{ 5 , 6,6,6,6,6 },
|
180 |
|
{ 5 , 6,6,6,6,6 },
|
181 |
|
};
|
182 |
|
|
183 |
|
private static final int[] QUAT_INDICES =
|
184 |
|
{ 0,13,14,1,12,2,3,7,20,6,13,17,7,23,18,12,22,10,8,16,11,21,19,9,3,15,14,0,5,2,1,4 };
|
185 |
|
|
186 |
|
private static final double[][] VERTICES_CORNER = new double[][]
|
187 |
|
{
|
188 |
|
{-0.50f, 0.00f, 0.00f},
|
189 |
|
{ 0.00f,-0.50f, 0.00f},
|
190 |
|
{ 0.00f, 0.00f,-0.50f},
|
191 |
|
{-0.25f,-0.25f,-0.25f},
|
192 |
|
{ 0.00f, 0.00f, 0.00f}
|
193 |
|
};
|
194 |
|
|
195 |
|
private static final int[][] VERT_INDEXES_CORNER = new int[][]
|
196 |
|
{
|
197 |
|
{0,1,4},
|
198 |
|
{2,0,4},
|
199 |
|
{1,2,4},
|
200 |
|
{3,1,0},
|
201 |
|
{3,2,1},
|
202 |
|
{3,0,2}
|
203 |
|
};
|
204 |
|
|
205 |
|
private static final float E = 0.1666666f;
|
206 |
|
|
207 |
|
private static final double[][] VERTICES_FACE = new double[][]
|
208 |
|
{
|
209 |
|
{ 0.00f +E, 0.00f +E, 0.00f },
|
210 |
|
{-0.50f +E, 0.00f +E, 0.00f },
|
211 |
|
{ 0.00f +E,-0.50f +E, 0.00f },
|
212 |
|
{-0.25f +E,-0.25f +E,-0.25f },
|
213 |
|
};
|
214 |
|
|
215 |
|
private static final int[][] VERT_INDEXES_FACE = new int[][]
|
216 |
|
{
|
217 |
|
{ 0,1,2 },
|
218 |
|
{ 2,1,3 },
|
219 |
|
{ 0,1,3 },
|
220 |
|
{ 2,0,3 }
|
221 |
|
};
|
222 |
|
|
223 |
|
private static final float[][] STICKERS = new float[][]
|
224 |
|
{
|
225 |
|
{ -0.5f, 0.25f, 0.25f, -0.5f, 0.25f, 0.25f }
|
226 |
|
};
|
227 |
|
|
228 |
|
private static final ObjectSticker[] mStickers;
|
229 |
|
|
230 |
|
static
|
231 |
|
{
|
232 |
|
float radius = 0.03f;
|
233 |
|
float stroke = 0.05f;
|
234 |
|
float[] radii = new float[] {radius,radius,radius};
|
235 |
|
mStickers = new ObjectSticker[STICKERS.length];
|
236 |
|
mStickers[0] = new ObjectSticker(STICKERS[0],null,radii,stroke);
|
237 |
|
}
|
|
58 |
private static final int FACES_PER_CUBIT =6;
|
238 |
59 |
|
239 |
60 |
private int mCurrState;
|
240 |
61 |
private int mIndexExcluded;
|
241 |
62 |
private final ScrambleState[] mStates;
|
242 |
63 |
private int[][] mScrambleTable;
|
243 |
64 |
private int[] mNumOccurences;
|
|
65 |
private int[] mBasicAngle;
|
|
66 |
private Static4D[] mQuats;
|
|
67 |
private float[][] mCenters;
|
|
68 |
private int[] mQuatIndices;
|
|
69 |
private int[][] mFaceMap;
|
|
70 |
private ObjectSticker[] mStickers;
|
244 |
71 |
|
245 |
72 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
246 |
73 |
|
... | ... | |
267 |
94 |
};
|
268 |
95 |
}
|
269 |
96 |
|
|
97 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
98 |
|
|
99 |
private void initializeQuats()
|
|
100 |
{
|
|
101 |
mQuats = new Static4D[]
|
|
102 |
{
|
|
103 |
new Static4D( 0.00f, 0.00f, 0.00f, 1.00f ),
|
|
104 |
new Static4D( 1.00f, 0.00f, 0.00f, 0.00f ),
|
|
105 |
new Static4D( 0.00f, 1.00f, 0.00f, 0.00f ),
|
|
106 |
new Static4D( 0.00f, 0.00f, 1.00f, 0.00f ),
|
|
107 |
|
|
108 |
new Static4D( SQ2/2, SQ2/2, 0.00f, 0.00f ),
|
|
109 |
new Static4D( SQ2/2, -SQ2/2, 0.00f, 0.00f ),
|
|
110 |
new Static4D( SQ2/2, 0.00f, SQ2/2, 0.00f ),
|
|
111 |
new Static4D( SQ2/2, 0.00f, -SQ2/2, 0.00f ),
|
|
112 |
new Static4D( SQ2/2, 0.00f, 0.00f, SQ2/2 ),
|
|
113 |
new Static4D( SQ2/2, 0.00f, 0.00f, -SQ2/2 ),
|
|
114 |
new Static4D( 0.00f, SQ2/2, SQ2/2, 0.00f ),
|
|
115 |
new Static4D( 0.00f, SQ2/2, -SQ2/2, 0.00f ),
|
|
116 |
new Static4D( 0.00f, SQ2/2, 0.00f, SQ2/2 ),
|
|
117 |
new Static4D( 0.00f, SQ2/2, 0.00f, -SQ2/2 ),
|
|
118 |
new Static4D( 0.00f, 0.00f, SQ2/2, SQ2/2 ),
|
|
119 |
new Static4D( 0.00f, 0.00f, SQ2/2, -SQ2/2 ),
|
|
120 |
|
|
121 |
new Static4D( 0.50f, 0.50f, 0.50f, 0.50f ),
|
|
122 |
new Static4D( 0.50f, 0.50f, 0.50f, -0.50f ),
|
|
123 |
new Static4D( 0.50f, 0.50f, -0.50f, 0.50f ),
|
|
124 |
new Static4D( 0.50f, 0.50f, -0.50f, -0.50f ),
|
|
125 |
new Static4D( 0.50f, -0.50f, 0.50f, 0.50f ),
|
|
126 |
new Static4D( 0.50f, -0.50f, 0.50f, -0.50f ),
|
|
127 |
new Static4D( 0.50f, -0.50f, -0.50f, 0.50f ),
|
|
128 |
new Static4D( 0.50f, -0.50f, -0.50f, -0.50f )
|
|
129 |
};
|
|
130 |
}
|
|
131 |
|
270 |
132 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
271 |
133 |
|
272 |
134 |
int[] getSolvedQuats(int cubit, int numLayers)
|
273 |
135 |
{
|
|
136 |
if( mQuats==null ) initializeQuats();
|
274 |
137 |
int status = retCubitSolvedStatus(cubit,numLayers);
|
275 |
|
return status<0 ? null : buildSolvedQuats(MovementHelicopter.FACE_AXIS[status],QUATS);
|
|
138 |
return status<0 ? null : buildSolvedQuats(MovementHelicopter.FACE_AXIS[status],mQuats);
|
276 |
139 |
}
|
277 |
140 |
|
278 |
141 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
286 |
149 |
|
287 |
150 |
Static4D[] getQuats()
|
288 |
151 |
{
|
289 |
|
return QUATS;
|
|
152 |
if( mQuats==null ) initializeQuats();
|
|
153 |
return mQuats;
|
290 |
154 |
}
|
291 |
155 |
|
292 |
156 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
314 |
178 |
|
315 |
179 |
int getNumStickerTypes(int numLayers)
|
316 |
180 |
{
|
317 |
|
return STICKERS.length;
|
|
181 |
return 1;
|
318 |
182 |
}
|
319 |
183 |
|
320 |
184 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
336 |
200 |
|
337 |
201 |
float[][] getCubitPositions(int size)
|
338 |
202 |
{
|
339 |
|
return CENTERS;
|
|
203 |
if( mCenters==null )
|
|
204 |
{
|
|
205 |
float DIST_CORNER = 0.50f;
|
|
206 |
float DIST_CENTER = 0.50f;
|
|
207 |
float XY_CENTER = DIST_CORNER/3;
|
|
208 |
|
|
209 |
mCenters = new float[][]
|
|
210 |
{
|
|
211 |
{ DIST_CORNER, DIST_CORNER, DIST_CORNER },
|
|
212 |
{ DIST_CORNER, DIST_CORNER, -DIST_CORNER },
|
|
213 |
{ DIST_CORNER, -DIST_CORNER, DIST_CORNER },
|
|
214 |
{ DIST_CORNER, -DIST_CORNER, -DIST_CORNER },
|
|
215 |
{ -DIST_CORNER, DIST_CORNER, DIST_CORNER },
|
|
216 |
{ -DIST_CORNER, DIST_CORNER, -DIST_CORNER },
|
|
217 |
{ -DIST_CORNER, -DIST_CORNER, DIST_CORNER },
|
|
218 |
{ -DIST_CORNER, -DIST_CORNER, -DIST_CORNER },
|
|
219 |
|
|
220 |
{ DIST_CENTER, XY_CENTER, XY_CENTER },
|
|
221 |
{ DIST_CENTER, XY_CENTER, -XY_CENTER },
|
|
222 |
{ DIST_CENTER, -XY_CENTER, XY_CENTER },
|
|
223 |
{ DIST_CENTER, -XY_CENTER, -XY_CENTER },
|
|
224 |
|
|
225 |
{ -DIST_CENTER, XY_CENTER, XY_CENTER },
|
|
226 |
{ -DIST_CENTER, XY_CENTER, -XY_CENTER },
|
|
227 |
{ -DIST_CENTER, -XY_CENTER, XY_CENTER },
|
|
228 |
{ -DIST_CENTER, -XY_CENTER, -XY_CENTER },
|
|
229 |
|
|
230 |
{ XY_CENTER , DIST_CENTER, XY_CENTER },
|
|
231 |
{ XY_CENTER , DIST_CENTER, -XY_CENTER },
|
|
232 |
{ -XY_CENTER , DIST_CENTER, XY_CENTER },
|
|
233 |
{ -XY_CENTER , DIST_CENTER, -XY_CENTER },
|
|
234 |
|
|
235 |
{ XY_CENTER , -DIST_CENTER, XY_CENTER },
|
|
236 |
{ XY_CENTER , -DIST_CENTER, -XY_CENTER },
|
|
237 |
{ -XY_CENTER , -DIST_CENTER, XY_CENTER },
|
|
238 |
{ -XY_CENTER , -DIST_CENTER, -XY_CENTER },
|
|
239 |
|
|
240 |
{ XY_CENTER , XY_CENTER, DIST_CENTER },
|
|
241 |
{ XY_CENTER , -XY_CENTER, DIST_CENTER },
|
|
242 |
{ -XY_CENTER , XY_CENTER, DIST_CENTER },
|
|
243 |
{ -XY_CENTER , -XY_CENTER, DIST_CENTER },
|
|
244 |
|
|
245 |
{ XY_CENTER , XY_CENTER, -DIST_CENTER },
|
|
246 |
{ XY_CENTER , -XY_CENTER, -DIST_CENTER },
|
|
247 |
{ -XY_CENTER , XY_CENTER, -DIST_CENTER },
|
|
248 |
{ -XY_CENTER , -XY_CENTER, -DIST_CENTER },
|
|
249 |
};
|
|
250 |
}
|
|
251 |
|
|
252 |
return mCenters;
|
340 |
253 |
}
|
341 |
254 |
|
342 |
255 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
347 |
260 |
|
348 |
261 |
if( variant==0 )
|
349 |
262 |
{
|
|
263 |
double[][] vertices = new double[][]
|
|
264 |
{
|
|
265 |
{-0.50f, 0.00f, 0.00f},
|
|
266 |
{ 0.00f,-0.50f, 0.00f},
|
|
267 |
{ 0.00f, 0.00f,-0.50f},
|
|
268 |
{-0.25f,-0.25f,-0.25f},
|
|
269 |
{ 0.00f, 0.00f, 0.00f}
|
|
270 |
};
|
|
271 |
|
|
272 |
int[][] vert_indices = new int[][]
|
|
273 |
{
|
|
274 |
{0,1,4},
|
|
275 |
{2,0,4},
|
|
276 |
{1,2,4},
|
|
277 |
{3,1,0},
|
|
278 |
{3,2,1},
|
|
279 |
{3,0,2}
|
|
280 |
};
|
|
281 |
|
350 |
282 |
float[][] bands = new float[][] { {0.028f,35,0.16f,0.7f,7,3,3}, {0.000f, 0,1.00f,0.0f,3,1,5} };
|
351 |
283 |
int[] bandIndices = new int[] { 0,0,0,1,1,1 };
|
352 |
284 |
float[][] corners = new float[][] { {0.08f,0.15f}, {0.08f,0.20f} };
|
353 |
285 |
int[] cornerIndices = new int[] { 1,1,1,0,0 };
|
354 |
286 |
float[][] centers = new float[][] { {-0.25f, -0.25f, -0.25f} };
|
355 |
287 |
int[] centerIndices = new int[] { 0,0,0,-1,0 };
|
356 |
|
return new ObjectShape(VERTICES_CORNER,VERT_INDEXES_CORNER,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
|
288 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
357 |
289 |
}
|
358 |
290 |
else
|
359 |
291 |
{
|
|
292 |
float E = 0.1666666f;
|
|
293 |
|
|
294 |
double[][] vertices = new double[][]
|
|
295 |
{
|
|
296 |
{ 0.00f +E, 0.00f +E, 0.00f },
|
|
297 |
{-0.50f +E, 0.00f +E, 0.00f },
|
|
298 |
{ 0.00f +E,-0.50f +E, 0.00f },
|
|
299 |
{-0.25f +E,-0.25f +E,-0.25f },
|
|
300 |
};
|
|
301 |
|
|
302 |
int[][] vert_indices = new int[][]
|
|
303 |
{
|
|
304 |
{ 0,1,2 },
|
|
305 |
{ 2,1,3 },
|
|
306 |
{ 0,1,3 },
|
|
307 |
{ 2,0,3 }
|
|
308 |
};
|
|
309 |
|
360 |
310 |
float[][] bands = new float[][] { {0.028f,35,0.16f,0.7f,7,3,3}, {0.000f, 0,1.00f,0.0f,3,1,3} };
|
361 |
311 |
int[] bandIndices = new int[] { 0,1,1,1 };
|
362 |
312 |
float[][] corners = new float[][] { {0.06f,0.15f}, {0.06f,0.20f} };
|
363 |
313 |
int[] cornerIndices = new int[] { 0,1,1,-1 };
|
364 |
314 |
float[][] centers = new float[][] { {-1.0f/12, -1.0f/12, -1.0f/4} };
|
365 |
315 |
int[] centerIndices = new int[] { 0,0,0,-1 };
|
366 |
|
return new ObjectShape(VERTICES_FACE,VERT_INDEXES_FACE,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
|
316 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
|
367 |
317 |
}
|
368 |
318 |
}
|
369 |
319 |
|
... | ... | |
371 |
321 |
|
372 |
322 |
Static4D getQuat(int cubit, int numLayers)
|
373 |
323 |
{
|
374 |
|
return QUATS[QUAT_INDICES[cubit]];
|
|
324 |
if( mQuats==null ) initializeQuats();
|
|
325 |
if( mQuatIndices==null ) mQuatIndices = new int[] { 0,13,14,1,12,2,3,7,20,6,13,17,7,23,18,12,22,10,8,16,11,21,19,9,3,15,14,0,5,2,1,4 };
|
|
326 |
return mQuats[mQuatIndices[cubit]];
|
375 |
327 |
}
|
376 |
328 |
|
377 |
329 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
392 |
344 |
|
393 |
345 |
int getFaceColor(int cubit, int cubitface, int size)
|
394 |
346 |
{
|
|
347 |
if( mFaceMap==null )
|
|
348 |
{
|
|
349 |
mFaceMap = new int[][]
|
|
350 |
{
|
|
351 |
{ 4,2,0, 6,6,6 },
|
|
352 |
{ 0,2,5, 6,6,6 },
|
|
353 |
{ 4,0,3, 6,6,6 },
|
|
354 |
{ 5,3,0, 6,6,6 },
|
|
355 |
{ 1,2,4, 6,6,6 },
|
|
356 |
{ 5,2,1, 6,6,6 },
|
|
357 |
{ 4,3,1, 6,6,6 },
|
|
358 |
{ 1,3,5, 6,6,6 },
|
|
359 |
|
|
360 |
{ 0 , 6,6,6,6,6 },
|
|
361 |
{ 0 , 6,6,6,6,6 },
|
|
362 |
{ 0 , 6,6,6,6,6 },
|
|
363 |
{ 0 , 6,6,6,6,6 },
|
|
364 |
|
|
365 |
{ 1 , 6,6,6,6,6 },
|
|
366 |
{ 1 , 6,6,6,6,6 },
|
|
367 |
{ 1 , 6,6,6,6,6 },
|
|
368 |
{ 1 , 6,6,6,6,6 },
|
|
369 |
|
|
370 |
{ 2 , 6,6,6,6,6 },
|
|
371 |
{ 2 , 6,6,6,6,6 },
|
|
372 |
{ 2 , 6,6,6,6,6 },
|
|
373 |
{ 2 , 6,6,6,6,6 },
|
|
374 |
|
|
375 |
{ 3 , 6,6,6,6,6 },
|
|
376 |
{ 3 , 6,6,6,6,6 },
|
|
377 |
{ 3 , 6,6,6,6,6 },
|
|
378 |
{ 3 , 6,6,6,6,6 },
|
|
379 |
|
|
380 |
{ 4 , 6,6,6,6,6 },
|
|
381 |
{ 4 , 6,6,6,6,6 },
|
|
382 |
{ 4 , 6,6,6,6,6 },
|
|
383 |
{ 4 , 6,6,6,6,6 },
|
|
384 |
|
|
385 |
{ 5 , 6,6,6,6,6 },
|
|
386 |
{ 5 , 6,6,6,6,6 },
|
|
387 |
{ 5 , 6,6,6,6,6 },
|
|
388 |
{ 5 , 6,6,6,6,6 },
|
|
389 |
};
|
|
390 |
}
|
|
391 |
|
395 |
392 |
return mFaceMap[cubit][cubitface];
|
396 |
393 |
}
|
397 |
394 |
|
... | ... | |
406 |
403 |
|
407 |
404 |
ObjectSticker retSticker(int face)
|
408 |
405 |
{
|
|
406 |
if( mStickers==null )
|
|
407 |
{
|
|
408 |
float[][] STICKERS = new float[][] { { -0.5f, 0.25f, 0.25f, -0.5f, 0.25f, 0.25f } };
|
|
409 |
float radius = 0.03f;
|
|
410 |
float stroke = 0.05f;
|
|
411 |
float[] radii = new float[] {radius,radius,radius};
|
|
412 |
mStickers = new ObjectSticker[STICKERS.length];
|
|
413 |
mStickers[0] = new ObjectSticker(STICKERS[0],null,radii,stroke);
|
|
414 |
}
|
|
415 |
|
409 |
416 |
return mStickers[face/NUM_FACES];
|
410 |
417 |
}
|
411 |
418 |
|
... | ... | |
476 |
483 |
|
477 |
484 |
public int[] getBasicAngle()
|
478 |
485 |
{
|
479 |
|
return BASIC_ANGLE;
|
|
486 |
if( mBasicAngle ==null ) mBasicAngle = new int[] { 2,2,2,2,2,2 };
|
|
487 |
return mBasicAngle;
|
480 |
488 |
}
|
481 |
489 |
|
482 |
490 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
Remove statics from the Helicopter class.