Project

General

Profile

« Previous | Next » 

Revision 9f1f377d

Added by Leszek Koltunski about 4 years ago

Progress with object Movement.

View differences:

src/main/java/org/distorted/object/RubikCubeMovement.java
56 56

  
57 57
///////////////////////////////////////////////////////////////////////////////////////////////////
58 58

  
59
  float fillUpRotationVectAndOffset(float[] v, int[] possible)
59
  float fillUpRotationVectAndOffset(float[] v, float[] touch, int[] possible)
60 60
    {
61 61
    mRotationVect = isVertical(v[possible[0]],v[possible[1]]) ? possible[0] : possible[1];
62
    return mTouch[mRotationVect]+0.5f;
62
    return touch[mRotationVect]+0.5f;
63 63
    }
64 64

  
65 65
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/object/RubikObjectMovement.java
27 27

  
28 28
public abstract class RubikObjectMovement
29 29
  {
30
  float[] mTouch;
31 30
  int mRotationVect, mLastTouchedAxis;
32 31

  
33
  private float[] mPoint, mCamera, mDiff, m2Dpoint;
32
  private float[] mPoint, mCamera, mDiff, mTouch, m2Dpoint;
34 33
  private int mLastTouchedLR;
35 34
  private int mNumAxis, mNumFacesPerAxis;
36 35
  private int[] mPossible;
......
40 39
///////////////////////////////////////////////////////////////////////////////////////////////////
41 40

  
42 41
  abstract boolean isInsideFace(float[] point);
43
  abstract float fillUpRotationVectAndOffset(float[] vect, int[] possible);
42
  abstract float fillUpRotationVectAndOffset(float[] vect, float[] touch, int[] possible);
44 43
  abstract float returnAngle(float[] vect, int[] possible);
45 44
  abstract void fillPossibleRotations(int axis, int[] output);
46 45

  
......
208 207
    mDiff[1] -= mTouch[1];
209 208
    mDiff[2] -= mTouch[2];
210 209

  
211
    float offset = fillUpRotationVectAndOffset(mDiff, mPossible);
210
    float offset = fillUpRotationVectAndOffset(mDiff, mTouch, mPossible);
212 211
    return new Static2D(mRotationVect,offset);
213 212
    }
214 213

  
src/main/java/org/distorted/object/RubikPyraminxMovement.java
51 51
    }
52 52

  
53 53
///////////////////////////////////////////////////////////////////////////////////////////////////
54
// TODO
55 54

  
56 55
  boolean isInsideFace(float[] p)
57 56
    {
......
65 64
///////////////////////////////////////////////////////////////////////////////////////////////////
66 65
// TODO
67 66

  
68
  float fillUpRotationVectAndOffset(float[] v, int[] possible)
67
  float fillUpRotationVectAndOffset(float[] v, float[] touch, int[] possible)
69 68
    {
70 69
    //mRotationVect = isVertical(v[possible[0]],v[possible[1]]) ? possible[0] : possible[1];
71 70
    //return mTouch[mRotationVect]+0.5f;

Also available in: Unified diff