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/objects/TwistyObject.java
110 110
  private final Static3D mRotationAxis;
111 111
  private final Static3D mObjectScale;
112 112
  private final int[] mQuatDebug;
113
  private final float mCameraDist;
113 114
  private int mNumTexRows, mNumTexCols;
114 115
  private int mRotRowBitmap;
115 116
  private int mRotAxis;
......
205 206

  
206 207
    setupPosition(moves);
207 208

  
208
    setProjection( list.getFOV(), 0.1f);
209
    float fov = list.getFOV();
210
    double halfFOV = fov * (Math.PI/360);
211
    mCameraDist = 0.5f*NODE_RATIO / (float)Math.tan(halfFOV);
212

  
213
    setProjection( fov, 0.1f);
209 214
    }
210 215

  
211 216
///////////////////////////////////////////////////////////////////////////////////////////////////
......
759 764
    return speed> 1.2f ? NEAREST*(angle>0 ? 1:-1) : 0;
760 765
    }
761 766

  
767
///////////////////////////////////////////////////////////////////////////////////////////////////
768

  
769
  public float getCameraDist()
770
    {
771
    return mCameraDist;
772
    }
773

  
762 774
///////////////////////////////////////////////////////////////////////////////////////////////////
763 775

  
764 776
  public int getNodeSize()

Also available in: Unified diff