commit 3002bef3d93c539d0fe78a9beef0674dac89c397
Author: Leszek Koltunski <leszek@distorted.org>
Date:   Wed Oct 19 01:27:37 2016 +0100

    Move most of the NOISE complications from DynamicND classes to the parent Dynamic class.

diff --git a/src/main/java/org/distorted/library/type/Dynamic.java b/src/main/java/org/distorted/library/type/Dynamic.java
index d6a03e3..ed16adb 100644
--- a/src/main/java/org/distorted/library/type/Dynamic.java
+++ b/src/main/java/org/distorted/library/type/Dynamic.java
@@ -20,6 +20,7 @@
 package org.distorted.library.type;
 
 import java.util.Random;
+import java.util.Vector;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /** A class to interpolate between a List of Static{1,2,3,4}Ds.
@@ -64,11 +65,13 @@ public abstract class Dynamic
    * We just jump back from the last point to the first.
    */
   public static final int MODE_JUMP = 2; 
- 
+
   protected static Random mRnd = new Random();
   
   protected static final int NUM_NOISE = 5; // used iff mNoise>0.0. Number of intermediary points between each pair of adjacent vectors
                                             // where we randomize noise factors to make the way between the two vectors not so smooth.
+
+  protected int mDimension;
   protected int numPoints;
   protected int mVecCurr;    
   protected boolean cacheDirty; // VectorCache not up to date
@@ -76,7 +79,30 @@ public abstract class Dynamic
   protected long mDuration;     // number of milliseconds it takes to do a full loop/path from first vector to the last and back to the first
   protected float mCount;       // number of loops/paths we will do; mCount = 1.5 means we go from the first vector to the last, back to first, and to the last again. 
   protected float mNoise;       // how 'smooth' our path form each vector to the next is. mNoise = 0.0 (min) --> completely smooth; mNoise==1.0 (max) --> very uneven
-  
+
+  protected class VectorNoise
+    {
+    float[][] n;
+
+    VectorNoise(int dim)
+      {
+      n = new float[dim][NUM_NOISE];
+
+      n[0][0] = mRnd.nextFloat();
+      for(int i=1; i<NUM_NOISE; i++) n[0][i] = n[0][i-1]+mRnd.nextFloat();
+      float sum = n[0][NUM_NOISE-1] + mRnd.nextFloat();
+      for(int i=0; i<NUM_NOISE; i++) n[0][i] /=sum;
+
+      for(int j=1; j<dim; j++)
+        {
+        for(int i=0; i<NUM_NOISE; i++) n[j][i] = mRnd.nextFloat()-0.5f;
+        }
+      }
+    }
+
+  protected Vector<VectorNoise> vn;
+  protected float[] mFactor;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // hide this from Javadoc
   
@@ -128,7 +154,46 @@ public abstract class Dynamic
     
     return false;
     }
