109 |
109 |
private Dynamic1D mRotationAngle;
|
110 |
110 |
private Static3D mRotationAxis;
|
111 |
111 |
private Static3D mObjectScale;
|
|
112 |
private int[] mQuatDebug;
|
112 |
113 |
|
113 |
114 |
float[] mRowChances;
|
114 |
115 |
Static1D mRotationAngleStatic, mRotationAngleMiddle, mRotationAngleFinal;
|
... | ... | |
143 |
144 |
CUTS = getCuts(mNumLayers);
|
144 |
145 |
NUM_CUTS = CUTS.length;
|
145 |
146 |
|
|
147 |
mQuatDebug = new int[NUM_CUBITS];
|
|
148 |
|
146 |
149 |
if( mObjectScreenRatio>MAX_SIZE_CHANGE) mObjectScreenRatio = MAX_SIZE_CHANGE;
|
147 |
150 |
if( mObjectScreenRatio<MIN_SIZE_CHANGE) mObjectScreenRatio = MIN_SIZE_CHANGE;
|
148 |
151 |
|
... | ... | |
440 |
443 |
{
|
441 |
444 |
for(int i=0; i<NUM_CUBITS; i++)
|
442 |
445 |
{
|
443 |
|
int index = CUBITS[i].restorePreferences(preferences);
|
|
446 |
mQuatDebug[i] = CUBITS[i].restorePreferences(preferences);
|
444 |
447 |
|
445 |
|
if( index<0 )
|
|
448 |
if( mQuatDebug[i]<0 )
|
446 |
449 |
{
|
447 |
|
String debug = mList.name();
|
448 |
|
|
449 |
450 |
for(int j=0; j<NUM_CUBITS; j++)
|
450 |
451 |
{
|
451 |
|
debug += (CUBITS[i].returnPreferences(preferences)+" ");
|
452 |
452 |
CUBITS[j].modifyCurrentPosition(QUATS[0]);
|
453 |
453 |
mMesh.setEffectAssociation(j, CUBITS[j].computeAssociation(),0);
|
454 |
454 |
}
|
455 |
|
|
456 |
|
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
457 |
|
crashlytics.log("failed to restore preferences: "+debug);
|
|
455 |
recordQuatsState("Failed to restorePreferences");
|
458 |
456 |
|
459 |
457 |
break;
|
460 |
458 |
}
|
461 |
459 |
|
462 |
|
mMesh.setEffectAssociation(i, CUBITS[i].computeAssociation(),index);
|
|
460 |
mMesh.setEffectAssociation(i, CUBITS[i].computeAssociation(),mQuatDebug[i]);
|
|
461 |
}
|
|
462 |
}
|
|
463 |
|
|
464 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
465 |
|
|
466 |
public void recordQuatsState(String message)
|
|
467 |
{
|
|
468 |
StringBuilder quats = new StringBuilder();
|
|
469 |
|
|
470 |
for(int j=0; j<NUM_CUBITS; j++)
|
|
471 |
{
|
|
472 |
quats.append(mQuatDebug[j]);
|
|
473 |
quats.append(" ");
|
463 |
474 |
}
|
|
475 |
|
|
476 |
Exception ex = new Exception(message);
|
|
477 |
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
|
478 |
crashlytics.setCustomKey("quats" , quats.toString());
|
|
479 |
crashlytics.setCustomKey("object", mList.name()+"_"+mNumLayers );
|
|
480 |
crashlytics.recordException(ex);
|
464 |
481 |
}
|
465 |
482 |
|
466 |
483 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
Report to Crashlytics if we fail to restore preferencees (2)