Revision 9621255f
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/objects/RubikObject.java | ||
---|---|---|
535 | 535 |
setupPosition(moves); |
536 | 536 |
} |
537 | 537 |
|
538 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
539 |
|
|
540 |
public int getCubit(float[] point3D) |
|
541 |
{ |
|
542 |
float dist, minDist = Float. MAX_VALUE; |
|
543 |
int currentBest=-1; |
|
544 |
float multiplier = returnMultiplier(); |
|
545 |
|
|
546 |
point3D[0] *= multiplier; |
|
547 |
point3D[1] *= multiplier; |
|
548 |
point3D[2] *= multiplier; |
|
549 |
|
|
550 |
for(int i=0; i<NUM_CUBITS; i++) |
|
551 |
{ |
|
552 |
dist = mCubits[i].getDistSquared(point3D); |
|
553 |
if( dist<minDist ) |
|
554 |
{ |
|
555 |
minDist = dist; |
|
556 |
currentBest = i; |
|
557 |
} |
|
558 |
} |
|
559 |
|
|
560 |
return currentBest; |
|
561 |
} |
|
562 |
|
|
538 | 563 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
539 | 564 |
|
540 | 565 |
public RubikObjectList getObjectList() |
... | ... | |
553 | 578 |
abstract void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side); |
554 | 579 |
public abstract Static3D[] getRotationAxis(); |
555 | 580 |
public abstract int getBasicAngle(); |
556 |
public abstract int returnRowFromOffset(float offset);
|
|
581 |
public abstract float returnMultiplier();
|
|
557 | 582 |
public abstract float returnRotationFactor(float offset); |
558 | 583 |
} |
Also available in: Unified diff
Progress with the 3x3x3 Solver.