Project

General

Profile

« Previous | Next » 

Revision e3eab072

Added by Leszek Koltunski almost 7 years ago

Simplify Statics.

View differences:

src/main/java/org/distorted/examples/deform/DeformRenderer.java
264 264
     {
265 265
     switch(mMode)
266 266
       {
267
       case DISTORT: vDistort[0].set(x,y);
267
       case DISTORT: vDistort[0].set(x,y,0);
268 268
                     break;
269
       case DEFORM:  vDeform[0].set(x,y);
269
       case DEFORM:  vDeform[0].set(x,y,0);
270 270
                     break;
271
       case SHEAR:   vShear[0].set( (float)x/(scrWidth/2), (float)y/(scrHeight/2));
271
       case SHEAR:   vShear[0].set( (float)x/(scrWidth/2), (float)y/(scrHeight/2), 0);
272 272
                     break;
273 273
       }
274 274
     }
......
285 285
       {
286 286
       case DISTORT: for(int i=1; i<NUM_VECTORS-1; i++)
287 287
                       {
288
                       vDistort[i].set( vDistort[i-1].getX()*damp, vDistort[i-1].getY()*damp );
288
                       vDistort[i].set( vDistort[i-1].get1()*damp, vDistort[i-1].get2()*damp, 0 );
289 289
                       }
290
                     vDistort[NUM_VECTORS-1].set(0,0);
290
                     vDistort[NUM_VECTORS-1].set(0,0,0);
291 291
                     stretchEffects.apply(mReleasedDistort);
292 292
                     break;
293 293
       case DEFORM : for(int i=1; i<NUM_VECTORS-1; i++)
294 294
                       {
295
                       vDeform[i].set( vDeform[i-1].getX()*damp, vDeform[i-1].getY()*damp );
295
                       vDeform[i].set( vDeform[i-1].get1()*damp, vDeform[i-1].get2()*damp, 0 );
296 296
                       }
297
                     vDeform[NUM_VECTORS-1].set(0,0);
297
                     vDeform[NUM_VECTORS-1].set(0,0,0);
298 298
                     stretchEffects.apply(mReleasedDeform);
299 299
                     break;
300 300
       case SHEAR  : for(int i=1; i<NUM_VECTORS-1; i++)
301 301
                       {
302
                       vShear[i].set( vShear[i-1].getX()*damp, vShear[i-1].getY()*damp );
302
                       vShear[i].set( vShear[i-1].get1()*damp, vShear[i-1].get2()*damp, 0 );
303 303
                       }
304
                     vShear[NUM_VECTORS-1].set(0,0);
304
                     vShear[NUM_VECTORS-1].set(0,0,0);
305 305
                     stretchEffects.apply(mReleasedShear);
306 306
                     break;
307 307
       }

Also available in: Unified diff