Revision 7589635e
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/examples/interpolator/InterpolatorSurfaceView.java | ||
---|---|---|
28 | 28 |
import android.graphics.Paint.Style; |
29 | 29 |
import android.graphics.Paint; |
30 | 30 |
|
31 |
import org.distorted.library.type.Interpolator1D;
|
|
32 |
import org.distorted.library.type.Interpolator2D;
|
|
33 |
import org.distorted.library.type.Interpolator3D;
|
|
34 |
import org.distorted.library.type.Float1D;
|
|
35 |
import org.distorted.library.type.Float2D;
|
|
36 |
import org.distorted.library.type.Float3D;
|
|
31 |
import org.distorted.library.type.Dynamic1D;
|
|
32 |
import org.distorted.library.type.Dynamic2D;
|
|
33 |
import org.distorted.library.type.Dynamic3D;
|
|
34 |
import org.distorted.library.type.Static1D;
|
|
35 |
import org.distorted.library.type.Static2D;
|
|
36 |
import org.distorted.library.type.Static3D;
|
|
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////// |
39 | 39 |
|
... | ... | |
51 | 51 |
private static int xDown,yDown; |
52 | 52 |
private static int mScrW, mScrH; |
53 | 53 |
|
54 |
private static Interpolator1D di1D;
|
|
55 |
private static Interpolator2D di2D;
|
|
56 |
private static Interpolator3D di3D;
|
|
54 |
private static Dynamic1D di1D;
|
|
55 |
private static Dynamic2D di2D;
|
|
56 |
private static Dynamic3D di3D;
|
|
57 | 57 |
|
58 | 58 |
private static Paint mPaint; |
59 | 59 |
private static int moving; |
... | ... | |
65 | 65 |
|
66 | 66 |
private static int currentDim = DIM_2D; |
67 | 67 |
|
68 |
private static Float1D p1D;
|
|
69 |
private static Float2D p2D;
|
|
70 |
private static Float3D p3D;
|
|
68 |
private static Static1D p1D;
|
|
69 |
private static Static2D p2D;
|
|
70 |
private static Static3D p3D;
|
|
71 | 71 |
|
72 | 72 |
private static float[] mDrawCoord = new float[3]; |
73 | 73 |
|
... | ... | |
86 | 86 |
mPosition = 0; |
87 | 87 |
mNoise = 0.0f; |
88 | 88 |
|
89 |
di1D = new Interpolator1D();
|
|
89 |
di1D = new Dynamic1D();
|
|
90 | 90 |
di1D.setDuration(mDuration); |
91 | 91 |
di1D.setNoise(mNoise); |
92 | 92 |
|
93 |
di2D = new Interpolator2D();
|
|
93 |
di2D = new Dynamic2D();
|
|
94 | 94 |
di2D.setDuration(mDuration); |
95 | 95 |
di2D.setNoise(mNoise); |
96 | 96 |
|
97 |
di3D = new Interpolator3D();
|
|
97 |
di3D = new Dynamic3D();
|
|
98 | 98 |
di3D.setDuration(mDuration); |
99 | 99 |
di3D.setNoise(mNoise); |
100 | 100 |
|
... | ... | |
325 | 325 |
synchronized(lock) |
326 | 326 |
{ |
327 | 327 |
if( len>=MAX_VECTORS ) di1D.removeAll(); |
328 |
di1D.add(new Float1D(xDown));
|
|
328 |
di1D.add(new Static1D(xDown));
|
|
329 | 329 |
} |
330 | 330 |
} |
331 | 331 |
break; |
... | ... | |
348 | 348 |
synchronized(lock) |
349 | 349 |
{ |
350 | 350 |
if( len>=MAX_VECTORS ) di2D.removeAll(); |
351 |
di2D.add(new Float2D(xDown,yDown));
|
|
351 |
di2D.add(new Static2D(xDown,yDown));
|
|
352 | 352 |
} |
353 | 353 |
} |
354 | 354 |
break; |
... | ... | |
386 | 386 |
|
387 | 387 |
if( currentDim==DIM_3DXY ) |
388 | 388 |
{ |
389 |
di3D.add(new Float3D(xDown,yDown,InterpolatorRenderer.BHEI/2));
|
|
389 |
di3D.add(new Static3D(xDown,yDown,InterpolatorRenderer.BHEI/2));
|
|
390 | 390 |
} |
391 | 391 |
if( currentDim==DIM_3DXZ ) |
392 | 392 |
{ |
393 |
di3D.add(new Float3D(xDown,InterpolatorRenderer.BHEI/2,yDown));
|
|
393 |
di3D.add(new Static3D(xDown,InterpolatorRenderer.BHEI/2,yDown));
|
|
394 | 394 |
} |
395 | 395 |
} |
396 | 396 |
} |
Also available in: Unified diff
Major push towards simplifying DistortedObject's public API.
All MATRIX effects are using the new API - the 'DataND' marker interfaces.