Revision fe3c72ce
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/dynamic/DynamicSurfaceView.java | ||
---|---|---|
44 | 44 |
public static final int DIM_3DXY = 2; |
45 | 45 |
public static final int DIM_3DXZ = 3; |
46 | 46 |
|
47 |
private static final int NUM_POINTS = 500;
|
|
47 |
private static final int NUM_POINTS = 250;
|
|
48 | 48 |
private static final int MAX_POINTS = 6; |
49 | 49 |
|
50 | 50 |
private static final Object lock = new Object(); |
51 | 51 |
|
52 |
private static Dynamic1D di1D;
|
|
53 |
private static Dynamic2D di2D;
|
|
54 |
private static Dynamic3D di3D;
|
|
52 |
private Dynamic1D di1D; |
|
53 |
private Dynamic2D di2D; |
|
54 |
private Dynamic3D di3D; |
|
55 | 55 |
|
56 |
private static Paint mPaint;
|
|
57 |
private static int moving;
|
|
58 |
private static int mDuration;
|
|
59 |
private static int mPosition;
|
|
60 |
private static float mNoise0, mNoise1, mNoise2;
|
|
56 |
private Paint mPaint; |
|
57 |
private int moving; |
|
58 |
private int mDuration; |
|
59 |
private int mPosition; |
|
60 |
private float mNoise0, mNoise1, mNoise2; |
|
61 | 61 |
|
62 |
private static int mSize1, mSize2, mSizeT, mAvg;
|
|
62 |
private int mSize1, mSize2, mSizeT, mAvg; |
|
63 | 63 |
|
64 |
private static int currentDim= DIM_2D;
|
|
64 |
private int currentDim= DIM_2D; |
|
65 | 65 |
|
66 |
private static Static1D p1D;
|
|
67 |
private static Static2D p2D;
|
|
68 |
private static Static3D p3D;
|
|
66 |
private Static1D p1D; |
|
67 |
private Static2D p2D; |
|
68 |
private Static3D p3D; |
|
69 | 69 |
|
70 |
private static Static1D p1N;
|
|
71 |
private static Static2D p2N;
|
|
72 |
private static Static3D p3N;
|
|
70 |
private Static1D p1N; |
|
71 |
private Static2D p2N; |
|
72 |
private Static3D p3N; |
|
73 | 73 |
|
74 |
private static float[] mPoints = new float[3*NUM_POINTS];
|
|
74 |
private float[] mPoints = new float[3*NUM_POINTS]; |
|
75 | 75 |
|
76 | 76 |
/////////////////////////////////////////////////////////////////// |
77 | 77 |
|
... | ... | |
116 | 116 |
|
117 | 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
118 | 118 |
|
119 |
public static void onSurfaceChanged(int width,int height)
|
|
119 |
public void onSurfaceChanged(int width,int height) |
|
120 | 120 |
{ |
121 | 121 |
mAvg = (width+height)/2; |
122 | 122 |
|
... | ... | |
131 | 131 |
|
132 | 132 |
/////////////////////////////////////////////////////////////////// |
133 | 133 |
|
134 |
public static void setMode(int mode)
|
|
134 |
public void setMode(int mode) |
|
135 | 135 |
{ |
136 | 136 |
di1D.setMode(mode); |
137 | 137 |
di2D.setMode(mode); |
... | ... | |
140 | 140 |
|
141 | 141 |
/////////////////////////////////////////////////////////////////// |
142 | 142 |
|
143 |
public static void setDuration(int duration)
|
|
143 |
public void setDuration(int duration) |
|
144 | 144 |
{ |
145 | 145 |
mDuration = duration; |
146 | 146 |
|
... | ... | |
151 | 151 |
|
152 | 152 |
/////////////////////////////////////////////////////////////////// |
153 | 153 |
|
154 |
public static void setNoise(float noise0, float noise1, float noise2)
|
|
154 |
public void setNoise(float noise0, float noise1, float noise2) |
|
155 | 155 |
{ |
156 | 156 |
mNoise0 = noise0; |
157 | 157 |
mNoise1 = noise1; |
... | ... | |
168 | 168 |
|
169 | 169 |
/////////////////////////////////////////////////////////////////// |
170 | 170 |
|
171 |
public static void setDimension(int dim)
|
|
171 |
public void setDimension(int dim) |
|
172 | 172 |
{ |
173 | 173 |
if( currentDim != dim ) |
174 | 174 |
{ |
... | ... | |
190 | 190 |
|
191 | 191 |
/////////////////////////////////////////////////////////////////// |
192 | 192 |
|
193 |
public static void drawCurve(Canvas c, long time)
|
|
193 |
public void drawCurve(Canvas c, long time) |
|
194 | 194 |
{ |
195 | 195 |
if ( ++mPosition >= NUM_POINTS ) mPosition=0; |
196 | 196 |
|
... | ... | |
207 | 207 |
|
208 | 208 |
/////////////////////////////////////////////////////////////////// |
209 | 209 |
|
210 |
private static void clearPoints()
|
|
210 |
private void clearPoints() |
|
211 | 211 |
{ |
212 | 212 |
for(int i=0; i<3*NUM_POINTS; i++) |
213 | 213 |
{ |
... | ... | |
217 | 217 |
|
218 | 218 |
/////////////////////////////////////////////////////////////////// |
219 | 219 |
|
220 |
private static void drawCurve1D(Canvas c, long time)
|
|
220 |
private void drawCurve1D(Canvas c, long time) |
|
221 | 221 |
{ |
222 | 222 |
int len = di1D.getNumPoints(); |
223 | 223 |
mPaint.setColor(0xff000000); |
... | ... | |
250 | 250 |
|
251 | 251 |
/////////////////////////////////////////////////////////////////// |
252 | 252 |
|
253 |
private static void drawCurve2D(Canvas c, long time)
|
|
253 |
private void drawCurve2D(Canvas c, long time) |
|
254 | 254 |
{ |
255 | 255 |
int len = di2D.getNumPoints(); |
256 | 256 |
mPaint.setColor(0xff000000); |
... | ... | |
286 | 286 |
|
287 | 287 |
/////////////////////////////////////////////////////////////////// |
288 | 288 |
|
289 |
private static void drawCurve3D(Canvas c, long time)
|
|
289 |
private void drawCurve3D(Canvas c, long time) |
|
290 | 290 |
{ |
291 | 291 |
int len = di3D.getNumPoints(); |
292 | 292 |
mPaint.setColor(0xff000000); |
Also available in: Unified diff
remote unneeded 'static' variables and methods from the 'Dynamic' app