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/main/RubikSurfaceView.java
57 57
    // Moving the finger by 0.3 of an inch will start a Rotation.
58 58
    private final static float ROTATION_SENSITIVITY = 0.3f;
59 59

  
60
    private final Static4D CAMERA_POINT = new Static4D(0, 0, 1, 0);
60
    private final Static4D CAMERA_POINT = new Static4D(0, 0, 0, 0);
61 61

  
62 62
    private RubikRenderer mRenderer;
63 63
    private RubikPreRender mPreRender;
......
305 305
        }
306 306
      else
307 307
        {
308
        TwistyObject object = mPreRender.getObject();
309
        CAMERA_POINT.set2( object.getCameraDist() );
310

  
308 311
        Static4D touchPoint = new Static4D(x, y, 0, 0);
309 312
        Static4D rotatedTouchPoint= rotateVectorByInvertedQuat(touchPoint, mQuat);
310 313
        Static4D rotatedCamera= rotateVectorByInvertedQuat(CAMERA_POINT, mQuat);
......
328 331
              mLastCubitFace = mMovement.getTouchedFace();
329 332
              float[] point = mMovement.getTouchedPoint3D();
330 333
              int color = solver.getCurrentColor();
331
              TwistyObject object = mPreRender.getObject();
332 334
              mLastCubit = object.getCubit(point);
333 335
              mPreRender.setTextureMap( mLastCubit, mLastCubitFace, color );
334 336
              mLastCubitColor = SolverMain.cubitIsLocked(object.getObjectList(), object.getNumLayers(), mLastCubit);

Also available in: Unified diff