Project

General

Profile

« Previous | Next » 

Revision d425545a

Added by Leszek Koltunski almost 8 years ago

Some more progress with porting apps to new VERTEX API.

View differences:

src/main/java/org/distorted/library/DistortedObject.java
28 28
import org.distorted.library.type.Data2D;
29 29
import org.distorted.library.type.Data3D;
30 30
import org.distorted.library.type.Data4D;
31
import org.distorted.library.type.Dynamic;
32
import org.distorted.library.type.Dynamic1D;
33
import org.distorted.library.type.Dynamic2D;
34
import org.distorted.library.type.Dynamic3D;
35
import org.distorted.library.type.Dynamic4D;
36
import org.distorted.library.type.Static1D;
37 31
import org.distorted.library.type.Static2D;
38 32
import org.distorted.library.type.Static3D;
39
import org.distorted.library.type.Static4D;
40
import org.distorted.library.type.DynamicQuat;
41 33

  
42 34
///////////////////////////////////////////////////////////////////////////////////////////////////
43 35
/**
44 36
 * All Objects to which Distorted Graphics effects can be applied need to be extended from here.
45 37
 */
46 38
public abstract class DistortedObject 
47
{
48
    private static final Static2D mZero2D = new Static2D(0,0);
49
    private static final Static3D mZero3D = new Static3D(0,0,0);
50

  
51
    private static float[] mViewMatrix   = new float[16];
39
  {
40
  private static float[] mViewMatrix   = new float[16];
52 41
   
53
    protected EffectQueueMatrix    mM;
54
    protected EffectQueueFragment  mF;
55
    protected EffectQueueVertex    mV;
42
  protected EffectQueueMatrix    mM;
43
  protected EffectQueueFragment  mF;
44
  protected EffectQueueVertex    mV;
56 45

  
57
    protected boolean matrixCloned, vertexCloned, fragmentCloned;
46
  protected boolean matrixCloned, vertexCloned, fragmentCloned;
58 47
 
59
    protected DistortedObjectGrid mGrid = null;
60
    protected long mID;
61
    protected int mSizeX, mSizeY, mSizeZ, mSize; // in screen space
48
  protected DistortedObjectGrid mGrid = null;
49
  protected long mID;
50
  protected int mSizeX, mSizeY, mSizeZ, mSize; // in screen space
62 51

  
63
    protected Bitmap[] mBmp= null; // 
64
    int[] mTextureDataH;           // have to be shared among all the cloned Objects
65
    boolean[] mBitmapSet;          // 
52
  protected Bitmap[] mBmp= null; //
53
  int[] mTextureDataH;           // have to be shared among all the cloned Objects
54
  boolean[] mBitmapSet;          //
66 55

  
67 56
///////////////////////////////////////////////////////////////////////////////////////////////////
68 57

  
69
    protected abstract DistortedObject deepCopy(int flags);
58
  protected abstract DistortedObject deepCopy(int flags);
70 59

  
71 60
///////////////////////////////////////////////////////////////////////////////////////////////////
72 61

  
73
    protected void initializeData(int size)
74
      {
75
      mID             = DistortedObjectList.add(this);
76
      mSize           = size;
77
      mTextureDataH   = new int[1];
78
      mTextureDataH[0]= 0;
79
      mBmp            = new Bitmap[1];
80
      mBmp[0]         = null;
81
      mBitmapSet      = new boolean[1];
82
      mBitmapSet[0]   = false;
62
  protected void initializeData(int size)
63
    {
64
    mID             = DistortedObjectList.add(this);
65
    mSize           = size;
66
    mTextureDataH   = new int[1];
67
    mTextureDataH[0]= 0;
68
    mBmp            = new Bitmap[1];
69
    mBmp[0]         = null;
70
    mBitmapSet      = new boolean[1];
71
    mBitmapSet[0]   = false;
83 72
      
84
      initializeEffectLists(this,0);
73
    initializeEffectLists(this,0);
85 74
      
86
      if( Distorted.isInitialized() ) resetTexture();    
87
      }
75
    if( Distorted.isInitialized() ) resetTexture();
76
    }
88 77
    
89 78
///////////////////////////////////////////////////////////////////////////////////////////////////
90 79
    
91
    protected void initializeEffectLists(DistortedObject d, int flags)
80
  protected void initializeEffectLists(DistortedObject d, int flags)
81
    {
82
    if( (flags & Distorted.CLONE_PRESHADER) != 0 )
92 83
      {
93
      if( (flags & Distorted.CLONE_PRESHADER) != 0 )
94
        {
95
        mM = d.mM;
96
        matrixCloned = true;
97
        } 
98
      else
99
        {
100
        mM = new EffectQueueMatrix(d);
101
        matrixCloned = false;  
102
        }
84
      mM = d.mM;
85
      matrixCloned = true;
86
      }
87
    else
88
      {
89
      mM = new EffectQueueMatrix(d);
90
      matrixCloned = false;
91
      }
103 92
    
104
      if( (flags & Distorted.CLONE_VERTEX) != 0 )
105
        {
106
        mV = d.mV;
107
        vertexCloned = true;
108
        } 
109
      else
110
        {
111
        mV = new EffectQueueVertex(d);
112
        vertexCloned = false;  
113
        }
93
    if( (flags & Distorted.CLONE_VERTEX) != 0 )
94
      {
95
      mV = d.mV;
96
      vertexCloned = true;
97
      }
98
    else
99
      {
100
      mV = new EffectQueueVertex(d);
101
      vertexCloned = false;
102
      }
114 103
    
115
      if( (flags & Distorted.CLONE_FRAGMENT) != 0 )
116
        {
117
        mF = d.mF;
118
        fragmentCloned = true;
119
        } 
120
      else
121
        {
122
        mF = new EffectQueueFragment(d);
123
        fragmentCloned = false;   
124
        }
104
    if( (flags & Distorted.CLONE_FRAGMENT) != 0 )
105
      {
106
      mF = d.mF;
107
      fragmentCloned = true;
125 108
      }
109
    else
110
      {
111
      mF = new EffectQueueFragment(d);
112
      fragmentCloned = false;
113
      }
114
    }
126 115
    
127 116
///////////////////////////////////////////////////////////////////////////////////////////////////
128 117
// this will be called on startup and every time OpenGL context has been lost
129 118
// also call this from the constructor if the OpenGL context has been created already.
130 119
    
131
    void resetTexture()
120
  void resetTexture()
121
    {
122
    if( mTextureDataH!=null )
132 123
      {
133
      if( mTextureDataH!=null ) 
134
        {
135
        if( mTextureDataH[0]==0 ) GLES20.glGenTextures(1, mTextureDataH, 0);
124
      if( mTextureDataH[0]==0 ) GLES20.glGenTextures(1, mTextureDataH, 0);
136 125

  
137
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);       
138
        GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR );
139
        GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR );
140
        GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE );
141
        GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE );
