Project

General

Profile

« Previous | Next » 

Revision 7589635e

Added by Leszek Koltunski almost 8 years ago

Major push towards simplifying DistortedObject's public API.
All MATRIX effects are using the new API - the 'DataND' marker interfaces.

View differences:

src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java
29 29
import android.util.AttributeSet;
30 30

  
31 31
import org.distorted.library.EffectTypes;
32
import org.distorted.library.type.Float2D;
33
import org.distorted.library.type.Float3D;
34
import org.distorted.library.type.Float4D;
35
import org.distorted.library.type.Interpolator2D;
36
import org.distorted.library.type.Interpolator3D;
32
import org.distorted.library.type.Dynamic2D;
33
import org.distorted.library.type.Dynamic3D;
34
import org.distorted.library.type.Static2D;
35
import org.distorted.library.type.Static3D;
36
import org.distorted.library.type.Static4D;
37 37

  
38 38
///////////////////////////////////////////////////////////////////
39 39

  
......
54 54
    private static int xDown,yDown;
55 55
    private static int mScrW, mScrH;
56 56
    
57
    private static Interpolator2D di2D;
58
    private static Interpolator3D di3D;
59
    private static Float4D dr;
57
    private static Dynamic2D di2D;
58
    private static Dynamic3D di3D;
59
    private static Static4D dr;
60 60
    
61 61
    private static Paint mPaint;
62 62
    private static int moving;
......
76 76
      mPaint.setStyle(Style.FILL);
77 77
      moving = -1;
78 78
      
79
      di2D = new Interpolator2D();
79
      di2D = new Dynamic2D();
80 80
      di2D.setCount(0.0f);
81 81
      di2D.setDuration(LOOP_TIME);
82 82
      
83
      di3D = new Interpolator3D();
84
      di3D.add(new Float3D(0,0, 0));
85
      di3D.add(new Float3D(0,0,30));
83
      di3D = new Dynamic3D();
84
      di3D.add(new Static3D(0,0, 0));
85
      di3D.add(new Static3D(0,0,30));
86 86
      
87
      dr = new Float4D(0,0,60,60);
87
      dr = new Static4D(0,0,60,60);
88 88
      
89 89
      if(!isInEditMode())
90 90
        {
......
214 214
        {  
215 215
        int len = di2D.getNumPoints();
216 216
        float[] drawCoord = new float[2];
217
        Float2D cu;
217
        Static2D cu;
218 218
        int lit = mTime> 0 ? (int)((float)(time-mTime)*NUM_INTERPOLATIONS/LOOP_TIME)  : 0; 
219 219
            
220 220
        if( len>=2 )
......
254 254
                                      yDown = (int)event.getY()*MovingEffectsRenderer.BHEI/mScrH;
255 255
                                    
256 256
                                      float gx, gy;
257
                                      Float2D dv;
257
                                      Static2D dv;
258 258
                                      int len = di2D.getNumPoints();
259 259
                                 
260 260
                                      for(int g=0; g<len; g++)
......
273 273
                                        {
274 274
                                        synchronized(lock)
275 275
                                          {
276
                                          di2D.add(new Float2D(xDown,yDown)); 
276
                                          di2D.add(new Static2D(xDown,yDown));
277 277
                                          }
278 278
                                        } 
279 279
                                      break;

Also available in: Unified diff