- 
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  protected float noise(float time,int vecNum)
+    {
+    float lower, upper, len;
+    float d = time*(NUM_NOISE+1);
+    int index = (int)d;
+    if( index>=NUM_NOISE+1 ) index=NUM_NOISE;
+    VectorNoise tmpN = vn.elementAt(vecNum);
+
+    float t = d-index;
+    t = t*t*(3-2*t);
+
+    switch(index)
+      {
+      case 0        : for(int i=0;i<mDimension-1;i++) mFactor[i] = mNoise*tmpN.n[i+1][0]*t;
+                      return time + mNoise*(d*tmpN.n[0][0]-time);
+      case NUM_NOISE: for(int i=0;i<mDimension-1;i++) mFactor[i] = mNoise*tmpN.n[i+1][NUM_NOISE-1]*(1-t);
+                      len = ((float)NUM_NOISE)/(NUM_NOISE+1);
+                      lower = len + mNoise*(tmpN.n[0][NUM_NOISE-1]-len);
+                      return (1.0f-lower)*(d-NUM_NOISE) + lower;
+      default       : float ya,yb;
+
+                      for(int i=0;i<mDimension-1;i++)
+                        {
+                        yb = tmpN.n[i+1][index  ];
+                        ya = tmpN.n[i+1][index-1];
+                        mFactor[i] = mNoise*((yb-ya)*t+ya);
+                        }
+
+                      len = ((float)index)/(NUM_NOISE+1);
+                      lower = len + mNoise*(tmpN.n[0][index-1]-len);
+                      len = ((float)index+1)/(NUM_NOISE+1);
+                      upper = len + mNoise*(tmpN.n[0][index  ]-len);
+
+                      return (upper-lower)*(d-index) + lower;
+      }
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // internal debugging only!
   
@@ -136,11 +201,10 @@ public abstract class Dynamic
     {
     return "duration="+mDuration+" count="+mCount+" Noise="+mNoise+" numVectors="+numPoints+" mMode="+mMode;
     }
-  
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-  
+
   abstract void interpolate(float[] buffer, int offset, float time);
-  abstract void createNoise();
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
@@ -214,10 +278,18 @@ public abstract class Dynamic
  * @param noise The noise level. Permitted range: 0 <= noise <= 1.
  */
   
-  public void setNoise(float noise)
+  public synchronized void setNoise(float noise)
     {
-    if( mNoise==0.0f && noise != 0.0f )  
-      createNoise();
+    if( mNoise==0.0f && noise != 0.0f && vn==null )
+      {
+      vn = new Vector<>();
+      for(int i=0; i<numPoints; i++) vn.add(new VectorNoise(mDimension));
+
+      if( mDimension>=2 )
+        {
+        mFactor = new float[mDimension-1];
+        }
+      }
    
     if( mNoise<0.0f ) mNoise = 0.0f;
     if( mNoise>1.0f ) mNoise = 1.0f;
diff --git a/src/main/java/org/distorted/library/type/Dynamic1D.java b/src/main/java/org/distorted/library/type/Dynamic1D.java
index 74afe65..f736325 100644
--- a/src/main/java/org/distorted/library/type/Dynamic1D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic1D.java
@@ -43,41 +43,13 @@ public class Dynamic1D extends Dynamic implements Data1D
     float x;
     float vx;
     }
-  
-  private class VectorNoise
-    {
-    float[] nx;
-   
-    VectorNoise()
-      {
-      nx = new float[NUM_NOISE]; 
-      nx[0] = mRnd.nextFloat();
-      for(int i=1; i<NUM_NOISE; i++) nx[i] = nx[i-1]+mRnd.nextFloat();
-      float sum = nx[NUM_NOISE-1] + mRnd.nextFloat();
-      for(int i=0; i<NUM_NOISE; i++) nx[i] /=sum;
-      }
-    }
-  
+
   private Vector<VectorCache> vc;
   private VectorCache tmp1, tmp2;
  
   private Vector<Static1D> vv;
   private Static1D prev, curr, next;
- 
-  private Vector<VectorNoise> vn;
-  private VectorNoise tmpN;
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  synchronized void createNoise()
-    {
-    if( vn==null )
-      {
-      vn = new Vector<>();
-      for(int i=0; i<numPoints; i++) vn.add(new VectorNoise());
-      }
-    }
-  
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // no array bounds checking!
   
@@ -173,37 +145,7 @@ public class Dynamic1D extends Dynamic implements Data1D
    
     cacheDirty = false;
     }
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private float noise(float time,int vecNum)
-    {
-    float lower, upper, len;  
-    float d = time*(NUM_NOISE+1);
-    int index = (int)d;
-    if( index>=NUM_NOISE+1 ) index=NUM_NOISE;
-    tmpN = vn.elementAt(vecNum);
-   
-    if( index==0 )
-      {
-      len = 1.0f/(NUM_NOISE+1);  
-      return (len + mNoise*(tmpN.nx[0]-len))*d;
-      }
-    if( index==NUM_NOISE )
-      {
-      len = ((float)NUM_NOISE)/(NUM_NOISE+1);
-      lower = len + mNoise*(tmpN.nx[NUM_NOISE-1]-len);   
-      return (1.0f-lower)*(d-NUM_NOISE) + lower;   
-      }
-   
-    len = ((float)index)/(NUM_NOISE+1);
-    lower = len + mNoise*(tmpN.nx[index-1]-len);   
-    len = ((float)index+1)/(NUM_NOISE+1); 
-    upper = len + mNoise*(tmpN.nx[index  ]-len);
-            
-    return (upper-lower)*(d-index) + lower; 
-    }
-   
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -212,14 +154,7 @@ public class Dynamic1D extends Dynamic implements Data1D
  */
   public Dynamic1D()
     {
-    vv = new Vector<>();
-    vc = new Vector<>();
-    vn = null;
-    numPoints = 0;
-    cacheDirty = false;
-    mMode = MODE_LOOP;
-    mDuration = 0;
-    mCount = 0.5f;
+    this(0,0.5f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -242,6 +177,7 @@ public class Dynamic1D extends Dynamic implements Data1D
     mMode = MODE_LOOP;
     mDuration = duration;
     mCount = count;
+    mDimension = 1;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -295,7 +231,7 @@ public class Dynamic1D extends Dynamic implements Data1D
       {
       vv.add(v);
      
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(1));
        
       switch(numPoints)
         {
@@ -327,7 +263,7 @@ public class Dynamic1D extends Dynamic implements Data1D
       {
       vv.add(location, v);
       
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(1));
              
       switch(numPoints)
         {
diff --git a/src/main/java/org/distorted/library/type/Dynamic2D.java b/src/main/java/org/distorted/library/type/Dynamic2D.java
index 9015988..bf30a6b 100644
--- a/src/main/java/org/distorted/library/type/Dynamic2D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic2D.java
@@ -44,47 +44,13 @@ public class Dynamic2D extends Dynamic implements Data2D
     float x,y;
     float vx,vy;
     }
-  
-  private class VectorNoise
-    {    
-    float[] nx;
-    float[] ny;
-   
-    VectorNoise()
-      {
-      nx = new float[NUM_NOISE]; 
-      nx[0] = mRnd.nextFloat();
-      for(int i=1; i<NUM_NOISE; i++) nx[i] = nx[i-1]+mRnd.nextFloat();
-      float sum = nx[NUM_NOISE-1] + mRnd.nextFloat();
-      for(int i=0; i<NUM_NOISE; i++) nx[i] /=sum;
-     
-      ny = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) ny[i] = mRnd.nextFloat()-0.5f;
-      }
-    }
-    
+
   private Vector<VectorCache> vc;
   private VectorCache tmp1, tmp2;
    
   private Vector<Static2D> vv;
   private Static2D prev, curr, next;
- 
-  private Vector<VectorNoise> vn;
-  private VectorNoise tmpN;
-  
-  private float mFactor;
- 
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  synchronized void createNoise()
-    {
-    if( vn==null )
-      {
-      vn = new Vector<>();
-      for(int i=0; i<numPoints; i++) vn.add(new VectorNoise());
-      }
-    }
- 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // no array bounds checking!
   
@@ -196,41 +162,7 @@ public class Dynamic2D extends Dynamic implements Data2D
     
     cacheDirty = false;
     }
- 
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private float noise(float time,int vecNum)
-    {
-    float lower, upper, len;  
-    float d = time*(NUM_NOISE+1);
-    int index = (int)d;
-    if( index>=NUM_NOISE+1 ) index=NUM_NOISE;
-    tmpN = vn.elementAt(vecNum);
-   
-    float x = d-index;
-    x = x*x*(3-2*x);
-   
-    switch(index)
-      {
-      case 0        : mFactor = mNoise*tmpN.ny[0]*x;  
-                      return time + mNoise*(d*tmpN.nx[0]-time);                
-      case NUM_NOISE: mFactor= mNoise*tmpN.ny[NUM_NOISE-1]*(1-x);
-                      len = ((float)NUM_NOISE)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[NUM_NOISE-1]-len);  
-                      return (1.0f-lower)*(d-NUM_NOISE) + lower;
-      default       : float yb = tmpN.ny[index  ];
-                      float ya = tmpN.ny[index-1];
-                      mFactor  = mNoise*((yb-ya)*x+ya);
-   
-                      len = ((float)index)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[index-1]-len);   
-                      len = ((float)index+1)/(NUM_NOISE+1); 
-                      upper = len + mNoise*(tmpN.nx[index  ]-len);
-            
-                      return (upper-lower)*(d-index) + lower; 
-      }
-    }
-  
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -239,15 +171,7 @@ public class Dynamic2D extends Dynamic implements Data2D
  */
   public Dynamic2D()
     {
-    vv = new Vector<>();
-    vc = new Vector<>();
-    vn = null;
-    numPoints = 0;
-    cacheDirty = false;
-    mMode = MODE_LOOP;
-    mDuration = 0;
-    mCount = 0.5f;
-    mNoise = 0.0f;
+    this(0,0.5f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -270,6 +194,7 @@ public class Dynamic2D extends Dynamic implements Data2D
     mMode = MODE_LOOP;
     mDuration = duration;
     mCount = count;
+    mDimension = 2;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -323,7 +248,7 @@ public class Dynamic2D extends Dynamic implements Data2D
       {
       vv.add(v);
      
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(2));
        
       switch(numPoints)
         {
@@ -354,7 +279,7 @@ public class Dynamic2D extends Dynamic implements Data2D
       {
       vv.add(location, v);
       
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(2));
       
       switch(numPoints)
         {
@@ -495,8 +420,8 @@ public class Dynamic2D extends Dynamic implements Data2D
                 float dx2 = next.x-curr.x;
                 float dy2 = next.y-curr.y;
    
-                buffer[offset  ] = dx2*time + curr.x +dy2*mFactor;
-                buffer[offset+1] = dy2*time + curr.y -dx2*mFactor;
+                buffer[offset  ] = dx2*time + curr.x +dy2*mFactor[0];
+                buffer[offset+1] = dy2*time + curr.y -dx2*mFactor[0];
                 }
               else
                 {
@@ -554,8 +479,8 @@ public class Dynamic2D extends Dynamic implements Data2D
                   float dx2 = (3*tmp1.ax*time+2*tmp1.bx)*time + tmp1.cx;
                   float dy2 = (3*tmp1.ay*time+2*tmp1.by)*time + tmp1.cy;
                  
-                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx +dy2*mFactor;
-                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy -dx2*mFactor;
+                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx +dy2*mFactor[0];
+                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy -dx2*mFactor[0];
                   } 
                 else
                   {
diff --git a/src/main/java/org/distorted/library/type/Dynamic3D.java b/src/main/java/org/distorted/library/type/Dynamic3D.java
index 94f0dc4..82ab69b 100644
--- a/src/main/java/org/distorted/library/type/Dynamic3D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic3D.java
@@ -45,53 +45,16 @@ public class Dynamic3D extends Dynamic implements Data3D
     float x,y,z;
     float vx,vy,vz;
     }
-  
-  private class VectorNoise
-    {
-    float[] nx;
-    float[] ny;
-    float[] nz;
-   
-    VectorNoise()
-      {
-      nx = new float[NUM_NOISE]; 
-      nx[0] = mRnd.nextFloat();
-      for(int i=1; i<NUM_NOISE; i++) nx[i] = nx[i-1]+mRnd.nextFloat();
-      float sum = nx[NUM_NOISE-1] + mRnd.nextFloat();
-      for(int i=0; i<NUM_NOISE; i++) nx[i] /=sum;
-     
-      ny = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) ny[i] = mRnd.nextFloat()-0.5f;
-     
-      nz = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) nz[i] = mRnd.nextFloat()-0.5f;  
-      }
-    }
-  
+
   private Vector<VectorCache> vc;
   private VectorCache tmp1, tmp2;
 
   private Vector<Static3D> vv;
   private Static3D prev, curr, next;
-  
-  private Vector<VectorNoise> vn;
-  private VectorNoise tmpN;
-  
-  private float mFactor1, mFactor2;  // used in Noise only. Those are noise factors; 1=noise of the (vec1X,vec1Y,vec1Z) vector; 2=noise of (vec2X,vec2Y,vec2Z)
+
   private float vec1X,vec1Y,vec1Z;   // vector perpendicular to v(t) and in the same plane as v(t) and a(t) (for >2 points only, in case of 2 points this is calculated differently)
   private float vec2X,vec2Y,vec2Z;   // vector perpendicular to v(t0 and to vec1.
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  synchronized void createNoise()
-    {
-    if( vn==null )
-      {  
-      vn = new Vector<>();
-      for(int i=0; i<numPoints; i++) vn.add(new VectorNoise());
-      }
-    }
-   
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // no array bounds checking!
   
@@ -219,47 +182,7 @@ public class Dynamic3D extends Dynamic implements Data3D
    
     cacheDirty = false;
     }
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private float noise(float time,int vecNum)
-    {
-    float lower, upper, len;  
-    float d = time*(NUM_NOISE+1);
-    int index = (int)d;
-    if( index>=NUM_NOISE+1 ) index=NUM_NOISE;
-    tmpN = vn.elementAt(vecNum);
-   
-    float t = d-index;
-    t = t*t*(3-2*t);
-   
-    switch(index)
-      {
-      case 0        : mFactor1 = mNoise*tmpN.ny[0]*t;
-                      mFactor2 = mNoise*tmpN.nz[0]*t;
-                      return time + mNoise*(d*tmpN.nx[0]-time);
-      case NUM_NOISE: mFactor1= mNoise*tmpN.ny[NUM_NOISE-1]*(1-t);
-                      mFactor2= mNoise*tmpN.nz[NUM_NOISE-1]*(1-t);
-                      len = ((float)NUM_NOISE)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[NUM_NOISE-1]-len);  
-                      return (1.0f-lower)*(d-NUM_NOISE) + lower;
-      default       : float ya,yb;
-                      yb = tmpN.ny[index  ];
-                      ya = tmpN.ny[index-1];
-                      mFactor1 = mNoise*((yb-ya)*t+ya);
-                      yb = tmpN.nz[index  ];
-                      ya = tmpN.nz[index-1];
-                      mFactor2 = mNoise*((yb-ya)*t+ya);
-   
-                      len = ((float)index)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[index-1]-len);   
-                      len = ((float)index+1)/(NUM_NOISE+1); 
-                      upper = len + mNoise*(tmpN.nx[index  ]-len);
-            
-                      return (upper-lower)*(d-index) + lower; 
-      }
-    }
-     
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // v is the speed vector (i.e. position p(t) differentiated by time)
 // a is the acceleration vector (differentiate once more)
