Project

General

Profile

« Previous | Next » 

Revision c2c08950

Added by Leszek Koltunski about 7 years ago

simplify blitPriv()

View differences:

src/main/java/org/distorted/library/DistortedOutputSurface.java
32 32
  private ArrayList<DistortedNode> mChildren;
33 33
  private int mNumChildren;   // ==mChildren.length(), but we only create mChildren if the first one gets added
34 34

  
35
  private float mNear, mFOV;
35
  private float mFOV;
36 36
  int mWidth,mHeight,mDepth;
37
  float mDistance;
37
  float mDistance, mNear;
38 38
  float[] mProjectionMatrix;
39 39

  
40 40
  int mDepthCreated;
......
71 71
      if( mFOV>0.0f )  // perspective projection
72 72
        {
73 73
        float a = 2.0f*(float)Math.tan(mFOV*Math.PI/360);
74
        float q = (float)mWidth/mHeight;
74
        float q = mWidth*mNear;
75 75
        float c = mHeight*mNear;
76 76

  
77
        float left   = -q*c/2;
78
        float right  = +q*c/2;
79
        float bottom =   -c/2;
80
        float top    =   +c/2;
81
        float near   =    c/a;
77
        float left   = -q/2;
78
        float right  = +q/2;
79
        float bottom = -c/2;
80
        float top    = +c/2;
81
        float near   =  c/a;
82 82

  
83 83
        mDistance    = mHeight/a;
84 84
        float far    = 2*mDistance-near;

Also available in: Unified diff