Project

General

Profile

« Previous | Next » 

Revision f8ce34ab

Added by Leszek Koltunski over 4 years ago

Fix for the previous fix :)

View differences:

src/main/java/org/distorted/objects/Cubit.java
21 21

  
22 22
import android.content.SharedPreferences;
23 23

  
24
import com.google.firebase.crashlytics.FirebaseCrashlytics;
25

  
24 26
import org.distorted.library.effect.MatrixEffectMove;
25 27
import org.distorted.library.effect.MatrixEffectQuaternion;
26 28
import org.distorted.library.effect.MatrixEffectRotate;
......
338 340
    mRotationAngle.add(mParent.mRotationAngleFinal);
339 341
    }
340 342

  
343
///////////////////////////////////////////////////////////////////////////////////////////////////
344

  
345
  float getAngle()
346
    {
347
    int pointNum = mRotationAngle.getNumPoints();
348

  
349
    if( pointNum>=1 )
350
      {
351
      return mRotationAngle.getPoint(pointNum-1).get0();
352
      }
353
    else
354
      {
355
      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
356
      crashlytics.setCustomKey("getAngle", "points in RotationAngle: "+pointNum );
357
      crashlytics.log("points in RotationAngle: "+pointNum);
358
      return 0;
359
      }
360
    }
361

  
341 362
///////////////////////////////////////////////////////////////////////////////////////////////////
342 363
// all DistortedTextures, DistortedNodes, DistortedFramebuffers, DistortedScreens and all types of
343 364
// Meshes HAVE TO be markedForDeletion when they are no longer needed- otherwise we have a major
src/main/java/org/distorted/objects/RubikObject.java
487 487
          {
488 488
          firstCubit=i;
489 489

  
490
          float angle = mRotationAngleStatic.get0();
490
          float angle = mCubits[i].getAngle();
491 491
          int nearestAngleInDegrees = computeNearestAngle(angle);
492 492
          mRotationAngleStatic.set0(angle);
493 493
          mRotationAngleFinal.set0(nearestAngleInDegrees);
......
516 516
           {
517 517
           first = false;
518 518

  
519
           float angle = mRotationAngleFinal.get0();
519
           float angle = mCubits[i].getAngle();
520 520
           int nearestAngleInDegrees = computeNearestAngle(angle);
521 521
           double nearestAngleInRadians = nearestAngleInDegrees*Math.PI/180;
522 522
           float sinA =-(float)Math.sin(nearestAngleInRadians*0.5);

Also available in: Unified diff