Project

General

Profile

« Previous | Next » 

Revision 8e2295ad

Added by Leszek Koltunski about 4 years ago

Progress with object Movement.

View differences:

src/main/java/org/distorted/object/RubikObjectMovement.java
135 135
    else
136 136
      {
137 137
      float norm = (float)(-a1/Math.sqrt(1-a1*a1));
138
      y0 = norm*a0; y1= norm*(a1-1/a1); y2=a2;
138
      y0 = norm*a0; y1= norm*(a1-1/a1); y2=norm*a2;
139 139
      }
140 140

  
141 141
    x0 = y1*a2 - y2*a1;  //
......
156 156
    output[1] = v0*y0 + v1*y1 + v2*y2;
157 157
    }
158 158

  
159
///////////////////////////////////////////////////////////////////////////////////////////////////
160

  
161
  private String getFaceColor(int axis)
162
    {
163
    switch(axis)
164
      {
165
      case 0: return "yellow ";
166
      case 1: return "green ";
167
      case 2: return "blue ";
168
      case 3: return "red ";
169
      }
170

  
171
    return null;
172
    }
173

  
159 174
///////////////////////////////////////////////////////////////////////////////////////////////////
160 175
// PUBLIC API
161 176
///////////////////////////////////////////////////////////////////////////////////////////////////
......
181 196

  
182 197
          if( isInsideFace(m2Dpoint) )
183 198
            {
184
 // android.util.Log.e("move", "touched "+mLastTouchedAxis+" touch point: ("+m2Dpoint[0]+","+m2Dpoint[1]+")");
199
            android.util.Log.e("move", "face "+getFaceColor(mLastTouchedAxis)+" ("+m2Dpoint[0]+","+m2Dpoint[1]+")");
185 200

  
186 201
            fillPossibleRotations(mLastTouchedAxis, mPossible);
187 202
            return true;

Also available in: Unified diff