commit 0dd98279052b6560b88d5933ceeddcfed2bdfd90
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Fri Jun 16 16:30:59 2017 +0100

    Simplify Effect classes.

diff --git a/src/main/java/org/distorted/library/effect/FragmentEffect.java b/src/main/java/org/distorted/library/effect/FragmentEffect.java
index d0b50f1..97f09b6 100644
--- a/src/main/java/org/distorted/library/effect/FragmentEffect.java
+++ b/src/main/java/org/distorted/library/effect/FragmentEffect.java
@@ -21,11 +21,11 @@ package org.distorted.library.effect;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // FRAGMENT EFFECTS
-// 8 Uniforms: 4-per effect interpolated values, 4 dimensional Region.
+
 
 public abstract class FragmentEffect extends Effect
   {
-  public static final int NUM_UNIFORMS = 8;
+  public static final int NUM_UNIFORMS = 8; // 4-per effect interpolated values, 4 dimensional Region.
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
diff --git a/src/main/java/org/distorted/library/effect/MatrixEffect.java b/src/main/java/org/distorted/library/effect/MatrixEffect.java
index f6322e6..f8c724a 100644
--- a/src/main/java/org/distorted/library/effect/MatrixEffect.java
+++ b/src/main/java/org/distorted/library/effect/MatrixEffect.java
@@ -19,20 +19,12 @@
 
 package org.distorted.library.effect;
 
-import org.distorted.library.type.*;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // MATRIX EFFECTS.
-// 7 Uniforms: 4 per-effect interpolated values + 3 dimensional center.
 
 public abstract class MatrixEffect extends Effect
   {
-  public static final int NUM_UNIFORMS = 7;
-
-  Dynamic mDynamic0;
-  Static  mStatic0 , mStatic1;
-  Dynamic3D mDynamicCenter;
-  Static3D mStaticCenter;
+  public static final int NUM_UNIFORMS = 7; // 4 per-effect interpolated values + 3 dimensional center.
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
diff --git a/src/main/java/org/distorted/library/effect/MatrixEffectMove.java b/src/main/java/org/distorted/library/effect/MatrixEffectMove.java
index d461150..df534bd 100644
--- a/src/main/java/org/distorted/library/effect/MatrixEffectMove.java
+++ b/src/main/java/org/distorted/library/effect/MatrixEffectMove.java
@@ -27,6 +27,8 @@ import org.distorted.library.type.Static3D;
 
 public class MatrixEffectMove extends MatrixEffect
   {
+  private Data3D mVector;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Moves the Object by a (possibly changing in time) vector.
@@ -37,32 +39,13 @@ public class MatrixEffectMove extends MatrixEffect
   public MatrixEffectMove(Data3D vector)
     {
     super(EffectName.MOVE);
-
-    if( vector instanceof Static3D)
-      {
-      mStatic0 = (Static3D)vector;
-      }
-    else if ( vector instanceof Dynamic3D )
-      {
-      mDynamic0 = (Dynamic3D)vector;
-      }
+    mVector = vector;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static3D)mStatic0).getX();
-      uniforms[index+1] = ((Static3D)mStatic0).getY();
-      uniforms[index+2] = ((Static3D)mStatic0).getZ();
-
-      return false;
-      }
+    return mVector.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/MatrixEffectQuaternion.java b/src/main/java/org/distorted/library/effect/MatrixEffectQuaternion.java
index 530f4f9..e07143d 100644
--- a/src/main/java/org/distorted/library/effect/MatrixEffectQuaternion.java
+++ b/src/main/java/org/distorted/library/effect/MatrixEffectQuaternion.java
@@ -30,6 +30,9 @@ import org.distorted.library.type.Static4D;
 
 public class MatrixEffectQuaternion extends MatrixEffect
   {
+  private Data4D mQuaternion;
+  private Data3D mCenter;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Rotates the Object by quaternion.
@@ -40,53 +43,15 @@ public class MatrixEffectQuaternion extends MatrixEffect
   public MatrixEffectQuaternion(Data4D quaternion, Data3D center )
     {
     super(EffectName.QUATERNION);
-
-    if( quaternion instanceof Static4D)
-      {
-      mStatic0 = (Static4D)quaternion;
-      }
-    else if( quaternion instanceof DynamicQuat)
-      {
-      mDynamic0 = (DynamicQuat)quaternion;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D)
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
+    mQuaternion = quaternion;
+    mCenter = center;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+4,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+4] = mStaticCenter.getX();
-      uniforms[index+5] = mStaticCenter.getY();
-      uniforms[index+6] = mStaticCenter.getZ();
-      }
-
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static4D)mStatic0).getX();
-      uniforms[index+1] = ((Static4D)mStatic0).getY();
-      uniforms[index+2] = ((Static4D)mStatic0).getZ();
-      uniforms[index+3] = ((Static4D)mStatic0).getW();
-
-      return false;
-      }
+    mCenter.get(uniforms,index+4,currentDuration,step);
+    return mQuaternion.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/MatrixEffectRotate.java b/src/main/java/org/distorted/library/effect/MatrixEffectRotate.java
index d794f12..544f684 100644
--- a/src/main/java/org/distorted/library/effect/MatrixEffectRotate.java
+++ b/src/main/java/org/distorted/library/effect/MatrixEffectRotate.java
@@ -33,6 +33,9 @@ import org.distorted.library.type.Static4D;
 
 public class MatrixEffectRotate extends MatrixEffect
   {
+  private Data1D mAngle;
+  private Data3D mAxis, mCenter;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Rotates the Object by 'angle' degrees around the center.
@@ -42,103 +45,20 @@ public class MatrixEffectRotate extends MatrixEffect
  * @param axis   Axis of rotation
  * @param center Coordinates of the Point we are rotating around.
  */
-  public MatrixEffectRotate(Data1D angle, Static3D axis, Data3D center)
-    {
-    super(EffectName.ROTATE);
-
-    if( angle instanceof Static1D )
-      {
-      mStatic0 = (Static1D)angle;
-      }
-    else if( angle instanceof Dynamic1D )
-      {
-      mDynamic0 = (Dynamic1D)angle;
-      }
-
-    mStatic1 = axis;
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Rotates the Object by 'angle' degrees around the center.
- * Here both angle and axis can dynamically change.
- *
- * @param angleaxis Combined 4-tuple representing the (angle,axisX,axisY,axisZ).
- * @param center    Coordinates of the Point we are rotating around.
- */
-  public MatrixEffectRotate(Data4D angleaxis, Data3D center)
+  public MatrixEffectRotate(Data1D angle, Data3D axis, Data3D center)
     {
     super(EffectName.ROTATE);
-
-    if( angleaxis instanceof Static4D)
-      {
-      mStatic0 = (Static4D)angleaxis;
-      }
-    else if( angleaxis instanceof Dynamic4D)
-      {
-      mDynamic0 = (Dynamic4D)angleaxis;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
+    mAngle = angle;
+    mAxis = axis;
+    mCenter = center;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+4,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+4] = mStaticCenter.getX();
-      uniforms[index+5] = mStaticCenter.getY();
-      uniforms[index+6] = mStaticCenter.getZ();
-      }
-
-    if( mStatic1 != null )
-      {
-      uniforms[index+1] = ((Static3D)mStatic1).getX();
-      uniforms[index+2] = ((Static3D)mStatic1).getY();
-      uniforms[index+3] = ((Static3D)mStatic1).getZ();
-      }
-
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      if( mStatic1 != null )
-        {
-        uniforms[index  ] = ((Static1D)mStatic0).getX();
-        }
-      else
-        {
-        uniforms[index  ] = ((Static4D)mStatic0).getX();
-        uniforms[index+1] = ((Static4D)mStatic0).getY();
-        uniforms[index+2] = ((Static4D)mStatic0).getZ();
-        uniforms[index+3] = ((Static4D)mStatic0).getW();
-        }
-
-      return false;
-      }
+    mCenter.get(uniforms,index+4,currentDuration,step);
+    mAxis.get(uniforms,index+1,currentDuration,step);
+    return mAngle.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/MatrixEffectScale.java b/src/main/java/org/distorted/library/effect/MatrixEffectScale.java
index cdefa17..2fa1fcd 100644
--- a/src/main/java/org/distorted/library/effect/MatrixEffectScale.java
+++ b/src/main/java/org/distorted/library/effect/MatrixEffectScale.java
@@ -27,6 +27,8 @@ import org.distorted.library.type.Static3D;
 
 public class MatrixEffectScale extends MatrixEffect
   {
+  private Data3D mScale;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Scales the Object by (possibly changing in time) 3D scale factors.
@@ -37,15 +39,7 @@ public class MatrixEffectScale extends MatrixEffect
   public MatrixEffectScale(Data3D scale)
     {
     super(EffectName.SCALE);
-
-    if( scale instanceof Static3D)
-      {
-      mStatic0 = (Static3D)scale;
-      }
-    else if ( scale instanceof Dynamic3D)
-      {
-      mDynamic0 = (Dynamic3D)scale;
-      }
+    mScale = scale;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -57,25 +51,13 @@ public class MatrixEffectScale extends MatrixEffect
   public MatrixEffectScale(float scale)
     {
     super(EffectName.SCALE);
-
-    mStatic0 = new Static3D(scale,scale,scale);
+    mScale = new Static3D(scale,scale,scale);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static3D)mStatic0).getX();
-      uniforms[index+1] = ((Static3D)mStatic0).getY();
-      uniforms[index+2] = ((Static3D)mStatic0).getZ();
-
-      return false;
-      }
+    return mScale.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/MatrixEffectShear.java b/src/main/java/org/distorted/library/effect/MatrixEffectShear.java
index f809bc8..3a2e336 100644
--- a/src/main/java/org/distorted/library/effect/MatrixEffectShear.java
+++ b/src/main/java/org/distorted/library/effect/MatrixEffectShear.java
@@ -27,6 +27,8 @@ import org.distorted.library.type.Static3D;
 
 public class MatrixEffectShear extends MatrixEffect
   {
+  private Data3D mShear, mCenter;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Shears the Object.
@@ -40,52 +42,15 @@ public class MatrixEffectShear extends MatrixEffect
   public MatrixEffectShear(Data3D shear, Data3D center)
     {
     super(EffectName.SHEAR);
-
-    if( shear instanceof Static3D)
-      {
-      mStatic0 = (Static3D)shear;
-      }
-    else if ( shear instanceof Dynamic3D)
-      {
-      mDynamic0 = (Dynamic3D)shear;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
+    mShear = shear;
+    mCenter = center;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+4,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+4] = mStaticCenter.getX();
-      uniforms[index+5] = mStaticCenter.getY();
-      uniforms[index+6] = mStaticCenter.getZ();
-      }
-
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static3D)mStatic0).getX();
-      uniforms[index+1] = ((Static3D)mStatic0).getY();
-      uniforms[index+2] = ((Static3D)mStatic0).getZ();
-
-      return false;
-      }
+    mCenter.get(uniforms,index+4,currentDuration,step);
+    return mShear.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/PostprocessEffect.java b/src/main/java/org/distorted/library/effect/PostprocessEffect.java
index 01f2f83..70d7cc3 100644
--- a/src/main/java/org/distorted/library/effect/PostprocessEffect.java
+++ b/src/main/java/org/distorted/library/effect/PostprocessEffect.java
@@ -19,19 +19,13 @@
 
 package org.distorted.library.effect;
 
