Revision 8becce57
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/RubikObject.java | ||
---|---|---|
220 | 220 |
rotationAngle.add(mRotationAngleFinal); |
221 | 221 |
} |
222 | 222 |
|
223 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
224 |
// TODO |
|
225 |
// rotV : 0 --> VECTX, 1--> VECTY, 2 --> VECTZ |
|
226 |
// rotRC: 01010 --> move the 2nd and 4th layer |
|
227 |
// rotA : counterclockwise by rotA*90 degrees |
|
228 |
|
|
229 |
private boolean scheduleMultiRotation(int rotV, int rotRC, int rotA) |
|
230 |
{ |
|
231 |
/* |
|
232 |
int index, tmp; |
|
233 |
|
|
234 |
if( numRotations>0 ) |
|
235 |
{ |
|
236 |
if( rotVector!=rotV ) return false; |
|
237 |
|
|
238 |
index=0; |
|
239 |
tmp=rotRC; |
|
240 |
|
|
241 |
while( tmp!=0 ) |
|
242 |
{ |
|
243 |
if( (tmp&0x1)==1 && rotAngle[index]!=0 ) return false; |
|
244 |
index++; |
|
245 |
tmp/=2; |
|
246 |
} |
|
247 |
} |
|
248 |
|
|
249 |
index=0; |
|
250 |
tmp=rotRC; |
|
251 |
rotVector = rotV; |
|
252 |
|
|
253 |
while( tmp!=0 ) |
|
254 |
{ |
|
255 |
if( (tmp&0x1)==1 ) |
|
256 |
{ |
|
257 |
rotAngle[index] = rotA*90; |
|
258 |
rotSpeed[index] = (int)(rotS/RubikWorld.hardwareSpeed); |
|
259 |
|
|
260 |
if( rotSpeed[index]<=0 && rotS>0 ) rotSpeed[index] = 1; |
|
261 |
if( rotSpeed[index]>=0 && rotS<0 ) rotSpeed[index] =-1; |
|
262 |
|
|
263 |
numRotations++; |
|
264 |
} |
|
265 |
|
|
266 |
index++; |
|
267 |
tmp/=2; |
|
268 |
} |
|
269 |
*/ |
|
270 |
return true; |
|
271 |
} |
|
272 |
|
|
273 | 223 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
274 | 224 |
// TODO |
275 | 225 |
|
... | ... | |
571 | 521 |
mRotationAngleStatic.set0(0); |
572 | 522 |
} |
573 | 523 |
|
574 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
575 |
|
|
576 |
public boolean makeMove(String move) |
|
577 |
{ |
|
578 |
int a1=move.charAt(1)-'0'; |
|
579 |
int a2=move.charAt(2)-'0'; |
|
580 |
int a3=move.charAt(3)-'0'; |
|
581 |
|
|
582 |
int rotVector = (10*a1+a2)/32; |
|
583 |
int rotBitmap = (10*a1+a2)%32; |
|
584 |
int rotAngle = 2-a3; |
|
585 |
|
|
586 |
return scheduleMultiRotation(rotVector, rotBitmap, rotAngle); |
|
587 |
} |
|
588 |
|
|
589 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
590 |
|
|
591 |
public boolean backMove(String move) |
|
592 |
{ |
|
593 |
int a1=move.charAt(1)-'0'; |
|
594 |
int a2=move.charAt(2)-'0'; |
|
595 |
int a3=move.charAt(3)-'0'; |
|
596 |
|
|
597 |
int rotVector = (10*a1+a2)/32; |
|
598 |
int rotBitmap = (10*a1+a2)%32; |
|
599 |
int rotAngle = a3-2; |
|
600 |
|
|
601 |
return scheduleMultiRotation(rotVector, rotBitmap, rotAngle); |
|
602 |
} |
|
603 |
|
|
604 | 524 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
605 | 525 |
|
606 | 526 |
public void initializeObject(String moves) |
Also available in: Unified diff
Major progress with Prretty Patterns - hopefully only initializing the Object remains!