126
      GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);
127
      GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR );
128
      GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR );
129
      GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE );
130
      GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE );
142 131
       
143
        if( mBmp!=null && mBmp[0]!=null)
144
          {
145
          GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mBmp[0], 0);
146
          mBmp[0] = null;
147
          }
132
      if( mBmp!=null && mBmp[0]!=null)
133
        {
134
        GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mBmp[0], 0);
135
        mBmp[0] = null;
148 136
        }
149 137
      }
138
    }
150 139
  
151 140
///////////////////////////////////////////////////////////////////////////////////////////////////
152 141
   
153
    void drawPriv(long currTime, DistortedProjection dp)
154
      {
155
      GLES20.glViewport(0, 0, dp.width, dp.height); 
142
  void drawPriv(long currTime, DistortedProjection dp)
143
    {
144
    GLES20.glViewport(0, 0, dp.width, dp.height);
156 145
      
157
      mM.compute(currTime);
158
      mM.send(mViewMatrix, dp);
146
    mM.compute(currTime);
147
    mM.send(mViewMatrix, dp);
159 148
      
160
      mV.compute(currTime);
161
      mV.postprocess();
162
      mV.send();
149
    mV.compute(currTime);
150
    mV.postprocess();
151
    mV.send();
163 152
        
164
      mF.compute(currTime);
165
      mF.postprocess(mViewMatrix);
166
      mF.send();
153
    mF.compute(currTime);
154
    mF.postprocess(mViewMatrix);
155
    mF.send();
167 156
       
168
      mGrid.draw();
169
      }
157
    mGrid.draw();
158
    }
170 159

  
171 160
///////////////////////////////////////////////////////////////////////////////////////////////////
172 161
   
173
    void drawNoEffectsPriv(DistortedProjection dp)
174
      {
175
      GLES20.glViewport(0, 0, dp.width, dp.height);
176
      mM.sendNoEffects(dp);
177
      mV.sendZero();
178
      mF.sendZero();
179
      mGrid.draw();
180
      }