@@ -350,15 +273,7 @@ public class Dynamic3D extends Dynamic implements Data3D
  */
   public Dynamic3D()
     {
-    vv = new Vector<>();
-    vc = new Vector<>();
-    vn = null;
-    numPoints = 0;
-    cacheDirty = false;
-    mMode = MODE_LOOP;
-    mDuration = 0;
-    mCount = 0.5f;
-    mNoise = 0.0f;
+    this(0,0.5f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -381,6 +296,7 @@ public class Dynamic3D extends Dynamic implements Data3D
     mMode = MODE_LOOP;
     mDuration = duration;
     mCount = count;
+    mDimension = 3;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -434,7 +350,7 @@ public class Dynamic3D extends Dynamic implements Data3D
       {
       vv.add(v);
         
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(3));
        
       switch(numPoints)
         {
@@ -466,7 +382,7 @@ public class Dynamic3D extends Dynamic implements Data3D
       {
       vv.add(location, v);
       
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(3));
       
       switch(numPoints)
         {
@@ -609,9 +525,9 @@ public class Dynamic3D extends Dynamic implements Data3D
                 {
                 time = noise(time,0);
             
-                buffer[offset  ] = (next.x-curr.x)*time + curr.x + (vec1X*mFactor1 + vec2X*mFactor2);
-                buffer[offset+1] = (next.y-curr.y)*time + curr.y + (vec1Y*mFactor1 + vec2Y*mFactor2);
-                buffer[offset+2] = (next.z-curr.z)*time + curr.z + (vec1Z*mFactor1 + vec2Z*mFactor2); 
+                buffer[offset  ] = (next.x-curr.x)*time + curr.x + (vec1X*mFactor[0] + vec2X*mFactor[1]);
+                buffer[offset+1] = (next.y-curr.y)*time + curr.y + (vec1Y*mFactor[0] + vec2Y*mFactor[1]);
+                buffer[offset+2] = (next.z-curr.z)*time + curr.z + (vec1Z*mFactor[0] + vec2Z*mFactor[1]);
                 }
               else
                 {
@@ -670,9 +586,9 @@ public class Dynamic3D extends Dynamic implements Data3D
               
                   setUpVectors(time,tmp1);
                  
-                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx + (vec1X*mFactor1 + vec2X*mFactor2);
-                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy + (vec1Y*mFactor1 + vec2Y*mFactor2);
-                  buffer[offset+2]= ((tmp1.az*time+tmp1.bz)*time+tmp1.cz)*time+tmp1.dz + (vec1Z*mFactor1 + vec2Z*mFactor2);
+                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx + (vec1X*mFactor[0] + vec2X*mFactor[1]);
+                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy + (vec1Y*mFactor[0] + vec2Y*mFactor[1]);
+                  buffer[offset+2]= ((tmp1.az*time+tmp1.bz)*time+tmp1.cz)*time+tmp1.dz + (vec1Z*mFactor[0] + vec2Z*mFactor[1]);
                   }
                 else
                   {
diff --git a/src/main/java/org/distorted/library/type/Dynamic4D.java b/src/main/java/org/distorted/library/type/Dynamic4D.java
index 68e2d1f..50b73cf 100644
--- a/src/main/java/org/distorted/library/type/Dynamic4D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic4D.java
@@ -46,58 +46,17 @@ public class Dynamic4D extends Dynamic implements Data4D
     float x,y,z,w;
     float vx,vy,vz,vw;
     }
-  
-  private class VectorNoise
-    {
-    float[] nx;
-    float[] ny;
-    float[] nz;
-    float[] nw;
-   
-    VectorNoise()
-      {
-      nx = new float[NUM_NOISE]; 
-      nx[0] = mRnd.nextFloat();
-      for(int i=1; i<NUM_NOISE; i++) nx[i] = nx[i-1] + mRnd.nextFloat();
-      float sum = nx[NUM_NOISE-1] + mRnd.nextFloat();
-      for(int i=0; i<NUM_NOISE; i++) nx[i] /=sum;
-     
-      ny = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) ny[i] = mRnd.nextFloat()-0.5f;
-     
-      nz = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) nz[i] = mRnd.nextFloat()-0.5f;
-     
-      nw = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) nw[i] = mRnd.nextFloat()-0.5f;  
-      }
-    }
-  
+
   private Vector<VectorCache> vc;
   private VectorCache tmp1, tmp2;
 
   private Vector<Static4D> vv;
   private Static4D prev, curr, next;
-  
-  private Vector<VectorNoise> vn;
-  private VectorNoise tmpN;
-  
-  private float mFactor1, mFactor2, mFactor3; // used in Noise only. FactorN = noise factor of vecN.
+
   private float vec1X,vec1Y,vec1Z,vec1W;      // vector perpendicular to v(t) and in the same plane as v(t) and a(t) (for >2 points only, in case of 2 points this is calculated differently)
   private float vec2X,vec2Y,vec2Z,vec2W;      // vector perpendicular to v(t) and to vec1.
   private float vec3X,vec3Y,vec3Z,vec3W;      // vector perpendicular to v(t) and to vec1.
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  synchronized void createNoise()
-    {
-    if( vn==null )
-      {  
-      vn = new Vector<>();
-      for(int i=0; i<numPoints; i++) vn.add(new VectorNoise());
-      }
-    }
-   
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // no array bounds checking!
   
@@ -241,52 +200,7 @@ public class Dynamic4D extends Dynamic implements Data4D
    
     cacheDirty = false;
     }
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private float noise(float time,int vecNum)
-    {
-    float lower, upper, len;  
-    float d = time*(NUM_NOISE+1);
-    int index = (int)d;
-    if( index>=NUM_NOISE+1 ) index=NUM_NOISE;
-    tmpN = vn.elementAt(vecNum);
-   
-    float t = d-index;
-    t = t*t*(3-2*t);
-   
-    switch(index)
-      {
-      case 0        : mFactor1 = mNoise*tmpN.ny[0]*t;
-                      mFactor2 = mNoise*tmpN.nz[0]*t;
-                      mFactor3 = mNoise*tmpN.nw[0]*t;
-                      return time + mNoise*(d*tmpN.nx[0]-time);
-      case NUM_NOISE: mFactor1= mNoise*tmpN.ny[NUM_NOISE-1]*(1-t);
-                      mFactor2= mNoise*tmpN.nz[NUM_NOISE-1]*(1-t);
-                      mFactor3= mNoise*tmpN.nw[NUM_NOISE-1]*(1-t);
-                      len = ((float)NUM_NOISE)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[NUM_NOISE-1]-len);  
-                      return (1.0f-lower)*(d-NUM_NOISE) + lower;
-      default       : float ya,yb;
-                      yb = tmpN.ny[index  ];
-                      ya = tmpN.ny[index-1];
-                      mFactor1 = mNoise*((yb-ya)*t+ya);
-                      yb = tmpN.nz[index  ];
-                      ya = tmpN.nz[index-1];
-                      mFactor2 = mNoise*((yb-ya)*t+ya);
-                      yb = tmpN.nw[index  ];
-                      ya = tmpN.nw[index-1];
-                      mFactor3 = mNoise*((yb-ya)*t+ya);
-   
-                      len = ((float)index)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[index-1]-len);   
-                      len = ((float)index+1)/(NUM_NOISE+1); 
-                      upper = len + mNoise*(tmpN.nx[index  ]-len);
-            
-                      return (upper-lower)*(d-index) + lower; 
-      }
-    }
-     
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // v is the speed vector (i.e. position p(t) differentiated by time)
 // a is the acceleration vector (differentiate once more)
