Revision 97a6aa87
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/objectlib/main/TwistyObject.java | ||
---|---|---|
516 | 516 |
return nonBlackIndex; |
517 | 517 |
} |
518 | 518 |
|
519 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
520 |
|
|
521 |
protected void displayCubitQuats() |
|
522 |
{ |
|
523 |
StringBuilder builder = new StringBuilder(); |
|
524 |
float[] tmp = new float[4]; |
|
525 |
float MAXERR = 0.01f; |
|
526 |
|
|
527 |
for(int cubit=0; cubit<mNumCubits; cubit++) |
|
528 |
{ |
|
529 |
int refCubit,variant = getCubitVariant(cubit,mNumLayers); |
|
530 |
|
|
531 |
for(refCubit=0; refCubit<mNumCubits; refCubit++) |
|
532 |
{ |
|
533 |
if( getCubitVariant(refCubit,mNumLayers)==variant ) break; |
|
534 |
} |
|
535 |
|
|
536 |
float[] curpos = mOrigPos[cubit]; |
|
537 |
float[] refpos = mOrigPos[refCubit]; |
|
538 |
float refX = refpos[0]; |
|
539 |
float refY = refpos[1]; |
|
540 |
float refZ = refpos[2]; |
|
541 |
float curX = curpos[0]; |
|
542 |
float curY = curpos[1]; |
|
543 |
float curZ = curpos[2]; |
|
544 |
|
|
545 |
for(int quat=0; quat<mNumQuats; quat++) |
|
546 |
{ |
|
547 |
QuatHelper.rotateVectorByQuat(tmp,refX,refY,refZ,0,mObjectQuats[quat]); |
|
548 |
|
|
549 |
float dx = tmp[0]-curX; |
|
550 |
float dy = tmp[1]-curY; |
|
551 |
float dz = tmp[2]-curZ; |
|
552 |
|
|
553 |
if( dx>-MAXERR && dx<MAXERR && dy>-MAXERR && dy<MAXERR && dz>-MAXERR && dz<MAXERR ) |
|
554 |
{ |
|
555 |
builder.append(quat); |
|
556 |
builder.append(','); |
|
557 |
} |
|
558 |
} |
|
559 |
|
|
560 |
builder.append('\n'); |
|
561 |
} |
|
562 |
|
|
563 |
android.util.Log.e("D", "cubitQuats: \n"+builder.toString() ); |
|
564 |
} |
|
565 |
|
|
519 | 566 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
520 | 567 |
|
521 | 568 |
protected int[] buildSolvedQuats(Static3D faceAx) |
Also available in: Unified diff
Progress with cubit quaternions.