162
  void drawNoEffectsPriv(DistortedProjection dp)
163
    {
164
    GLES20.glViewport(0, 0, dp.width, dp.height);
165
    mM.sendNoEffects(dp);
166
    mV.sendZero();
167
    mF.sendZero();
168
    mGrid.draw();
169
    }
181 170
    
182 171
///////////////////////////////////////////////////////////////////////////////////////////////////
183 172
   
184
    void releasePriv()
185
      {
186
      if( matrixCloned  ==false) mM.abortAll();
187
      if( vertexCloned  ==false) mV.abortAll();
188
      if( fragmentCloned==false) mF.abortAll();
189

  
190
      mBmp          = null;
191
      mGrid         = null;
192
      mM            = null;
193
      mV            = null;
194
      mF            = null;
195
      mTextureDataH = null;
196
      }
173
  void releasePriv()
174
    {
175
    if( matrixCloned  ==false) mM.abortAll();
176
    if( vertexCloned  ==false) mV.abortAll();
177
    if( fragmentCloned==false) mF.abortAll();
178

  
179
    mBmp          = null;
180
    mGrid         = null;
181
    mM            = null;
182
    mV            = null;
183
    mF            = null;
184
    mTextureDataH = null;
185
    }
197 186
 
198 187
///////////////////////////////////////////////////////////////////////////////////////////////////
199 188

  
200
    long getBitmapID()
189
  long getBitmapID()
201 190
      {
202 191
      return mBmp==null ? 0 : mBmp.hashCode();
203 192
      }
204 193

  
205 194
///////////////////////////////////////////////////////////////////////////////////////////////////
195
/**
196
 * Default empty constructor so that derived classes can call it
197
 */
198
  public DistortedObject()
199
    {
206 200

  
207
  /**
208
   * Default empty constructor so that derived classes can call it
209
   */
210
    public DistortedObject()
211
      {
212

  
213
      }
201
    }
214 202

  
215 203
///////////////////////////////////////////////////////////////////////////////////////////////////
216
  /**
217
   * Copy constructor used to create a DistortedObject based on various parts of another object.
218
   * <p>
219
   * Whatever we do not clone gets created just like in the default constructor.
220
   * We only call this from the descendant's classes' constructors where we have to pay attention
221
   * to give it the appropriate type of a DistortedObject!
222
   *
223
   * @param dc    Source object to create our object from
224
   * @param flags A bitmask of values specifying what to copy.
225
   *              For example, CLONE_BITMAP | CLONE_MATRIX.
226
   */
227
    public DistortedObject(DistortedObject dc, int flags)
228
      {
229
      initializeEffectLists(dc,flags);
204
/**
205
 * Copy constructor used to create a DistortedObject based on various parts of another object.
206
 * <p>
207
 * Whatever we do not clone gets created just like in the default constructor.
208
 * We only call this from the descendant's classes' constructors where we have to pay attention
209
 * to give it the appropriate type of a DistortedObject!
210
 *
211
 * @param dc    Source object to create our object from
212
 * @param flags A bitmask of values specifying what to copy.
213
 *              For example, CLONE_BITMAP | CLONE_MATRIX.
214
 */
215
  public DistortedObject(DistortedObject dc, int flags)
216
    {
217
    initializeEffectLists(dc,flags);
230 218

  
231
      mID = DistortedObjectList.add(this);
219
    mID = DistortedObjectList.add(this);
232 220

  
233
      mSizeX = dc.mSizeX;
234
      mSizeY = dc.mSizeY;
235
      mSizeZ = dc.mSizeZ;
236
      mSize  = dc.mSize;
237
      mGrid  = dc.mGrid;
221
    mSizeX = dc.mSizeX;
222
    mSizeY = dc.mSizeY;
223
    mSizeZ = dc.mSizeZ;
224
    mSize  = dc.mSize;
225
    mGrid  = dc.mGrid;
238 226

  
239
      if( (flags & Distorted.CLONE_BITMAP) != 0 )
240
        {
241
        mTextureDataH = dc.mTextureDataH;
242
        mBmp          = dc.mBmp;
243
        mBitmapSet    = dc.mBitmapSet;
244
        }
245
      else
246
        {
247
        mTextureDataH   = new int[1];
248
        mTextureDataH[0]= 0;
249
        mBitmapSet      = new boolean[1];
250
        mBitmapSet[0]   = false;
251
        mBmp            = new Bitmap[1];
252
        mBmp[0]         = null;
253

  
254
        if( Distorted.isInitialized() ) resetTexture();
255
        }
227
    if( (flags & Distorted.CLONE_BITMAP) != 0 )
228
      {
229
      mTextureDataH = dc.mTextureDataH;
230
      mBmp          = dc.mBmp;
231
      mBitmapSet    = dc.mBitmapSet;
256 232
      }
233
    else
234
      {
235
      mTextureDataH   = new int[1];
236
      mTextureDataH[0]= 0;
237
      mBitmapSet      = new boolean[1];
238
      mBitmapSet[0]   = false;
239
      mBmp            = new Bitmap[1];
240
      mBmp[0]         = null;
241

  
242
      if( Distorted.isInitialized() ) resetTexture();
243
      }
244
    }
257 245

  
258 246
///////////////////////////////////////////////////////////////////////////////////////////////////
259 247
/**
......
263 251
 *        This gets passed on to Interpolators inside the Effects that are currently applied to the 
264 252
 *        Object.
265 253
 */
266
   public void draw(long currTime)
267
     {
268
     GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
269
     GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
270
     GLES20.glUniform1i(Distorted.mTextureUniformH, 0);  
271
     GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]); 