-import org.distorted.library.type.Dynamic;
-import org.distorted.library.type.Static;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // POSTPROCESSING EFFECTS.
-// 5 Uniforms: 5 per-effect interpolated values.
+
 
 public abstract class PostprocessEffect extends Effect
   {
-  public static final int NUM_UNIFORMS = 5;
-
-  Dynamic mDynamic0, mDynamic1;
-  Static mStatic0, mStatic1;
+  public static final int NUM_UNIFORMS = 5; // 5 per-effect interpolated values.
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
diff --git a/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java b/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
index 831ecfe..cbd41ec 100644
--- a/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
+++ b/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
@@ -27,39 +27,25 @@ import org.distorted.library.type.Static1D;
 
 public class PostprocessEffectBlur extends PostprocessEffect
   {
+  private Data1D mBlurRadius;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Blur the object.
  *
- * @param radius The 'strength' if the effect, in pixels. 0 = no blur, 10 = when blurring a given pixel,
- *               take into account 10 pixels in each direction.
+ * @param blurRadius The 'strength' if the effect, in pixels. 0 = no blur, 10 = when blurring a given pixel,
+ *                   take into account 10 pixels in each direction.
  */
-  public PostprocessEffectBlur(Data1D radius)
+  public PostprocessEffectBlur(Data1D blurRadius)
     {
     super(EffectName.BLUR);
-
-    if( radius instanceof Dynamic1D)
-      {
-      mDynamic0 = (Dynamic1D)radius;
-      }
-    else if ( radius instanceof Static1D )
-      {
-      mStatic0  = (Static1D)radius;
-      }
+    mBlurRadius = blurRadius;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index] = ((Static1D)mStatic0).getX();
-      return false;
-      }
+    return mBlurRadius.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java b/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
index bf13db7..3e0456f 100644
--- a/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
+++ b/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
@@ -30,61 +30,29 @@ import org.distorted.library.type.Static4D;
 
 public class PostprocessEffectGlow extends PostprocessEffect
   {
+  private Data1D mGlowRadius;
+  private Data4D mColor;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Make the object glow with a specific color and a halo of specific radius.
  *
- * @param radius The 'strength' if the effect, in pixels. 0 = no halo, 10 = halo of roughly 10 pixels
- *               around the whole object.
- * @param color  RGBA of the color with which to draw the glow.
+ * @param glowRadius The 'strength' if the effect, in pixels. 0 = no halo, 10 = halo of roughly 10 pixels
+ *                   around the whole object.
+ * @param color      RGBA of the color with which to draw the glow.
  */
-  public PostprocessEffectGlow(Data1D radius, Data4D color)
+  public PostprocessEffectGlow(Data1D glowRadius, Data4D color)
     {
     super(EffectName.GLOW);
-
-    if( radius instanceof Dynamic1D)
-      {
-      mDynamic0 = (Dynamic1D)radius;
-      }
-    else if ( radius instanceof Static1D )
-      {
-      mStatic0  = (Static1D)radius;
-      }
-
-    if( color instanceof Dynamic4D)
-      {
-      mDynamic1 = (Dynamic4D)color;
-      }
-    else if ( color instanceof Static4D)
-      {
-      mStatic1  = (Static4D)color;
-      }
+    mGlowRadius = glowRadius;
+    mColor      = color;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    if( mDynamic1!=null )
-      {
-      mDynamic1.get(uniforms,index+1,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+1] = ((Static4D)mStatic1).getX();
-      uniforms[index+2] = ((Static4D)mStatic1).getY();
-      uniforms[index+3] = ((Static4D)mStatic1).getZ();
-      uniforms[index+4] = ((Static4D)mStatic1).getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      return mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static1D)mStatic0).getX();
-      return false;
-      }
+    mColor.get(uniforms,index+1,currentDuration,step);
+    return mGlowRadius.get(uniforms,index,currentDuration,step);
     }
   }