@@ -446,15 +360,7 @@ public class Dynamic4D extends Dynamic implements Data4D
  */
   public Dynamic4D()
     {
-    vv = new Vector<>();
-    vc = new Vector<>();
-    vn = null;
-    numPoints = 0;
-    cacheDirty = false;
-    mMode = MODE_LOOP;
-    mDuration = 0;
-    mCount = 0.5f;
-    mNoise = 0.0f;
+    this(0,0.5f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -477,6 +383,7 @@ public class Dynamic4D extends Dynamic implements Data4D
     mMode = MODE_LOOP;
     mDuration = duration;
     mCount = count;
+    mDimension = 4;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -530,7 +437,7 @@ public class Dynamic4D extends Dynamic implements Data4D
       {
       vv.add(v);
         
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(4));
        
        switch(numPoints)
          {
@@ -562,7 +469,7 @@ public class Dynamic4D extends Dynamic implements Data4D
       {
       vv.add(location, v);
       
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(4));
       
       switch(numPoints)
         {
@@ -707,10 +614,10 @@ public class Dynamic4D extends Dynamic implements Data4D
                 {
                 time = noise(time,0);
             
-                buffer[offset  ] = (next.x-curr.x)*time + curr.x + (vec1X*mFactor1 + vec2X*mFactor2 + vec3X*mFactor3);
-                buffer[offset+1] = (next.y-curr.y)*time + curr.y + (vec1Y*mFactor1 + vec2Y*mFactor2 + vec3Y*mFactor3);
-                buffer[offset+2] = (next.z-curr.z)*time + curr.z + (vec1Z*mFactor1 + vec2Z*mFactor2 + vec3Z*mFactor3);
-                buffer[offset+3] = (next.w-curr.w)*time + curr.w + (vec1W*mFactor1 + vec2W*mFactor2 + vec3W*mFactor3); 
+                buffer[offset  ] = (next.x-curr.x)*time + curr.x + (vec1X*mFactor[0] + vec2X*mFactor[1] + vec3X*mFactor[2]);
+                buffer[offset+1] = (next.y-curr.y)*time + curr.y + (vec1Y*mFactor[0] + vec2Y*mFactor[1] + vec3Y*mFactor[2]);
+                buffer[offset+2] = (next.z-curr.z)*time + curr.z + (vec1Z*mFactor[0] + vec2Z*mFactor[1] + vec3Z*mFactor[2]);
+                buffer[offset+3] = (next.w-curr.w)*time + curr.w + (vec1W*mFactor[0] + vec2W*mFactor[1] + vec3W*mFactor[2]);
                 }
               else
                 {
@@ -770,10 +677,10 @@ public class Dynamic4D extends Dynamic implements Data4D
               
                   setUpVectors(time,tmp1);
                  
-                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx + (vec1X*mFactor1 + vec2X*mFactor2 + vec3X*mFactor3);
-                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy + (vec1Y*mFactor1 + vec2Y*mFactor2 + vec3Y*mFactor3);
-                  buffer[offset+2]= ((tmp1.az*time+tmp1.bz)*time+tmp1.cz)*time+tmp1.dz + (vec1Z*mFactor1 + vec2Z*mFactor2 + vec3Z*mFactor3);
-                  buffer[offset+3]= ((tmp1.aw*time+tmp1.bw)*time+tmp1.cw)*time+tmp1.dw + (vec1W*mFactor1 + vec2W*mFactor2 + vec3W*mFactor3);
+                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx + (vec1X*mFactor[0] + vec2X*mFactor[1] + vec3X*mFactor[2]);
+                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy + (vec1Y*mFactor[0] + vec2Y*mFactor[1] + vec3Y*mFactor[2]);
+                  buffer[offset+2]= ((tmp1.az*time+tmp1.bz)*time+tmp1.cz)*time+tmp1.dz + (vec1Z*mFactor[0] + vec2Z*mFactor[1] + vec3Z*mFactor[2]);
+                  buffer[offset+3]= ((tmp1.aw*time+tmp1.bw)*time+tmp1.cw)*time+tmp1.dw + (vec1W*mFactor[0] + vec2W*mFactor[1] + vec3W*mFactor[2]);
                   }
                 else
                   {
diff --git a/src/main/java/org/distorted/library/type/Dynamic5D.java b/src/main/java/org/distorted/library/type/Dynamic5D.java
index bb76a8e..c47216b 100644
--- a/src/main/java/org/distorted/library/type/Dynamic5D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic5D.java
@@ -47,63 +47,18 @@ public class Dynamic5D extends Dynamic implements Data5D
     float x,y,z,w,v;
     float vx,vy,vz,vw,vv;
     }
-  
-  private class VectorNoise
-    {
-    float[] nx;
-    float[] ny;
-    float[] nz;
-    float[] nw;
-    float[] nv;
-   
-    VectorNoise()
-      {
-      nx = new float[NUM_NOISE]; 
-      nx[0] = mRnd.nextFloat();
-      for(int i=1; i<NUM_NOISE; i++) nx[i] = nx[i-1] + mRnd.nextFloat();
-      float sum = nx[NUM_NOISE-1] + mRnd.nextFloat();
-      for(int i=0; i<NUM_NOISE; i++) nx[i] /=sum;
-     
-      ny = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) ny[i] = mRnd.nextFloat()-0.5f;
-     
-      nz = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) nz[i] = mRnd.nextFloat()-0.5f;
-     
-      nw = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) nw[i] = mRnd.nextFloat()-0.5f;  
 
-      nv = new float[NUM_NOISE];
-      for(int i=0; i<NUM_NOISE; i++) nv[i] = mRnd.nextFloat()-0.5f;  
-      }
-    }
-  
   private Vector<VectorCache> vc;
   private VectorCache tmp1, tmp2;
 
   private Vector<Static5D> vv;
   private Static5D prev, curr, next;
-  
-  private Vector<VectorNoise> vn;
-  private VectorNoise tmpN;
-  
-  private float mFactor1, mFactor2, mFactor3, mFactor4;  // used in Noise only. FactorN = noise factor of vector vecN.
+
   private float vec1X,vec1Y,vec1Z,vec1W,vec1V; //
-  private float vec2X,vec2Y,vec2Z,vec2W,vec2V; // 4 noise vectors.
+  private float vec2X,vec2Y,vec2Z,vec2W,vec2V; // 4 base noise vectors.
   private float vec3X,vec3Y,vec3Z,vec3W,vec3V; // 
   private float vec4X,vec4Y,vec4Z,vec4W,vec4V; // 
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  synchronized void createNoise()
-    {
-    if( vn==null )
-      {  
-      vn = new Vector<>();
-      for(int i=0; i<numPoints; i++) vn.add(new VectorNoise());
-      }
-    }
-   
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // no array bounds checking!
   
@@ -263,57 +218,7 @@ public class Dynamic5D extends Dynamic implements Data5D
    
     cacheDirty = false;
     }