254
  public void draw(long currTime)
255
    {
256
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
257
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
258
    GLES20.glUniform1i(Distorted.mTextureUniformH, 0);
259
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);
272 260
      
273
     drawPriv(currTime, Distorted.mProjection);
274
     }
261
    drawPriv(currTime, Distorted.mProjection);
262
    }
275 263
 
276 264
///////////////////////////////////////////////////////////////////////////////////////////////////
277 265
/**
278 266
 * Releases all resources.
279 267
 */
280
   public synchronized void release()
281
     {
282
     releasePriv();  
283
     DistortedObjectList.remove(this);
284
     }
268
  public synchronized void release()
269
    {
270
    releasePriv();
271
    DistortedObjectList.remove(this);
272
    }
285 273

  
286 274
///////////////////////////////////////////////////////////////////////////////////////////////////
287 275
/**
......
293 281
 * @param bmp The android.graphics.Bitmap object to apply effects to and display.
294 282
 */
295 283
   
296
   public void setBitmap(Bitmap bmp)
297
     {
298
     mBitmapSet[0] = true; 
284
  public void setBitmap(Bitmap bmp)
285
    {
286
    mBitmapSet[0] = true;
299 287
      
300
     if( Distorted.isInitialized() )
301
       {
302
       GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
303
       GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);        
304
       GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bmp, 0);
305
       }
306
     else
307
       {
308
       mBmp[0] = bmp;  
309
       }
310
     }
288
    if( Distorted.isInitialized() )
289
      {
290
      GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
291
      GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);
292
      GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bmp, 0);
293
      }
294
    else
295
      {
296
      mBmp[0] = bmp;
297
      }
298
    }
311 299
    
312 300
///////////////////////////////////////////////////////////////////////////////////////////////////
313 301
/**
......
316 304
 * 
317 305
 * @param el A class implementing the EffectListener interface that wants to get notifications.
318 306
 */
319
   public void addEventListener(EffectListener el)
320
     {
321
     mV.addListener(el);
322
     mF.addListener(el);
323
     mM.addListener(el);
324
     }
307
  public void addEventListener(EffectListener el)
308
    {
309
    mV.addListener(el);
310
    mF.addListener(el);
311
    mM.addListener(el);
312
    }
325 313

  
326 314
///////////////////////////////////////////////////////////////////////////////////////////////////
327 315
/**
......
329 317
 * 
330 318
 * @param el A class implementing the EffectListener interface that no longer wants to get notifications.
331 319
 */
332
   public void removeEventListener(EffectListener el)
333
     {
334
     mV.removeListener(el);
335
     mF.removeListener(el);
336
     mM.removeListener(el);
337
     }
320
  public void removeEventListener(EffectListener el)
321
    {
322
    mV.removeListener(el);
323
    mF.removeListener(el);
324
    mM.removeListener(el);
325
    }
338 326
   
339 327
///////////////////////////////////////////////////////////////////////////////////////////////////
340 328
/**
......
342 330
 *    
343 331
 * @return height of the object, in pixels.
344 332
 */
345
   public int getWidth()
333
  public int getWidth()
346 334
     {
347 335
     return mSizeX;   
348 336
     }
