commit c45c2ab1210c7e8d142fa336269364be711e4f85
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue May 14 12:11:26 2019 +0100

    Minor improvements in the Dynamics.

diff --git a/src/main/java/org/distorted/library/type/Dynamic.java b/src/main/java/org/distorted/library/type/Dynamic.java
index 0caf5d1..54cff02 100644
--- a/src/main/java/org/distorted/library/type/Dynamic.java
+++ b/src/main/java/org/distorted/library/type/Dynamic.java
@@ -25,9 +25,9 @@ import java.util.Vector;
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /** A class to interpolate between a list of Statics.
 * <p><ul>
-* <li>if there is only one Point, just jump to it.
+* <li>if there is only one Point, just return it.
 * <li>if there are two Points, linearly bounce between them
-* <li>if there are more, interpolate a loop (or a path!) between them.
+* <li>if there are more, interpolate a path between them. Exact way we interpolate depends on the MODE.
 * </ul>
 */
 
@@ -54,15 +54,15 @@ import java.util.Vector;
 public abstract class Dynamic
   {
   /**
-   * One revolution takes us from the first vector to the last and back to first through the shortest path. 
+   * One revolution takes us from the first point to the last and back to first through the shortest path.
    */
   public static final int MODE_LOOP = 0; 
   /**
-   * We come back from the last to the first vector through the same way we got there.
+   * One revolution takes us from the first point to the last and back to first through the same path.
    */
   public static final int MODE_PATH = 1; 
   /**
-   * We just jump back from the last point to the first.
+   * One revolution takes us from the first point to the last and jumps straight back to the first point.
    */
   public static final int MODE_JUMP = 2; 
 
@@ -72,14 +72,14 @@ public abstract class Dynamic
    * On the other hand, when in this mode, it is not possible to smoothly interpolate when mDuration suddenly
    * changes.
    */
-  public static final int ACCESS_RANDOM     = 0;
+  public static final int ACCESS_TYPE_RANDOM     = 0;
   /**
    * Set the mode to ACCESS_SEQUENTIAL if you need to change mDuration and you would rather have the Dynamic
    * keep on smoothly interpolating.
    * On the other hand, in this mode, a Dynamic can only be accessed in sequential manner, which means one
    * Dynamic can only be used in one effect at a time.
    */
-  public static final int ACCESS_SEQUENTIAL = 1;
+  public static final int ACCESS_TYPE_SEQUENTIAL = 1;
 
   protected int mDimension;
   protected int numPoints;
@@ -89,7 +89,7 @@ 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 double mLastPos;
-  protected int mAccessMode;
+  protected int mAccessType;
 
   protected class VectorNoise
     {
@@ -179,7 +179,7 @@ public abstract class Dynamic
     mDimension = dimension;
     mSegment   = -1;
     mLastPos   = -1;
-    mAccessMode= ACCESS_RANDOM;
+    mAccessType = ACCESS_TYPE_RANDOM;
 
     mTimeOffset = 0;
     mSetOffset  = true;
@@ -505,7 +505,7 @@ public abstract class Dynamic
  * <li>Loop is when we go from the first point all the way to the last, and the back to the first through 
  * the shortest way.
  * <li>Path is when we come back from the last point back to the first the same way we got there.
- * <li>Jump is when we go from first to last and then jump back to the first.
+ * <li>Jump is when we go from first to last and then jump straight back to the first.
  * </ul>
  * 
  * @param mode {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
@@ -517,9 +517,9 @@ public abstract class Dynamic
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Returns the number of Statics this Dynamic has been fed with.
+ * Returns the number of Points this Dynamic has been fed with.
  *   
- * @return the number of Statics we are currently interpolating through.
+ * @return the number of Points we are currently interpolating through.
  */
   public synchronized int getNumPoints()
     {
@@ -528,14 +528,13 @@ public abstract class Dynamic
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Controls how many times we want to interpolate.
+ * Sets how many revolutions we want to do.
  * <p>
- * Count equal to 1 means 'go from the first Static to the last and back'. Does not have to be an
- * integer - i.e. count=1.5 would mean 'start at the first Point, go to the last, come back to the first, 
- * go to the last again and stop'.
+ * Does not have to be an integer. What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  * Count<=0 means 'go on interpolating indefinitely'.
  * 
- * @param count the number of times we want to interpolate between our collection of Statics.
+ * @param count the number of times we want to interpolate between our collection of Points.
  */
   public void setCount(float count)
     {
@@ -544,9 +543,11 @@ public abstract class Dynamic
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Return the number of times this Dynamic will interpolate.
+ * Return the number of revolutions this Dynamic will make.
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  *
- * @return the number of times this Dynamic will interpolate.
+ * @return the number revolutions this Dynamic will make.
  */
   public float getCount()
     {
@@ -556,6 +557,9 @@ public abstract class Dynamic
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Start running from the beginning again.
+ *
+ * If a Dynamic has been used already, and we want to use it again and start interpolating from the
+ * first Point, first we need to reset it using this method.
  */
   public void resetToBeginning()
     {
@@ -564,7 +568,9 @@ public abstract class Dynamic
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * @param duration Number of milliseconds this Dynamic will interpolate for.
+ * @param duration Number of milliseconds one revolution will take.
+ *                 What constitutes 'one revolution' depends on the MODE:
+ *                 {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  */
   public void setDuration(long duration)
     {
@@ -573,7 +579,7 @@ public abstract class Dynamic
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * @return Number of milliseconds this Dynamic will interpolate for.
+ * @return Number of milliseconds one revolution will take.
  */
   public long getDuration()
     {
@@ -582,19 +588,21 @@ public abstract class Dynamic
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Sets the access mode this Dynamic will be working in.
+ * Sets the access type this Dynamic will be working in.
  *
- * @param mode {@link Dynamic#ACCESS_RANDOM} or {@link Dynamic#ACCESS_SEQUENTIAL}.
+ * @param type {@link Dynamic#ACCESS_TYPE_RANDOM} or {@link Dynamic#ACCESS_TYPE_SEQUENTIAL}.
  */
-  public void setAccessMode(int mode)
+  public void setAccessType(int type)
     {
-    mAccessMode = mode;
+    mAccessType = type;
     mLastPos = -1;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Return the Dimension, ie number of floats in a single Point this Dynamic interpolates through.
+ *
+ * @return number of floats in a single Point (ie its dimension) contained in the Dynamic.
  */
   public int getDimension()
     {
@@ -607,8 +615,10 @@ public abstract class Dynamic
  *
  * @param buffer Float buffer we will write the results to.
  * @param offset Offset in the buffer where to write the result.
- * @param time Time of interpolation. Time=0.0 would return the first Point, Time=0.5 - the last,
- *             time=1.0 - the first again, and time 0.1 would be 1/5 of the way between the first and the last Points.
+ * @param time   Time of interpolation. Time=0.0 is the beginning of the first revolution, time=1.0 - the end
+ *               of the first revolution, time=2.5 - the middle of the third revolution.
+ *               What constitutes 'one revolution' depends on the MODE:
+ *               {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  */
   public void get(float[] buffer, int offset, long time)
     {
@@ -645,9 +655,10 @@ public abstract class Dynamic
  *
  * @param buffer Float buffer we will write the results to.
  * @param offset Offset in the buffer where to write the result.
- * @param time   Time of interpolation. Time=0.0 would return the first Point, Time=0.5*mDuration - the
- *               last, time=1.0*mDuration - the first again, and time 0.1*mDuration would be 1/5 of the
- *               way between the first and the last Points.
+ * @param time   Time of interpolation. Time=0.0 is the beginning of the first revolution, time=1.0 - the end
+ *               of the first revolution, time=2.5 - the middle of the third revolution.
+ *               What constitutes 'one revolution' depends on the MODE:
+ *               {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  * @param step   Time difference between now and the last time we called this function. Needed to figure
  *               out if the previous time we were called the effect wasn't finished yet, but now it is.
  * @return true if the interpolation reached its end.
@@ -677,7 +688,7 @@ public abstract class Dynamic
 
     double pos;
 
-    if( mAccessMode==ACCESS_SEQUENTIAL )
+    if( mAccessType ==ACCESS_TYPE_SEQUENTIAL )
       {
       pos = mLastPos<0 ? (double)time/mDuration : (double)step/mDuration + mLastPos;
       mLastPos = pos;
diff --git a/src/main/java/org/distorted/library/type/Dynamic1D.java b/src/main/java/org/distorted/library/type/Dynamic1D.java
index 64e719d..da68f9b 100644
--- a/src/main/java/org/distorted/library/type/Dynamic1D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic1D.java
@@ -143,12 +143,13 @@ public class Dynamic1D extends Dynamic implements Data1D
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 /**
- * Default constructor.
+ * Constructor setting the speed of interpolation and the number of revolutions.
+ *
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  *
- * @param duration number of milliseconds it takes to do a full loop/path from first vector to the
- *                 last and back to the first
- * @param count    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.
+ * @param duration number of milliseconds it takes to do one revolution.
+ * @param count    number of revolutions we will do. Count<=0 means 'infinite'.
  */
   public Dynamic1D(int duration, float count)
     {
diff --git a/src/main/java/org/distorted/library/type/Dynamic2D.java b/src/main/java/org/distorted/library/type/Dynamic2D.java
index 9ee1f57..678d0eb 100644
--- a/src/main/java/org/distorted/library/type/Dynamic2D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic2D.java
@@ -157,14 +157,14 @@ public class Dynamic2D extends Dynamic implements Data2D
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
 /**
- * Default constructor.
+ * Constructor setting the speed of interpolation and the number of revolutions.
+ *
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  *
- * @param duration number of milliseconds it takes to do a full loop/path from first vector to the
- *                 last and back to the first
- * @param count    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.
+ * @param duration number of milliseconds it takes to do one revolution.
+ * @param count    number of revolutions we will do. Count<=0 means 'infinite'.
  */
   public Dynamic2D(int duration, float count)
     {
diff --git a/src/main/java/org/distorted/library/type/Dynamic3D.java b/src/main/java/org/distorted/library/type/Dynamic3D.java
index 1de10b1..5a17bed 100644
--- a/src/main/java/org/distorted/library/type/Dynamic3D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic3D.java
@@ -173,14 +173,14 @@ public class Dynamic3D extends Dynamic implements Data3D
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
 /**
- * Default constructor.
+ * Constructor setting the speed of interpolation and the number of revolutions.
+ *
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  *
- * @param duration number of milliseconds it takes to do a full loop/path from first vector to the
- *                 last and back to the first
- * @param count    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.
+ * @param duration number of milliseconds it takes to do one revolution.
+ * @param count    number of revolutions we will do. Count<=0 means 'infinite'.
  */
   public Dynamic3D(int duration, float count)
     {
diff --git a/src/main/java/org/distorted/library/type/Dynamic4D.java b/src/main/java/org/distorted/library/type/Dynamic4D.java
index 148d766..2a8b131 100644
--- a/src/main/java/org/distorted/library/type/Dynamic4D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic4D.java
@@ -189,14 +189,14 @@ public class Dynamic4D extends Dynamic implements Data4D
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
 /**
- * Default constructor.
+ * Constructor setting the speed of interpolation and the number of revolutions.
+ *
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  *
- * @param duration number of milliseconds it takes to do a full loop/path from first vector to the
- *                 last and back to the first
- * @param count    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.
+ * @param duration number of milliseconds it takes to do one revolution.
+ * @param count    number of revolutions we will do. Count<=0 means 'infinite'.
  */
   public Dynamic4D(int duration, float count)
     {
diff --git a/src/main/java/org/distorted/library/type/Dynamic5D.java b/src/main/java/org/distorted/library/type/Dynamic5D.java
index 50a852e..c6b8e45 100644
--- a/src/main/java/org/distorted/library/type/Dynamic5D.java
+++ b/src/main/java/org/distorted/library/type/Dynamic5D.java
@@ -205,14 +205,14 @@ public class Dynamic5D extends Dynamic implements Data5D
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
 /**
- * Default constructor.
+ * Constructor setting the speed of interpolation and the number of revolutions.
+ *
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
  *
- * @param duration number of milliseconds it takes to do a full loop/path from first vector to the
- *                 last and back to the first
- * @param count    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.
+ * @param duration number of milliseconds it takes to do one revolution.
+ * @param count    number of revolutions we will do. Count<=0 means 'infinite'.
  */
   public Dynamic5D(int duration, float count)
     {
diff --git a/src/main/java/org/distorted/library/type/DynamicQuat.java b/src/main/java/org/distorted/library/type/DynamicQuat.java
index 2be4329..e4cd2be 100644
--- a/src/main/java/org/distorted/library/type/DynamicQuat.java
+++ b/src/main/java/org/distorted/library/type/DynamicQuat.java
@@ -115,14 +115,14 @@ public class DynamicQuat extends Dynamic implements Data4D
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
 /**
- * Default constructor.
+ * Constructor setting the speed of interpolation and the number of revolutions.
  *
- * @param duration number of milliseconds it takes to do a full loop/path from first vector to the
- *                 last and back to the first
- * @param count    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.
+ * What constitutes 'one revolution' depends on the MODE:
+ * {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
+ *
+ * @param duration number of milliseconds it takes to do one revolution.
+ * @param count    number of revolutions we will do. Count<=0 means 'infinite'.
  */
   public DynamicQuat(int duration, float count)
     {
@@ -134,7 +134,7 @@ public class DynamicQuat extends Dynamic implements Data4D
     mDuration  = duration;
     mCount     = count;
     mLastPos   = -1;
-    mAccessMode= ACCESS_RANDOM;
+    mAccessType = ACCESS_TYPE_RANDOM;
     mDimension = 4;
     }
 
@@ -320,9 +320,11 @@ public class DynamicQuat extends Dynamic implements Data4D
  * 
  * @param buffer Float buffer we will write the resulting Static4D to.
  * @param offset Offset in the buffer where to write the result.
- * @param time Time of interpolation. Time=0.0 would return the first Point, Time=0.5 - the last,
- *             time=1.0 - the first again, and time 0.1 would be 1/5 of the way between the first and the last Points.
- */    
+ * @param time   Time of interpolation. Time=0.0 is the beginning of the first revolution, time=1.0 - the end
+ *               of the first revolution, time=2.5 - the middle of the third revolution.
+ *               What constitutes 'one revolution' depends on the MODE:
+ *               {@link Dynamic#MODE_LOOP}, {@link Dynamic#MODE_PATH} or {@link Dynamic#MODE_JUMP}.
+ **/
   synchronized void interpolate(float[] buffer, int offset, float time)
     {  
     switch(numPoints)
