Revision 9ef0ad15
Added by Leszek Koltunski 2 months ago
src/main/java/org/distorted/objectlib/main/TwistyObject.java | ||
---|---|---|
379 | 379 |
int numFaces = mShapes[variant].getNumFaces(); |
380 | 380 |
|
381 | 381 |
for(int face=0; face<numFaces; face++) |
382 |
if( getCubitFaceColor(cubit,face)>=0 ) |
|
382 |
if( getDefaultCubitFaceColor(cubit,face)>=0 )
|
|
383 | 383 |
{ |
384 | 384 |
mVariantFaceIsOuter[variant][face] = 1; |
385 | 385 |
} |
... | ... | |
1250 | 1250 |
|
1251 | 1251 |
void repaintPuzzleFace(int cubit, int face, int newColor) |
1252 | 1252 |
{ |
1253 |
int oldColorIndex = getCubitFaceColor(cubit,face); |
|
1253 |
int oldColorIndex = getDefaultCubitFaceColor(cubit,face);
|
|
1254 | 1254 |
|
1255 | 1255 |
if( oldColorIndex<0 || oldColorIndex>=mNumFaceColors ) |
1256 | 1256 |
{ |
1257 |
android.util.Log.e("D", "error in TwistyObject.repaintPuzzleFace, index="+oldColorIndex);
|
|
1257 |
android.util.Log.e("D", "TwistyObject.repaintPuzzleFace: index="+oldColorIndex);
|
|
1258 | 1258 |
return; |
1259 | 1259 |
} |
1260 | 1260 |
|
... | ... | |
1277 | 1277 |
// this doesn't have to return the real, displayed color - but the default one (from Shape classes). |
1278 | 1278 |
// The real displayed color can be different because of the sticker color overrides in 'Config'. |
1279 | 1279 |
|
1280 |
int getCubitFaceColor(int cubit, int face) |
|
1280 |
int getDefaultCubitFaceColor(int cubit, int face)
|
|
1281 | 1281 |
{ |
1282 | 1282 |
int puzzleFace = getCubitFaceMap(cubit,face); |
1283 | 1283 |
if( puzzleFace>=0 ) puzzleFace %= mNumFaceColors; |
... | ... | |
1343 | 1343 |
|
1344 | 1344 |
for(int face=0; face<mNumCubitFaces; face++) |
1345 | 1345 |
{ |
1346 |
cubColor = getCubitFaceColor(cubit,face); |
|
1346 |
cubColor = getDefaultCubitFaceColor(cubit,face);
|
|
1347 | 1347 |
stiShape = getVariantStickerShape(variant,face); |
1348 | 1348 |
texIndex = cubColor<0 || stiShape<0 ? mNumTextures-mNumOverrides : stiShape*mNumFaceColors + cubColor; |
1349 | 1349 |
row = (mNumTexRows-1) - texIndex/mNumTexCols; |
src/main/java/org/distorted/objectlib/main/TwistyObjectSolved.java | ||
---|---|---|
359 | 359 |
|
360 | 360 |
for(int f=0; f<numFaces; f++) |
361 | 361 |
{ |
362 |
mCubitFaceToPuzzleFaceMap[c][f] = mParent.getCubitFaceColor(c,f); |
|
362 |
mCubitFaceToPuzzleFaceMap[c][f] = mParent.getDefaultCubitFaceColor(c,f);
|
|
363 | 363 |
|
364 | 364 |
//android.util.Log.e("D", "cubit "+c+" face "+f+" puzzle face: "+ mCubitFaceToPuzzleFaceMap[c][f]); |
365 | 365 |
|
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlMirror.java | ||
---|---|---|
81 | 81 |
{ |
82 | 82 |
int quatIndex = mObject.getCubitQuatIndex(mTouchedCubit); |
83 | 83 |
float[] quat = mQuats[quatIndex]; |
84 |
int face = correctTouchedFace(mTouchedCubit,mTouchedFace,quat); |
|
84 |
int face = correctTouchedFace(mTouchedCubit,mTouchedCubitFace,quat);
|
|
85 | 85 |
float[] normal = mInfos[mTouchedCubit][face].getNormal(); |
86 | 86 |
QuatHelper.rotateVectorByQuat(mTmp,normal,quat); |
87 | 87 |
|
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlShapeChanging.java | ||
---|---|---|
94 | 94 |
final float[] mCamera, mPoint; |
95 | 95 |
final Static3D[] mRotAxis; |
96 | 96 |
final TwistyObject mObject; |
97 |
int mTouchedCubit, mTouchedFace, mNumAxis; |
|
97 |
int mTouchedCubit, mTouchedCubitFace, mNumAxis;
|
|
98 | 98 |
FaceInfo[][] mInfos; |
99 | 99 |
float[][] mQuats; |
100 | 100 |
|
... | ... | |
660 | 660 |
|
661 | 661 |
float closestSoFar = NOT_TOUCHED; |
662 | 662 |
mTouchedCubit = -1; |
663 |
mTouchedFace = -1;
|
|
663 |
mTouchedCubitFace = -1;
|
|
664 | 664 |
int numQuats = mQuats.length; |
665 | 665 |
|
666 | 666 |
for(int cubit=0; cubit<mNumCubits; cubit++) |
... | ... | |
678 | 678 |
if( dist!=NOT_TOUCHED ) |
679 | 679 |
{ |
680 | 680 |
mTouchedCubit= cubit; |
681 |
mTouchedFace = face; |
|
681 |
mTouchedCubitFace = face;
|
|
682 | 682 |
closestSoFar = dist; |
683 | 683 |
mLastT[0] = mTouch[0]; |
684 | 684 |
mLastT[1] = mTouch[1]; |
... | ... | |
747 | 747 |
|
748 | 748 |
public int getTouchedCubitFace() |
749 | 749 |
{ |
750 |
return mTouchedFace; |
|
750 |
return mTouchedCubitFace;
|
|
751 | 751 |
} |
752 | 752 |
|
753 | 753 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
minor