Revision beee90ab
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/objectlib/main/ObjectPreRender.java | ||
---|---|---|
306 | 306 |
mController.setQuat(); |
307 | 307 |
} |
308 | 308 |
|
309 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
310 |
|
|
311 |
private int computeRowFromBitmap(int rowBitmap) |
|
312 |
{ |
|
313 |
int index = 0; |
|
314 |
|
|
315 |
while(index<32) |
|
316 |
{ |
|
317 |
if( (rowBitmap&0x1) != 0 ) return index; |
|
318 |
rowBitmap>>=1; |
|
319 |
index++; |
|
320 |
} |
|
321 |
|
|
322 |
return 0; |
|
323 |
} |
|
324 |
|
|
309 | 325 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
310 | 326 |
|
311 | 327 |
void rememberMove(int axis, int row, int angle) |
... | ... | |
518 | 534 |
|
519 | 535 |
public void addRotation(MovesFinished listener, int axis, int rowBitmap, int bareAngle, int millPreDegree) |
520 | 536 |
{ |
521 |
int[] angles = mNewObject.getBasicAngles();
|
|
537 |
int[][] basicAngles = mNewObject.getBasicAngles();
|
|
522 | 538 |
|
523 |
if( angles.length>axis )
|
|
539 |
if( basicAngles.length>axis )
|
|
524 | 540 |
{ |
525 | 541 |
mAddRotation = true; |
526 | 542 |
|
527 |
int basicAngle= angles[axis]; |
|
543 |
int row = computeRowFromBitmap(rowBitmap); |
|
544 |
int basicAngle= basicAngles[axis][row]; |
|
528 | 545 |
int angle = bareAngle*(360/basicAngle); |
529 | 546 |
int duration = Math.abs(angle)*millPreDegree; |
530 | 547 |
|
Also available in: Unified diff
Preparation for Mixup Cube: take advantage of the recent bump in MAJOR_VERSION number and change the format of basicAngles to int[][] 'per-axis-per-layer' [ Mixup Cube has different basicAngle in its middle layers (8) - and different in its edge layers (4) ]