Project

General

Profile

« Previous | Next » 

Revision a76d9cb4

Added by Leszek Koltunski over 2 years ago

Correct the cuts of Mega/Kilominx.

View differences:

src/main/java/org/distorted/objects/Movement.java
190 190
    if( denom != 0.0f )
191 191
      {
192 192
      float axisCam = a0*mCamera[0] + a1*mCamera[1] + a2*mCamera[2];
193
      float distance = mDistanceCenterFace3D;
194
      float alpha = (distance-axisCam)/denom;
193
      float alpha = (mDistanceCenterFace3D-axisCam)/denom;
195 194

  
196 195
      output[0] = mCamera[0] + d0*alpha;
197 196
      output[1] = mCamera[1] + d1*alpha;
......
336 335
// the 3D 'cuts' to translate it from 3D (i.e. with respect to the rotAxis) to 2D in-face (i.e. with
337 336
// respect to the 2D rotAxis cast into a particular face)
338 337

  
339
  void computeLinear(float distance3D, Static3D[] rotAxis, Static3D[] faceAxis)
338
  private void computeLinear(float distance3D, Static3D[] rotAxis, Static3D[] faceAxis)
340 339
    {
341 340
    int numFaces = faceAxis.length;
342 341
    int numRot   = rotAxis.length;
......
356 355
          mB[i][j] = sign*distance3D*coeff;
357 356
          }
358 357
        else mB[i][j] = 0.0f;
359

  
360
        android.util.Log.e("D", "face="+i+" rot="+j+" a="+mA[i][j]+" B="+mB[i][j]);
361 358
        }
362 359
    }
363 360

  
......
376 373
      for(int i=0; i<len; i++)
377 374
        {
378 375
        float translated = B + borders[i]/A;
379

  
380
        android.util.Log.e("D", "offset="+offset+" borders[i]="+borders[i]+" translated="+translated+" A="+A+" B="+B);
381

  
382 376
        if( offset<translated ) return i;
383 377
        }
384 378
      }

Also available in: Unified diff