diff --git a/src/main/java/org/distorted/library/effect/VertexEffect.java b/src/main/java/org/distorted/library/effect/VertexEffect.java
index fd043b4..03a6297 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffect.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffect.java
@@ -19,27 +19,13 @@
 
 package org.distorted.library.effect;
 
-import org.distorted.library.type.Dynamic;
-import org.distorted.library.type.Dynamic3D;
-import org.distorted.library.type.Dynamic4D;
-import org.distorted.library.type.Static;
-import org.distorted.library.type.Static3D;
-import org.distorted.library.type.Static4D;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // VERTEX EFFECTS
-// 12 Uniforms: 5 per-effect interpolated values, 3-dimensional center, 4-dimensional Region
 
 public abstract class VertexEffect extends Effect
   {
-  public static final int NUM_UNIFORMS = 12;
+  public static final int NUM_UNIFORMS = 12; // 5 per-effect interpolated values, 3-dimensional center, 4-dimensional Region
 
-  Dynamic mDynamic0;
-  Static mStatic0;
-  Dynamic3D mDynamicCenter;
-  Static3D  mStaticCenter;
-  Dynamic4D mDynamicRegion;
-  Static4D  mStaticRegion;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectDeform.java b/src/main/java/org/distorted/library/effect/VertexEffectDeform.java
index d6111ac..2038605 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectDeform.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectDeform.java
@@ -30,6 +30,9 @@ import org.distorted.library.type.Static4D;
 
 public class VertexEffectDeform extends VertexEffect
   {
+  private Data3D mVector, mCenter;
+  private Data4D mRegion;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Deform the shape of the whole Object with a (possibly changing in time) vector of force applied to
@@ -42,40 +45,9 @@ public class VertexEffectDeform extends VertexEffect
   public VertexEffectDeform(Data3D vector, Data3D center, Data4D region)
     {
     super(EffectName.DEFORM);
-
-    if( vector instanceof Dynamic3D )
-      {
-      mDynamic0 = (Dynamic3D)vector;
-      }
-    else if ( vector instanceof Static3D )
-      {
-      mStatic0 = (Static3D)vector;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    if( region == null )
-      {
-      mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
-      }
-    else
-      {
-      if (region instanceof Static4D)
-        {
-        mStaticRegion = (Static4D) region;
-        }
-      else if (region instanceof Dynamic4D)
-        {
-        mDynamicRegion = (Dynamic4D) region;
-        }
-      }
+    mVector = vector;
+    mCenter = center;
+    mRegion = (region==null ? new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE) : region);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -89,67 +61,18 @@ public class VertexEffectDeform extends VertexEffect
   public VertexEffectDeform(Data3D vector, Data3D center)
     {
     super(EffectName.DEFORM);
-
-    if( vector instanceof Dynamic3D )
-      {
-      mDynamic0 = (Dynamic3D)vector;
-      }
-    else if ( vector instanceof Static3D )
-      {
-      mStatic0 = (Static3D)vector;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
+    mVector = vector;
+    mCenter = center;
+    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    boolean ret = false;
-
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+5,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+5] = mStaticCenter.getX();
-      uniforms[index+6] = mStaticCenter.getY();
-      uniforms[index+7] = mStaticCenter.getZ();
-      }
-
-    if( mDynamicRegion!=null )
-      {
-      mDynamicRegion.get(uniforms,index+8,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+ 8] = mStaticRegion.getX();
-      uniforms[index+ 9] = mStaticRegion.getY();
-      uniforms[index+10] = mStaticRegion.getZ();
-      uniforms[index+11] = mStaticRegion.getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      ret = mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static3D)mStatic0).getX();
-      uniforms[index+1] = ((Static3D)mStatic0).getY();
-      uniforms[index+2] = ((Static3D)mStatic0).getZ();
-      }
+    mCenter.get(uniforms,index+5,currentDuration,step);
+    mRegion.get(uniforms,index+8,currentDuration,step);
+    boolean ret = mVector.get(uniforms,index,currentDuration,step);
 
     uniforms[index+9] =-uniforms[index+9];
 
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectDistort.java b/src/main/java/org/distorted/library/effect/VertexEffectDistort.java
index 71ad0da..c5d10a4 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectDistort.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectDistort.java
@@ -30,6 +30,9 @@ import org.distorted.library.type.Static4D;
 
 public class VertexEffectDistort extends VertexEffect
   {
+  private Data3D mVector, mCenter;
+  private Data4D mRegion;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Distort a (possibly changing in time) part of the Object by a (possibly changing in time) vector of force.
@@ -42,40 +45,9 @@ public class VertexEffectDistort extends VertexEffect
   public VertexEffectDistort(Data3D vector, Data3D center, Data4D region)
     {
     super(EffectName.DISTORT);
-
-    if( vector instanceof Dynamic3D )
-      {
-      mDynamic0 = (Dynamic3D)vector;
-      }
-    else if ( vector instanceof Static3D )
-      {
-      mStatic0 = (Static3D)vector;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    if( region == null )
-      {
-      mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
-      }
-    else
-      {
-      if (region instanceof Static4D)
-        {
-        mStaticRegion = (Static4D) region;
-        }
-      else if (region instanceof Dynamic4D)
-        {
-        mDynamicRegion = (Dynamic4D) region;
-        }
-      }
+    mVector = vector;
+    mCenter = center;
+    mRegion = (region==null ? new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE) : region);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -89,67 +61,18 @@ public class VertexEffectDistort extends VertexEffect
   public VertexEffectDistort(Data3D vector, Data3D center)
     {
     super(EffectName.DISTORT);
-
-    if( vector instanceof Dynamic3D )
-      {
-      mDynamic0 = (Dynamic3D)vector;
-      }
-    else if ( vector instanceof Static3D )
-      {
-      mStatic0 = (Static3D)vector;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
+    mVector = vector;
+    mCenter = center;
+    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    boolean ret = false;
-
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+5,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+5] = mStaticCenter.getX();
-      uniforms[index+6] = mStaticCenter.getY();
-      uniforms[index+7] = mStaticCenter.getZ();
-      }
-
-    if( mDynamicRegion!=null )
-      {
-      mDynamicRegion.get(uniforms,index+8,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+ 8] = mStaticRegion.getX();
-      uniforms[index+ 9] = mStaticRegion.getY();
-      uniforms[index+10] = mStaticRegion.getZ();
-      uniforms[index+11] = mStaticRegion.getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      ret = mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static3D)mStatic0).getX();
-      uniforms[index+1] = ((Static3D)mStatic0).getY();
-      uniforms[index+2] = ((Static3D)mStatic0).getZ();
-      }
+    mCenter.get(uniforms,index+5,currentDuration,step);
+    mRegion.get(uniforms,index+8,currentDuration,step);
+    boolean ret = mVector.get(uniforms,index,currentDuration,step);
 
     uniforms[index+1] =-uniforms[index+1];
     uniforms[index+9] =-uniforms[index+9];
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectPinch.java b/src/main/java/org/distorted/library/effect/VertexEffectPinch.java
index 5ed1ecf..8335c36 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectPinch.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectPinch.java
@@ -33,6 +33,10 @@ import org.distorted.library.type.Static4D;
 
 public class VertexEffectPinch extends VertexEffect
   {
+  private Data2D mPinch;
+  private Data3D mCenter;
+  private Data4D mRegion;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Pull all points around the center of the Effect towards a line passing through the center
@@ -45,40 +49,9 @@ public class VertexEffectPinch extends VertexEffect
   public VertexEffectPinch(Data2D pinch, Data3D center, Data4D region)
     {
     super(EffectName.PINCH);
-
-    if( pinch instanceof Dynamic2D)
-      {
-      mDynamic0 = (Dynamic2D)pinch;
-      }
-    else if ( pinch instanceof Static2D )
-      {
-      mStatic0  = (Static2D)pinch;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D)
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    if( region == null )
-      {
-      mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
-      }
-    else
-      {
-      if (region instanceof Static4D)
-        {
-        mStaticRegion = (Static4D) region;
-        }
-      else if (region instanceof Dynamic4D)
-        {
-        mDynamicRegion = (Dynamic4D) region;
-        }
-      }
+    mPinch  = pinch;
+    mCenter = center;
+    mRegion = (region==null ? new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE) : region);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -92,66 +65,18 @@ public class VertexEffectPinch extends VertexEffect
   public VertexEffectPinch(Data2D pinch, Data3D center)
     {
     super(EffectName.PINCH);
-
-    if( pinch instanceof Dynamic2D)
-      {
-      mDynamic0 = (Dynamic2D)pinch;
-      }
-    else if ( pinch instanceof Static2D )
-      {
-      mStatic0  = (Static2D)pinch;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
+    mPinch  = pinch;
+    mCenter = center;
+    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    boolean ret= false;
-
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+5,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+5] = mStaticCenter.getX();
-      uniforms[index+6] = mStaticCenter.getY();
-      uniforms[index+7] = mStaticCenter.getZ();
-      }
-
-    if( mDynamicRegion!=null )
-      {
-      mDynamicRegion.get(uniforms,index+8,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+ 8] = mStaticRegion.getX();
-      uniforms[index+ 9] = mStaticRegion.getY();
-      uniforms[index+10] = mStaticRegion.getZ();
-      uniforms[index+11] = mStaticRegion.getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      ret = mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static2D)mStatic0).getX();
-      uniforms[index+1] = ((Static2D)mStatic0).getY();
-      }
+    mCenter.get(uniforms,index+5,currentDuration,step);
+    mRegion.get(uniforms,index+8,currentDuration,step);
+    boolean ret = mPinch.get(uniforms,index,currentDuration,step);
 
     uniforms[index+1] = (float)(Math.PI*uniforms[index+1]/180);
     uniforms[index+9] =-uniforms[index+9];
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectSink.java b/src/main/java/org/distorted/library/effect/VertexEffectSink.java
index 218a299..baf6aab 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectSink.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectSink.java
@@ -33,6 +33,10 @@ import org.distorted.library.type.Static4D;
 
 public class VertexEffectSink extends VertexEffect
   {
+  private Data1D mSink;
+  private Data3D mCenter;
+  private Data4D mRegion;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Pull all points around the center of the Effect towards the center (if degree>=1) or push them
@@ -45,40 +49,9 @@ public class VertexEffectSink extends VertexEffect
   public VertexEffectSink(Data1D sink, Data3D center, Data4D region)
     {
     super(EffectName.SINK);
-
-    if( sink instanceof Dynamic1D)
-      {
-      mDynamic0 = (Dynamic1D)sink;
-      }
-    else if ( sink instanceof Static1D )
-      {
-      mStatic0  = (Static1D)sink;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D)
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    if( region == null )
-      {
-      mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
-      }
-    else
-      {
-      if (region instanceof Static4D)
-        {
-        mStaticRegion = (Static4D) region;
-        }
-      else if (region instanceof Dynamic4D)
-        {
-        mDynamicRegion = (Dynamic4D) region;
-        }
-      }
+    mSink   = sink;
+    mCenter = center;
+    mRegion = (region==null ? new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE) : region);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -92,65 +65,18 @@ public class VertexEffectSink extends VertexEffect
   public VertexEffectSink(Data1D sink, Data3D center)
     {
     super(EffectName.SINK);
-
-    if( sink instanceof Dynamic1D)
-      {
-      mDynamic0 = (Dynamic1D)sink;
-      }
-    else if ( sink instanceof Static1D )
-      {
-      mStatic0  = (Static1D)sink;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
+    mSink   = sink;
+    mCenter = center;
+    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    boolean ret = false;
-
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+5,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+5] = mStaticCenter.getX();
-      uniforms[index+6] = mStaticCenter.getY();
-      uniforms[index+7] = mStaticCenter.getZ();
-      }
-
-    if( mDynamicRegion!=null )
-      {
-      mDynamicRegion.get(uniforms,index+8,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+ 8] = mStaticRegion.getX();
-      uniforms[index+ 9] = mStaticRegion.getY();
-      uniforms[index+10] = mStaticRegion.getZ();
-      uniforms[index+11] = mStaticRegion.getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      ret = mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static1D)mStatic0).getX();
-      }
+    mCenter.get(uniforms,index+5,currentDuration,step);
+    mRegion.get(uniforms,index+8,currentDuration,step);
+    boolean ret = mSink.get(uniforms,index,currentDuration,step);
 
     uniforms[index+9] =-uniforms[index+9];
 
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectSwirl.java b/src/main/java/org/distorted/library/effect/VertexEffectSwirl.java
index 4230739..2134c1a 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectSwirl.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectSwirl.java
@@ -33,6 +33,10 @@ import org.distorted.library.type.Static4D;
 
 public class VertexEffectSwirl extends VertexEffect
   {
+  private Data1D mSwirl;
+  private Data3D mCenter;
+  private Data4D mRegion;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Rotate part of the Object around the Center of the Effect by a certain angle.
@@ -44,40 +48,9 @@ public class VertexEffectSwirl extends VertexEffect
   public VertexEffectSwirl(Data1D swirl, Data3D center, Data4D region)
     {
     super(EffectName.SWIRL);
-
-    if( swirl instanceof Dynamic1D)
-      {
-      mDynamic0 = (Dynamic1D)swirl;
-      }
-    else if ( swirl instanceof Static1D )
-      {
-      mStatic0  = (Static1D)swirl;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D)
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    if( region == null )
-      {
-      mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
-      }
-    else
-      {
-      if (region instanceof Static4D)
-        {
-        mStaticRegion = (Static4D) region;
-        }
-      else if (region instanceof Dynamic4D)
-        {
-        mDynamicRegion = (Dynamic4D) region;
-        }
-      }
+    mSwirl  = swirl;
+    mCenter = center;
+    mRegion = (region==null ? new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE) : region);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -90,65 +63,18 @@ public class VertexEffectSwirl extends VertexEffect
   public VertexEffectSwirl(Data1D swirl, Data3D center)
     {
     super(EffectName.SWIRL);
-
-    if( swirl instanceof Dynamic1D)
-      {
-      mDynamic0 = (Dynamic1D)swirl;
-      }
-    else if ( swirl instanceof Static1D )
-      {
-      mStatic0  = (Static1D)swirl;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
+    mSwirl  = swirl;
+    mCenter = center;
+    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    boolean ret = false;
-
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+5,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+5] = mStaticCenter.getX();
-      uniforms[index+6] = mStaticCenter.getY();
-      uniforms[index+7] = mStaticCenter.getZ();
-      }
-
-    if( mDynamicRegion!=null )
-      {
-      mDynamicRegion.get(uniforms,index+8,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+ 8] = mStaticRegion.getX();
-      uniforms[index+ 9] = mStaticRegion.getY();
-      uniforms[index+10] = mStaticRegion.getZ();
-      uniforms[index+11] = mStaticRegion.getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      ret = mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static1D)mStatic0).getX();
-      }
+    mCenter.get(uniforms,index+5,currentDuration,step);
+    mRegion.get(uniforms,index+8,currentDuration,step);
+    boolean ret = mSwirl.get(uniforms,index,currentDuration,step);
 
     uniforms[index  ] = (float)(Math.PI*uniforms[index]/180);
     uniforms[index+9] =-uniforms[index+9];
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectWave.java b/src/main/java/org/distorted/library/effect/VertexEffectWave.java
index 3b23d0e..28c3b5e 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectWave.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectWave.java
@@ -33,6 +33,10 @@ import org.distorted.library.type.Static5D;
 
 public class VertexEffectWave extends VertexEffect
   {
+  private Data5D mWave;
+  private Data3D mCenter;
+  private Data4D mRegion;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Directional, sinusoidal wave effect.
@@ -60,30 +64,14 @@ public class VertexEffectWave extends VertexEffect
  *               is entirely 'horizontal' and moves point (x,y,0) in direction V by whatever is the
  *               value if sin at this point.
  * @param center 3-dimensional Data that, at any given time, returns the Center of the Effect.
+ * @param region Region that masks the Effect.
  */
-  public VertexEffectWave(Data5D wave, Data3D center)
+  public VertexEffectWave(Data5D wave, Data3D center, Data4D region)
     {
     super(EffectName.WAVE);
-
-    if( wave instanceof Dynamic5D)
-      {
-      mDynamic0 = (Dynamic5D)wave;
-      }
-    else if ( wave instanceof Static5D)
-      {
-      mStatic0  = (Static5D)wave;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D )
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
+    mWave   = wave;
+    mCenter = center;
+    mRegion = (region==null ? new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE) : region);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -92,88 +80,22 @@ public class VertexEffectWave extends VertexEffect
  *
  * @param wave   see {@link VertexEffectWave(Data5D,Data3D)}
  * @param center 3-dimensional Data that, at any given time, returns the Center of the Effect.
- * @param region Region that masks the Effect.
  */
-  public VertexEffectWave(Data5D wave, Data3D center, Data4D region)
+  public VertexEffectWave(Data5D wave, Data3D center)
     {
     super(EffectName.WAVE);
-
-    if( wave instanceof Dynamic5D)
-      {
-      mDynamic0 = (Dynamic5D)wave;
-      }
-    else if ( wave instanceof Static5D)
-      {
-      mStatic0  = (Static5D)wave;
-      }
-
-    if( center instanceof Static3D)
-      {
-      mStaticCenter = (Static3D)center;
-      }
-    else if( center instanceof Dynamic3D)
-      {
-      mDynamicCenter = (Dynamic3D)center;
-      }
-
-    if( region == null )
-      {
-      mStaticRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
-      }
-    else
-      {
-      if (region instanceof Static4D)
-        {
-        mStaticRegion = (Static4D) region;
-        }
-      else if (region instanceof Dynamic4D)
-        {
-        mDynamicRegion = (Dynamic4D) region;
-        }
-      }
+    mWave   = wave;
+    mCenter = center;
+    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
     {
-    boolean ret = false;
-
-    if( mDynamicCenter!=null )
-      {
-      mDynamicCenter.get(uniforms,index+5,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+5] = mStaticCenter.getX();
-      uniforms[index+6] = mStaticCenter.getY();
-      uniforms[index+7] = mStaticCenter.getZ();
-      }
-
-    if( mDynamicRegion!=null )
-      {
-      mDynamicRegion.get(uniforms,index+8,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index+ 8] = mStaticRegion.getX();
-      uniforms[index+ 9] = mStaticRegion.getY();
-      uniforms[index+10] = mStaticRegion.getZ();
-      uniforms[index+11] = mStaticRegion.getW();
-      }
-
-    if( mDynamic0!=null )
-      {
-      ret = mDynamic0.get(uniforms,index,currentDuration,step);
-      }
-    else
-      {
-      uniforms[index  ] = ((Static5D)mStatic0).getX();
-      uniforms[index+1] = ((Static5D)mStatic0).getY();
-      uniforms[index+2] = ((Static5D)mStatic0).getZ();
-      uniforms[index+3] = ((Static5D)mStatic0).getW();
-      uniforms[index+4] = ((Static5D)mStatic0).getV();
-      }
+    mCenter.get(uniforms,index+5,currentDuration,step);
+    mRegion.get(uniforms,index+8,currentDuration,step);
+    boolean ret = mWave.get(uniforms,index,currentDuration,step);
 
     uniforms[index+2] = (float)(Math.PI*uniforms[index+2]/180);
     uniforms[index+3] = (float)(Math.PI*uniforms[index+3]/180);
