Project

General

Profile

« Previous | Next » 

Revision ebb06a48

Added by Leszek Koltunski almost 7 years ago

Bugfixes for the recent 'Effect classes' API change.

View differences:

src/main/java/org/distorted/examples/check/CheckRenderer.java
66 66
    private MeshFlat mMesh;
67 67
    private DistortedScreen mScreen;
68 68
    private int mObjHeight, mObjWidth;
69
    private Static3D mMove, mScale;
69
    private Static3D mMove, mScale, mCenter;
70 70
    private Static3D mSwirl1, mSwirl2, mDeform1, mDeform2;
71 71

  
72 72
///////////////////////////////////////////////////////////////////////////////////////////////////
......
87 87
      mSwirl2 = new Static3D(0,0,0);
88 88
      mDeform1= new Static3D(0,0,0);
89 89
      mDeform2= new Static3D(0,0,0);
90
      mMove   = new Static3D(0,0,0);
91
      mScale  = new Static3D(1,1,1);
92
      mCenter = new Static3D(0,0,0);
90 93

  
91
      mMove = new Static3D(0,0,0);
92
      mScale= new Static3D(1,1,1);
93 94
      mEffects = new DistortedEffects();
94 95
      mEffects.apply(new MatrixEffectMove(mMove));
95 96
      mEffects.apply(new MatrixEffectScale(mScale));
......
113 114
      dDeform.add(mDeform1);
114 115
      dDeform.add(mDeform2);
115 116

  
116
      if( !mEffects.apply( new VertexEffectDeform(dDeform, new Static3D(mObjWidth/2,0,0)) ) )
117
      if( !mEffects.apply( new VertexEffectDeform(dDeform,mCenter) ) )
117 118
        {
118 119
        Log.e("Check", "Failed to add Deform effect!");
119 120
        }
......
192 193
      mScreen.detachAll();
193 194
      mScreen.attach(mTexture,mEffects,mMesh);
194 195

  
195
      mSwirl1.set (        0, mObjHeight/2, 0);
196
      mSwirl2.set (mObjWidth, mObjHeight/2, 0);
197
      mDeform1.set(        0,         0   , 0);
198
      mDeform2.set(        0,-mObjHeight  , 0);
196
      mSwirl1.set (          0, mObjHeight/2, 0);
197
      mSwirl2.set (mObjWidth  , mObjHeight/2, 0);
198
      mDeform1.set(          0,         0   , 0);
199
      mDeform2.set(          0,-mObjHeight  , 0);
200
      mCenter.set (mObjWidth/2,         0   , 0);
199 201

  
200 202
      try
201 203
        {

Also available in: Unified diff