Project

General

Profile

« Previous | Next » 

Revision 12ad3fca

Added by Leszek Koltunski about 4 years ago

Progress with object Movement - almost finished.

View differences:

src/main/java/org/distorted/object/RubikPyraminxMovement.java
33 33
    super(RubikPyraminx.AXIS, 1, SQ2*SQ3/12, SQ3/6);
34 34
    }
35 35

  
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37
// (         0,        1,       0 )  BOTTOM
38
// (         0,  -1.0f/3, 2*SQ2/3 )  BACK
39
// (-SQ2*SQ3/3,  -1.0f/3,  -SQ2/3 )  LEFT
40
// ( SQ2*SQ3/3,  -1.0f/3,  -SQ2/3 )  RIGHT
41

  
42
  void fillPossibleRotations(int axis, int[] output)
43
    {
44
    switch(axis)
45
      {
46
      case 0: output[0]=3; output[1]=1; output[2]=2; break; // (RIGHT,BACK,LEFT) when looking at BOTTOM
47
      case 1: output[0]=2; output[1]=0; output[2]=3; break; // (LEFT,BOTTOM,RIGHT) when looking at BACK
48
      case 2: output[0]=3; output[1]=0; output[2]=1; break; // (RIGHT,BOTTOM,BACK) when looking at LEFT
49
      case 3: output[0]=1; output[1]=0; output[2]=2; break; // (BACK,BOTTOM,LEFT) when looking at RIGHT
50
      }
51
    }
52

  
53 36
///////////////////////////////////////////////////////////////////////////////////////////////////
54 37

  
55 38
  boolean isInsideFace(float[] p)
......
60 43

  
61 44
    return a1 && a2 && a3;
62 45
    }
63

  
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65
// TODO
66

  
67
  float returnAngle(float[] v, int[] possible)
68
    {
69
    /*
70
    float angle= (mRotationVect==possible[0] ? v[possible[1]] : -v[possible[0]]);
71
    if( mLastTouchedAxis==2 ) angle = -angle;
72
    return angle;
73
     */
74

  
75
    return 0;
76
    }
77 46
}

Also available in: Unified diff