......
353 341
 * 
354 342
 * @return width of the Object, in pixels.
355 343
 */
356
    public int getHeight()
344
  public int getHeight()
357 345
      {
358 346
      return mSizeY;  
359 347
      }
......
364 352
 * 
365 353
 * @return depth of the Object, in pixels.
366 354
 */
367
    public int getDepth()
355
  public int getDepth()
368 356
      {
369 357
      return mSizeZ;  
370 358
      }
......
375 363
 * 
376 364
 * @return ID of the object.
377 365
 */
378
    public long getID()
366
  public long getID()
379 367
      {
380 368
      return mID;  
381 369
      }
......
385 373
 * Aborts all Effects.
386 374
 * @return Number of effects aborted.
387 375
 */
388
    public int abortAllEffects()
376
  public int abortAllEffects()
389 377
      {
390 378
      return mM.abortAll() + mV.abortAll() + mF.abortAll();
391 379
      }
......
397 385
 * @param type one of the constants defined in {@link EffectTypes}
398 386
 * @return Number of effects aborted.
399 387
 */
400
    public int abortEffects(EffectTypes type)
388
  public int abortEffects(EffectTypes type)
389
    {
390
    switch(type)
401 391
      {
402
      switch(type)
403
        {
404
        case MATRIX  : return mM.abortAll();
405
        case VERTEX  : return mV.abortAll();
406
        case FRAGMENT: return mF.abortAll();
407
        default      : return 0;
408
        }
392
      case MATRIX  : return mM.abortAll();
393
      case VERTEX  : return mV.abortAll();
394
      case FRAGMENT: return mF.abortAll();
395
      default      : return 0;
409 396
      }
397
    }
410 398
    
411 399
///////////////////////////////////////////////////////////////////////////////////////////////////
412 400
/**
......
415 403
 * @param id ID of the Effect we want to abort.
416 404
 * @return number of Effects aborted. Always either 0 or 1.
417 405
 */
418
    public int abortEffect(long id)
419
      {
420
      int type = (int)(id&EffectTypes.MASK);
406
  public int abortEffect(long id)
407
    {
408
    int type = (int)(id&EffectTypes.MASK);
421 409

  
422
      if( type==EffectTypes.MATRIX.type   ) return mM.removeByID(id>>EffectTypes.LENGTH);
423
      if( type==EffectTypes.VERTEX.type   ) return mV.removeByID(id>>EffectTypes.LENGTH);
424
      if( type==EffectTypes.FRAGMENT.type ) return mF.removeByID(id>>EffectTypes.LENGTH);
410
    if( type==EffectTypes.MATRIX.type   ) return mM.removeByID(id>>EffectTypes.LENGTH);
411
    if( type==EffectTypes.VERTEX.type   ) return mV.removeByID(id>>EffectTypes.LENGTH);
412
    if( type==EffectTypes.FRAGMENT.type ) return mF.removeByID(id>>EffectTypes.LENGTH);
425 413

  
426
      return 0;
427
      }
414
    return 0;
415
    }
428 416

  
429 417
///////////////////////////////////////////////////////////////////////////////////////////////////
430 418
/**
......
433 421
 * @param name one of the constants defined in {@link EffectNames}
434 422
 * @return number of Effects aborted.
435 423
 */
436
    public int abortEffects(EffectNames name)
424
  public int abortEffects(EffectNames name)
425
    {
426
    switch(name.getType())
437 427
      {
438
      switch(name.getType())
439
        {
440
        case MATRIX  : return mM.removeByType(name);
441
        case VERTEX  : return mV.removeByType(name);
442
        case FRAGMENT: return mF.removeByType(name);
443
        default      : return 0;
444
        }
428
      case MATRIX  : return mM.removeByType(name);
429
      case VERTEX  : return mV.removeByType(name);
430
      case FRAGMENT: return mF.removeByType(name);
431
      default      : return 0;
445 432
      }
433
    }
446 434
    
447 435
///////////////////////////////////////////////////////////////////////////////////////////////////
448 436
/**
......
452 440
 * @return <code>true</code> if a single Effect of type effectType has been found.
453 441
 */
454 442
    
455
    public boolean printEffect(long id)
