Project

General

Profile

« Previous | Next » 

Revision 30bc2d91

Added by Leszek Koltunski about 3 years ago

Fix movements of objects - before it really worked only when an object's FOV was about 60 degrees.

View differences:

src/main/java/org/distorted/objects/MovementMinx.java
26 26
import static org.distorted.objects.FactoryCubit.SIN54;
27 27
import static org.distorted.objects.FactoryCubit.COS54;
28 28
import static org.distorted.objects.TwistyObject.SQ5;
29
import static org.distorted.objects.FactoryCubit.COS18;
30
import static org.distorted.objects.TwistyMegaminx.MEGA_D;
31 29

  
32 30
///////////////////////////////////////////////////////////////////////////////////////////////////
33 31

  
......
69 67
      }
70 68
    if( size==5 )
71 69
      {
72
      // TODO
70
      float quot = offset / DIST2D;
73 71

  
74
      float LEN = (0.5f-MEGA_D)*COS18/3;
75

  
76
      android.util.Log.e("mega", "offset = "+offset+" len="+LEN+" dist2D="+DIST2D);
77

  
78
      if( offset<LEN/2 ) return 0;
79
      if( offset<LEN   ) return 1;
72
      if( quot>0.00f && quot<=0.34f ) return 0;
73
      if( quot>0.34f && quot<=1.00f ) return 1;
74
      if( quot>1.00f && quot<=1.66f ) return 3;
75
      if( quot>1.66f && quot<=2.00f ) return 4;
80 76
      }
81 77

  
82 78
    return 0;

Also available in: Unified diff