-  
-///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private float noise(float time,int vecNum)
-    {
-    float lower, upper, len;  
-    float d = time*(NUM_NOISE+1);
-    int index = (int)d;
-    if( index>=NUM_NOISE+1 ) index=NUM_NOISE;
-    tmpN = vn.elementAt(vecNum);
-   
-    float t = d-index;
-    t = t*t*(3-2*t);
-   
-    switch(index)
-      {
-      case 0        : mFactor1 = mNoise*tmpN.ny[0]*t;
-                      mFactor2 = mNoise*tmpN.nz[0]*t;
-                      mFactor3 = mNoise*tmpN.nw[0]*t;
-                      mFactor4 = mNoise*tmpN.nv[0]*t;
-                      return time + mNoise*(d*tmpN.nx[0]-time);
-      case NUM_NOISE: mFactor1= mNoise*tmpN.ny[NUM_NOISE-1]*(1-t);
-                      mFactor2= mNoise*tmpN.nz[NUM_NOISE-1]*(1-t);
-                      mFactor3= mNoise*tmpN.nw[NUM_NOISE-1]*(1-t);
-                      mFactor4= mNoise*tmpN.nv[NUM_NOISE-1]*(1-t);
-                      len = ((float)NUM_NOISE)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[NUM_NOISE-1]-len);  
-                      return (1.0f-lower)*(d-NUM_NOISE) + lower;
-      default       : float ya,yb;
-                      yb = tmpN.ny[index  ];
-                      ya = tmpN.ny[index-1];
-                      mFactor1 = mNoise*((yb-ya)*t+ya);
-                      yb = tmpN.nz[index  ];
-                      ya = tmpN.nz[index-1];
-                      mFactor2 = mNoise*((yb-ya)*t+ya);
-                      yb = tmpN.nw[index  ];
-                      ya = tmpN.nw[index-1];
-                      mFactor3 = mNoise*((yb-ya)*t+ya);
-                      yb = tmpN.nv[index  ];
-                      ya = tmpN.nv[index-1];
-                      mFactor4 = mNoise*((yb-ya)*t+ya);
-   
-                      len = ((float)index)/(NUM_NOISE+1);
-                      lower = len + mNoise*(tmpN.nx[index-1]-len);   
-                      len = ((float)index+1)/(NUM_NOISE+1); 
-                      upper = len + mNoise*(tmpN.nx[index  ]-len);
-            
-                      return (upper-lower)*(d-index) + lower; 
-      }
-    }
-     
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // v is the speed vector (i.e. position p(t) differentiated by time)
 // a is the acceleration vector (differentiate once more)