456
      {
457
      int type = (int)(id&EffectTypes.MASK);
443
  public boolean printEffect(long id)
444
    {
445
    int type = (int)(id&EffectTypes.MASK);
458 446

  
459
      if( type==EffectTypes.MATRIX.type   )  return mM.printByID(id>>EffectTypes.LENGTH);
460
      if( type==EffectTypes.VERTEX.type   )  return mV.printByID(id>>EffectTypes.LENGTH);
461
      if( type==EffectTypes.FRAGMENT.type )  return mF.printByID(id>>EffectTypes.LENGTH);
447
    if( type==EffectTypes.MATRIX.type   )  return mM.printByID(id>>EffectTypes.LENGTH);
448
    if( type==EffectTypes.VERTEX.type   )  return mV.printByID(id>>EffectTypes.LENGTH);
449
    if( type==EffectTypes.FRAGMENT.type )  return mF.printByID(id>>EffectTypes.LENGTH);
462 450

  
463
      return false;
464
      }
451
    return false;
452
    }
465 453
   
466 454
///////////////////////////////////////////////////////////////////////////////////////////////////   
467 455
///////////////////////////////////////////////////////////////////////////////////////////////////
......
501 489
 * @param scale The factor to scale all 3 dimensions with.
502 490
 * @return      ID of the effect added, or -1 if we failed to add one.
503 491
 */
504
public long scale(float scale)
505
  {
506
  return mM.add(EffectNames.SCALE, new Static3D(scale,scale,scale));
507
  }
492
  public long scale(float scale)
493
    {
494
    return mM.add(EffectNames.SCALE, new Static3D(scale,scale,scale));
495
    }
508 496

  
509 497
///////////////////////////////////////////////////////////////////////////////////////////////////
510 498
/**
......
765 753
///////////////////////////////////////////////////////////////////////////////////////////////////
766 754
/**
767 755
 * Distort a (possibly changing in time) part of the Object by a (possibly changing in time) vector of force.
768
 * <p>
769
 * Only at most one of the 'center' and 'region' can be a Dynamic!
770 756
 *
771 757
 * @param vector 3-dimensional Vector which represents the force the Center of the Effect is
772 758
 *               currently being dragged with.
......
788 774
 * @param center 2-dimensional Data that, at any given time, returns the Center of the Effect.
789 775
 * @return       ID of the effect added, or -1 if we failed to add one.
790 776
 */
791
public long distort(Data3D vector, Data2D center)
792
  {
793
  return mV.add(EffectNames.DISTORT, vector, center);
794
  }
777
  public long distort(Data3D vector, Data2D center)
778
    {
779
    return mV.add(EffectNames.DISTORT, vector, center);
780
    }
795 781

  
796 782
///////////////////////////////////////////////////////////////////////////////////////////////////
797 783
/**
......
811 797
/**
812 798
 * Pull all points around the center of the Effect towards the center (if degree>=1) or push them
813 799
 * away from the center (degree<=1)
814
 * <p>
815
 * Only at most one of the 'center' and 'region' can be a Dynamic!
816 800
 *
817 801
 * @param sink   The current degree of the Effect.
818 802
 * @param center 2-dimensional Data that, at any given time, returns the Center of the Effect.
......
833 817
 * @param center 2-dimensional Data that, at any given time, returns the Center of the Effect.
834 818
 * @return       ID of the effect added, or -1 if we failed to add one.
835 819
 */
836
public long sink(Data1D sink, Data2D center)
837
  {
838
  return mV.add(EffectNames.SINK, sink, center);
839
  }
820
  public long sink(Data1D sink, Data2D center)
821
    {
822
    return mV.add(EffectNames.SINK, sink, center);
823
    }
840 824

  
841 825
///////////////////////////////////////////////////////////////////////////////////////////////////  
842 826
/**
843 827
 * Rotate part of the Object around the Center of the Effect by a certain angle.
844
 * <p>
845
 * Only at most one of the 'center' and 'region' can be a Dynamic!
846 828
 *
847 829
 * @param swirl  The degree of Swirl. Positive values swirl clockwise.
848 830
 * @param center 2-dimensional Data that, at any given time, returns the Center of the Effect.
......
862 844
 * @param center 2-dimensional Data that, at any given time, returns the Center of the Effect.
863 845
 * @return       ID of the effect added, or -1 if we failed to add one.
864 846
 */
865
public long swirl(Data1D swirl, Data2D center)
866
  {
867
  return mV.add(EffectNames.SWIRL, swirl, center);
847
  public long swirl(Data1D swirl, Data2D center)
848
    {
849
    return mV.add(EffectNames.SWIRL, swirl, center);
850
    }
868 851
  }
869
}

Also available in: Unified diff