Project

General

Profile

« Previous | Next » 

Revision bd3da5b2

Added by Leszek Koltunski over 7 years ago

Move DistortedNode and Distorted to use the new DistortedRenderTarget.

View differences:

src/main/java/org/distorted/library/EffectQueueMatrix.java
153 153
///////////////////////////////////////////////////////////////////////////////////////////////////
154 154
// here construct the ModelView Matrix
155 155

  
156
  synchronized void send(DistortedProjection dp)
156
  synchronized void send(DistortedRenderTarget drt)
157 157
    {
158 158
    Matrix.setIdentityM(mViewMatrix, 0);
159
    Matrix.translateM(mViewMatrix, 0, -dp.width/2, dp.height/2, -dp.distance);
159
    Matrix.translateM(mViewMatrix, 0, -drt.mWidth/2, drt.mHeight/2, -drt.mDistance);
160 160
    
161 161
    float x,y,z, sx,sy,sz;
162 162
   
......
230 230
      }
231 231
   
232 232
    Matrix.translateM(mViewMatrix, 0, mObjHalfX,-mObjHalfY, 0);
233
    Matrix.multiplyMM(mMVPMatrix, 0, dp.projectionMatrix, 0, mViewMatrix, 0);
233
    Matrix.multiplyMM(mMVPMatrix, 0, drt.mProjectionMatrix, 0, mViewMatrix, 0);
234 234
    
235 235
    GLES20.glUniform3f( mObjDH , mObjHalfX, mObjHalfY, mObjHalfZ);
236
    GLES20.glUniform1f( mDepthH, dp.depth);   
236
    GLES20.glUniform1f( mDepthH, drt.mDepth);
237 237
    GLES20.glUniformMatrix4fv(mMVMatrixH , 1, false, mViewMatrix, 0);
238 238
    GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix , 0);
239 239
    }
......
241 241
///////////////////////////////////////////////////////////////////////////////////////////////////
242 242
// here construct the ModelView Matrix, but without any effects
243 243

  
244
  synchronized void sendZero(DistortedProjection dp)
244
  synchronized void sendZero(DistortedRenderTarget drt)
245 245
    {
246 246
    Matrix.setIdentityM(mTmpMatrix, 0);
247
    Matrix.translateM(mTmpMatrix, 0, mObjHalfX-dp.width/2, dp.height/2-mObjHalfY, -dp.distance);
248
    Matrix.multiplyMM(mMVPMatrix, 0, dp.projectionMatrix, 0, mTmpMatrix, 0);
247
    Matrix.translateM(mTmpMatrix, 0, mObjHalfX-drt.mWidth/2, drt.mHeight/2-mObjHalfY, -drt.mDistance);
248
    Matrix.multiplyMM(mMVPMatrix, 0, drt.mProjectionMatrix, 0, mTmpMatrix, 0);
249 249
    
250 250
    GLES20.glUniform3f( mObjDH , mObjHalfX, mObjHalfY, mObjHalfZ);
251
    GLES20.glUniform1f( mDepthH, dp.depth);  
251
    GLES20.glUniform1f( mDepthH, drt.mDepth);
252 252
    GLES20.glUniformMatrix4fv(mMVMatrixH , 1, false, mTmpMatrix, 0);
253 253
    GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix, 0);
254 254
    }

Also available in: Unified diff