@@ -450,7 +355,7 @@ public class Dynamic5D extends Dynamic implements Data5D
         vec2Z = 1.0f - coeff21*vz - coeff22*vec1Z;
         vec2W = 0.0f - coeff21*vw - coeff22*vec1W;
         vec2V = 0.0f - coeff21*vv - coeff22*vec1V;
-     
+
         float vec2_sq = vec2X*vec2X+vec2Y*vec2Y+vec2Z*vec2Z+vec2W*vec2W+vec2V*vec2V;
         float coeff31 = vw/v_sq;
         float coeff32 = vec1W/vec1_sq;
@@ -478,7 +383,7 @@ public class Dynamic5D extends Dynamic implements Data5D
         float len2 = (float)Math.sqrt(v_sq/vec2_sq);    
         float len3 = (float)Math.sqrt(v_sq/vec3_sq);
         float len4 = (float)Math.sqrt(v_sq/vec4_sq);
-     
+
         vec1X*=len1;
         vec1Y*=len1;
         vec1Z*=len1;
@@ -540,15 +445,7 @@ public class Dynamic5D extends Dynamic implements Data5D
  */
   public Dynamic5D()
     {
-    vv = new Vector<>();
-    vc = new Vector<>();
-    vn = null;
-    numPoints = 0;
-    cacheDirty = false;
-    mMode = MODE_LOOP;
-    mDuration = 0;
-    mCount = 0.5f;
-    mNoise = 0.0f;
+    this(0,0.5f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -571,6 +468,7 @@ public class Dynamic5D extends Dynamic implements Data5D
     mMode = MODE_LOOP;
     mDuration = duration;
     mCount = count;
+    mDimension = 5;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -624,23 +522,23 @@ public class Dynamic5D extends Dynamic implements Data5D
       {
       vv.add(v);
         
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(5));
        
-       switch(numPoints)
-         {
-         case 0: break;
-         case 1: setUpVectors(0.0f,null);
-                 break;
-         case 2: vc.add(new VectorCache());
-                 vc.add(new VectorCache());
-                 vc.add(new VectorCache());
-                 break;
-         default:vc.add(new VectorCache());
-         }
+      switch(numPoints)
+        {
+        case 0: break;
+        case 1: setUpVectors(0.0f,null);
+                break;
+        case 2: vc.add(new VectorCache());
+                vc.add(new VectorCache());
+                vc.add(new VectorCache());
+                break;
+        default:vc.add(new VectorCache());
+        }
 
-       numPoints++;
-       cacheDirty = true;
-       }
+      numPoints++;
+      cacheDirty = true;
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -656,7 +554,7 @@ public class Dynamic5D extends Dynamic implements Data5D
       {
       vv.add(location, v);
       
-      if( vn!=null ) vn.add(new VectorNoise());
+      if( vn!=null ) vn.add(new VectorNoise(5));
       
       switch(numPoints)
         {
@@ -803,11 +701,11 @@ public class Dynamic5D extends Dynamic implements Data5D
                 {
                 time = noise(time,0);
             
-                buffer[offset  ] = (next.x-curr.x)*time + curr.x + (vec1X*mFactor1 + vec2X*mFactor2 + vec3X*mFactor3 + vec4X*mFactor4);
-                buffer[offset+1] = (next.y-curr.y)*time + curr.y + (vec1Y*mFactor1 + vec2Y*mFactor2 + vec3Y*mFactor3 + vec4Y*mFactor4);
-                buffer[offset+2] = (next.z-curr.z)*time + curr.z + (vec1Z*mFactor1 + vec2Z*mFactor2 + vec3Z*mFactor3 + vec4Z*mFactor4);
-                buffer[offset+3] = (next.w-curr.w)*time + curr.w + (vec1W*mFactor1 + vec2W*mFactor2 + vec3W*mFactor3 + vec4W*mFactor4); 
-                buffer[offset+4] = (next.v-curr.v)*time + curr.v + (vec1V*mFactor1 + vec2V*mFactor2 + vec3V*mFactor3 + vec4V*mFactor4); 
+                buffer[offset  ] = (next.x-curr.x)*time + curr.x + (vec1X*mFactor[0] + vec2X*mFactor[1] + vec3X*mFactor[2] + vec4X*mFactor[3]);
+                buffer[offset+1] = (next.y-curr.y)*time + curr.y + (vec1Y*mFactor[0] + vec2Y*mFactor[1] + vec3Y*mFactor[2] + vec4Y*mFactor[3]);
+                buffer[offset+2] = (next.z-curr.z)*time + curr.z + (vec1Z*mFactor[0] + vec2Z*mFactor[1] + vec3Z*mFactor[2] + vec4Z*mFactor[3]);
+                buffer[offset+3] = (next.w-curr.w)*time + curr.w + (vec1W*mFactor[0] + vec2W*mFactor[1] + vec3W*mFactor[2] + vec4W*mFactor[3]);
+                buffer[offset+4] = (next.v-curr.v)*time + curr.v + (vec1V*mFactor[0] + vec2V*mFactor[1] + vec3V*mFactor[2] + vec4V*mFactor[3]);
                 }
               else
                 {
@@ -868,11 +766,11 @@ public class Dynamic5D extends Dynamic implements Data5D
               
                   setUpVectors(time,tmp1);
                  
-                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx + (vec1X*mFactor1 + vec2X*mFactor2 + vec3X*mFactor3 + vec4X*mFactor4);
-                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy + (vec1Y*mFactor1 + vec2Y*mFactor2 + vec3Y*mFactor3 + vec4Y*mFactor4);
-                  buffer[offset+2]= ((tmp1.az*time+tmp1.bz)*time+tmp1.cz)*time+tmp1.dz + (vec1Z*mFactor1 + vec2Z*mFactor2 + vec3Z*mFactor3 + vec4Z*mFactor4);
-                  buffer[offset+3]= ((tmp1.aw*time+tmp1.bw)*time+tmp1.cw)*time+tmp1.dw + (vec1W*mFactor1 + vec2W*mFactor2 + vec3W*mFactor3 + vec4W*mFactor4);
-                  buffer[offset+4]= ((tmp1.av*time+tmp1.bv)*time+tmp1.cv)*time+tmp1.dv + (vec1V*mFactor1 + vec2V*mFactor2 + vec3V*mFactor3 + vec4V*mFactor4);
+                  buffer[offset  ]= ((tmp1.ax*time+tmp1.bx)*time+tmp1.cx)*time+tmp1.dx + (vec1X*mFactor[0] + vec2X*mFactor[1] + vec3X*mFactor[2] + vec4X*mFactor[3]);
+                  buffer[offset+1]= ((tmp1.ay*time+tmp1.by)*time+tmp1.cy)*time+tmp1.dy + (vec1Y*mFactor[0] + vec2Y*mFactor[1] + vec3Y*mFactor[2] + vec4Y*mFactor[3]);
+                  buffer[offset+2]= ((tmp1.az*time+tmp1.bz)*time+tmp1.cz)*time+tmp1.dz + (vec1Z*mFactor[0] + vec2Z*mFactor[1] + vec3Z*mFactor[2] + vec4Z*mFactor[3]);
+                  buffer[offset+3]= ((tmp1.aw*time+tmp1.bw)*time+tmp1.cw)*time+tmp1.dw + (vec1W*mFactor[0] + vec2W*mFactor[1] + vec3W*mFactor[2] + vec4W*mFactor[3]);
+                  buffer[offset+4]= ((tmp1.av*time+tmp1.bv)*time+tmp1.cv)*time+tmp1.dv + (vec1V*mFactor[0] + vec2V*mFactor[1] + vec3V*mFactor[2] + vec4V*mFactor[3]);
                   }
                 else
                   {
diff --git a/src/main/java/org/distorted/library/type/DynamicQuat.java b/src/main/java/org/distorted/library/type/DynamicQuat.java
index 5ec59ba..c974bcf 100644
--- a/src/main/java/org/distorted/library/type/DynamicQuat.java
+++ b/src/main/java/org/distorted/library/type/DynamicQuat.java
@@ -61,14 +61,6 @@ public class DynamicQuat extends Dynamic implements Data4D
     return (float)Math.sqrt(1-x)*(1.5707288f - 0.2121144f*x + 0.074261f*x*x - 0.0187293f*x*x*x);
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Quaternion Dynamic doesn't support noise
-  
-  synchronized void createNoise()
-    {
-
-    }
-  
 ///////////////////////////////////////////////////////////////////////////////////////////////////
   
   private void recomputeCache()
@@ -118,14 +110,7 @@ public class DynamicQuat extends Dynamic implements Data4D
  */
   public DynamicQuat()
     {
-    vv = new Vector<>();
-    vc = new Vector<>();
-    numPoints = 0;
-    cacheDirty = false;
-    mMode = MODE_LOOP;
-    mDuration = 0;
-    mCount = 0.5f;
-    mNoise = 0.0f;
+    this(0,0.5f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -148,6 +133,7 @@ public class DynamicQuat extends Dynamic implements Data4D
     mDuration = duration;
     mCount = count;
     mNoise = 0.0f;
+    mDimension = 4;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
