Project

General

Profile

« Previous | Next » 

Revision 27e12007

Added by Leszek Koltunski about 8 years ago

Dynamics: Introduce 2 Modes of operation:

- 'random access' mode, where we are able to call a single Dynamic from multiple thread simultaneously.
- 'sequential' mode, which only permits sequential interpolation from one client.

The second mode has an advantage when one needs to change mDuration: it keeps on interpolating smoothly. In the first mode, this is not possible.

View differences:

src/main/java/org/distorted/examples/dynamic/DynamicSurfaceView.java
28 28
import android.graphics.Paint.Style;
29 29
import android.graphics.Paint;
30 30

  
31
import org.distorted.library.type.Dynamic;
31 32
import org.distorted.library.type.Dynamic1D;
32 33
import org.distorted.library.type.Dynamic2D;
33 34
import org.distorted.library.type.Dynamic3D;
......
100 101
      di3D = new Dynamic3D(mDuration,0.0f);
101 102
      p3N  = new Static3D(mNoise0,mNoise1,mNoise2);
102 103

  
104
      di1D.setAccessMode(Dynamic.ACCESS_SEQUENTIAL);
105
      di2D.setAccessMode(Dynamic.ACCESS_SEQUENTIAL);
106
      di3D.setAccessMode(Dynamic.ACCESS_SEQUENTIAL);
107

  
103 108
      if(!isInEditMode())
104 109
        {
105 110
        setFocusable(true);
src/main/java/org/distorted/examples/wind/WindEffectsManager.java
62 62
    windDynamic.add(windFactor1);
63 63
    windDynamic.add(windFactor2);
64 64
    windDynamic.setMode(Dynamic.MODE_JUMP);
65
    windDynamic.setAccessMode(Dynamic.ACCESS_SEQUENTIAL);
65 66
    }
66 67

  
67 68
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff