From cc83fd13f95ac6f43012866a7704fe1c1c9016f2 Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Mon, 5 Jan 2015 21:52:28 -0600 Subject: [PATCH 1/7] Create new classes to bring Tuples into one hierarchy The new hierarchy will look like this: Tuple |- Tuplef (Tuple of type float) | `- Tuple2f, Tuple3f, Tuple4f |- Tupled (Tuple of type double) | `- Tuple2d, Tuple3d, Tuple4d `- Tuplei (Tuple of type int) `- Tuple2i, Tuple3i, Tuple4i The tuples of type byte (Tuple3b, Tuple4b) will not participate in this hierarchy since they do not currently implement any of its methods (add, subtract, etc.), unless someone wishes to write these methods. --- src/javax/vecmath/Tuple.java | 25 +++++++++++++++++++++++++ src/javax/vecmath/Tupled.java | 18 ++++++++++++++++++ src/javax/vecmath/Tuplef.java | 18 ++++++++++++++++++ src/javax/vecmath/Tuplei.java | 18 ++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 src/javax/vecmath/Tuple.java create mode 100644 src/javax/vecmath/Tupled.java create mode 100644 src/javax/vecmath/Tuplef.java create mode 100644 src/javax/vecmath/Tuplei.java diff --git a/src/javax/vecmath/Tuple.java b/src/javax/vecmath/Tuple.java new file mode 100644 index 0000000..e390b3e --- /dev/null +++ b/src/javax/vecmath/Tuple.java @@ -0,0 +1,25 @@ +package javax.vecmath; + +public abstract class Tuple> { + + public abstract void absolute(); + public abstract void absolute(T t); + public abstract void add(T t); + public abstract void add(T t1, T t2); + public abstract void get(T t); + public abstract void negate(); + public abstract void negate(T t); + public abstract void set(T t); + public abstract void sub(T t1); + public abstract void sub(T t1, T t2); + + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException e) { + // this shouldn't happen, since we are Cloneable + throw new InternalError(); + } + } + +} diff --git a/src/javax/vecmath/Tupled.java b/src/javax/vecmath/Tupled.java new file mode 100644 index 0000000..ee5bc72 --- /dev/null +++ b/src/javax/vecmath/Tupled.java @@ -0,0 +1,18 @@ +package javax.vecmath; + +public abstract class Tupled> extends Tuple { + + public abstract void clamp(double min, double max); + public abstract void clamp(double min, double max, T t); + public abstract void clampMax(double max); + public abstract void clampMax(double max, T t); + public abstract void clampMin(double min); + public abstract void clampMin(double min, T t); + public abstract void get(double[] t); + public abstract void scale(double s); + public abstract void scale(double s, T t); + public abstract void scaleAdd(double s, T t); + public abstract void scaleAdd(double s, T t1, T t2); + public abstract void set(double[] t); + +} diff --git a/src/javax/vecmath/Tuplef.java b/src/javax/vecmath/Tuplef.java new file mode 100644 index 0000000..447e659 --- /dev/null +++ b/src/javax/vecmath/Tuplef.java @@ -0,0 +1,18 @@ +package javax.vecmath; + +public abstract class Tuplef> extends Tuple { + + public abstract void clamp(float min, float max); + public abstract void clamp(float min, float max, T t); + public abstract void clampMax(float max); + public abstract void clampMax(float max, T t); + public abstract void clampMin(float min); + public abstract void clampMin(float min, T t); + public abstract void get(float[] t); + public abstract void scale(float s); + public abstract void scale(float s, T t); + public abstract void scaleAdd(float s, T t); + public abstract void scaleAdd(float s, T t1, T t2); + public abstract void set(float[] t); + +} diff --git a/src/javax/vecmath/Tuplei.java b/src/javax/vecmath/Tuplei.java new file mode 100644 index 0000000..61d4fb3 --- /dev/null +++ b/src/javax/vecmath/Tuplei.java @@ -0,0 +1,18 @@ +package javax.vecmath; + +public abstract class Tuplei> extends Tuple { + + public abstract void clamp(int min, int max); + public abstract void clamp(int min, int max, T t); + public abstract void clampMax(int max); + public abstract void clampMax(int max, T t); + public abstract void clampMin(int min); + public abstract void clampMin(int min, T t); + public abstract void get(int[] t); + public abstract void scale(int s); + public abstract void scale(int s, T t); + public abstract void scaleAdd(int s, T t); + public abstract void scaleAdd(int s, T t1, T t2); + public abstract void set(int[] t); + +} From 445e235332bfcaa1efde9226cbfb9044775d7469 Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Mon, 5 Jan 2015 22:00:35 -0600 Subject: [PATCH 2/7] Cause most of the various TupleXX classes to inherit from Tuple Make most of the TupleXX classes extend either Tupled, Tuplef, or Tuplei. This includes the addition of methods where necessary and the removal of several now-unnecessary clone methods (these are covered by Tuple's clone method). --- src/javax/vecmath/Tuple2d.java | 35 ++++++++++++++-------------------- src/javax/vecmath/Tuple2f.java | 34 +++++++++++++-------------------- src/javax/vecmath/Tuple2i.java | 21 +------------------- src/javax/vecmath/Tuple3d.java | 22 ++------------------- src/javax/vecmath/Tuple3f.java | 23 ++-------------------- src/javax/vecmath/Tuple3i.java | 23 ++-------------------- src/javax/vecmath/Tuple4d.java | 22 ++------------------- src/javax/vecmath/Tuple4f.java | 22 ++------------------- src/javax/vecmath/Tuple4i.java | 24 ++--------------------- 9 files changed, 40 insertions(+), 186 deletions(-) diff --git a/src/javax/vecmath/Tuple2d.java b/src/javax/vecmath/Tuple2d.java index 673bfb2..3619e3b 100644 --- a/src/javax/vecmath/Tuple2d.java +++ b/src/javax/vecmath/Tuple2d.java @@ -32,7 +32,8 @@ * floating point x,y coordinates. * */ -public abstract class Tuple2d implements java.io.Serializable, Cloneable { +public abstract class Tuple2d extends Tupled +implements java.io.Serializable, Cloneable { static final long serialVersionUID = 6205762482756093838L; @@ -157,6 +158,18 @@ public final void get(double[] t) } + /** + * Copies the x and y coordinates of this tuple into the tuple t. + * @param t the Tuple2d object into which the values of this object are copied + * @since vecmath 1.6 + */ + public final void get(Tuple2d t) + { + t.x = this.x; + t.y = this.y; + } + + /** * Sets the value of this tuple to the vector sum of tuples t1 and t2. * @param t1 the first tuple @@ -534,26 +547,6 @@ public final void interpolate(Tuple2d t1, double alpha) } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple2f.java b/src/javax/vecmath/Tuple2f.java index d5b72d8..af679a4 100644 --- a/src/javax/vecmath/Tuple2f.java +++ b/src/javax/vecmath/Tuple2f.java @@ -32,7 +32,7 @@ * floating point x,y coordinates. * */ -public abstract class Tuple2f implements java.io.Serializable, Cloneable { +public abstract class Tuple2f extends Tuplef implements java.io.Serializable, Cloneable { static final long serialVersionUID = 9011180388985266884L; @@ -159,6 +159,18 @@ public final void get(float[] t) } + /** + * Copies the x and y coordinates of this tuple into the tuple t. + * @param t the Tuple2f object into which the values of this object are copied + * @since vecmath 1.6 + */ + public final void get(Tuple2f t) + { + t.x = this.x; + t.y = this.y; + } + + /** * Sets the value of this tuple to the vector sum of tuples t1 and t2. * @param t1 the first tuple @@ -538,26 +550,6 @@ public final void interpolate(Tuple2f t1, float alpha) } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple2i.java b/src/javax/vecmath/Tuple2i.java index 9a29e0b..25d4cd9 100644 --- a/src/javax/vecmath/Tuple2i.java +++ b/src/javax/vecmath/Tuple2i.java @@ -33,7 +33,7 @@ * * @since vecmath 1.4 */ -public abstract class Tuple2i implements java.io.Serializable, Cloneable { +public abstract class Tuple2i extends Tuplei implements java.io.Serializable, Cloneable { static final long serialVersionUID = -3555701650170169638L; @@ -436,25 +436,6 @@ public final void absolute() { y = Math.abs(y); } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple3d.java b/src/javax/vecmath/Tuple3d.java index c02eed1..bfde06b 100644 --- a/src/javax/vecmath/Tuple3d.java +++ b/src/javax/vecmath/Tuple3d.java @@ -32,7 +32,8 @@ * floating point x,y,z coordinates. * */ -public abstract class Tuple3d implements java.io.Serializable, Cloneable { +public abstract class Tuple3d extends Tupled +implements java.io.Serializable, Cloneable { static final long serialVersionUID = 5542096614926168415L; @@ -665,25 +666,6 @@ public final void interpolate(Tuple3d t1, double alpha) { this.z = (1-alpha)*this.z + alpha*t1.z; } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple3f.java b/src/javax/vecmath/Tuple3f.java index 28943ee..7b6301c 100644 --- a/src/javax/vecmath/Tuple3f.java +++ b/src/javax/vecmath/Tuple3f.java @@ -32,7 +32,8 @@ * point x,y,z coordinates. * */ -public abstract class Tuple3f implements java.io.Serializable, Cloneable { +public abstract class Tuple3f extends Tuplef +implements java.io.Serializable, Cloneable { static final long serialVersionUID=5019834619484343712L; @@ -619,26 +620,6 @@ public final void interpolate(Tuple3f t1, float alpha) } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple3i.java b/src/javax/vecmath/Tuple3i.java index 0d464d2..04bdce5 100644 --- a/src/javax/vecmath/Tuple3i.java +++ b/src/javax/vecmath/Tuple3i.java @@ -33,7 +33,8 @@ * * @since vecmath 1.2 */ -public abstract class Tuple3i implements java.io.Serializable, Cloneable { +public abstract class Tuple3i extends Tuplei +implements java.io.Serializable, Cloneable { static final long serialVersionUID = -732740491767276200L; @@ -497,26 +498,6 @@ public final void absolute() { z = Math.abs(z); } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple4d.java b/src/javax/vecmath/Tuple4d.java index d5269f0..1de839c 100644 --- a/src/javax/vecmath/Tuple4d.java +++ b/src/javax/vecmath/Tuple4d.java @@ -32,7 +32,8 @@ * x,y,z,w coordinates. * */ -public abstract class Tuple4d implements java.io.Serializable, Cloneable { +public abstract class Tuple4d extends Tupled +implements java.io.Serializable, Cloneable { static final long serialVersionUID = -4748953690425311052L; @@ -750,25 +751,6 @@ public void interpolate(Tuple4d t1, double alpha) { this.w = (1-alpha)*this.w + alpha*t1.w; } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple4f.java b/src/javax/vecmath/Tuple4f.java index ae2205a..3709012 100644 --- a/src/javax/vecmath/Tuple4f.java +++ b/src/javax/vecmath/Tuple4f.java @@ -32,7 +32,8 @@ * coordinates. * */ -public abstract class Tuple4f implements java.io.Serializable, Cloneable { +public abstract class Tuple4f extends Tuplef +implements java.io.Serializable, Cloneable { static final long serialVersionUID = 7068460319248845763L; @@ -681,25 +682,6 @@ public void interpolate(Tuple4f t1, float alpha) } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - /** * Get the x coordinate. * diff --git a/src/javax/vecmath/Tuple4i.java b/src/javax/vecmath/Tuple4i.java index d27f2b6..ccd443d 100644 --- a/src/javax/vecmath/Tuple4i.java +++ b/src/javax/vecmath/Tuple4i.java @@ -33,7 +33,8 @@ * * @since vecmath 1.2 */ -public abstract class Tuple4i implements java.io.Serializable, Cloneable { +public abstract class Tuple4i extends Tuplei +implements java.io.Serializable, Cloneable { static final long serialVersionUID = 8064614250942616720L; @@ -562,27 +563,6 @@ public final void absolute() { w = Math.abs(w); } - /** - * Creates a new object of the same class as this object. - * - * @return a clone of this instance. - * @exception OutOfMemoryError if there is not enough memory. - * @see java.lang.Cloneable - * @since vecmath 1.3 - */ - @Override - public Object clone() { - // Since there are no arrays we can just use Object.clone() - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // this shouldn't happen, since we are Cloneable - throw new InternalError(); - } - } - - - /** * Get the x coordinate. * From fb81d5fcca212075d072dfcc510a79f901499a44 Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Mon, 5 Jan 2015 22:37:40 -0600 Subject: [PATCH 3/7] Make Tuple implement Cloneable and Serializable Add serialVersionUID to Tuple, Tuplef, Tuplei, and Tupled. Also remove the "implements java.io.Serializable, Cloneable" declarations from the subclasses of Tuple, as this commit makes them redundant. --- src/javax/vecmath/Tuple.java | 5 ++++- src/javax/vecmath/Tuple2d.java | 3 +-- src/javax/vecmath/Tuple2f.java | 2 +- src/javax/vecmath/Tuple2i.java | 2 +- src/javax/vecmath/Tuple3d.java | 3 +-- src/javax/vecmath/Tuple3f.java | 3 +-- src/javax/vecmath/Tuple3i.java | 3 +-- src/javax/vecmath/Tuple4d.java | 3 +-- src/javax/vecmath/Tuple4f.java | 3 +-- src/javax/vecmath/Tuple4i.java | 3 +-- src/javax/vecmath/Tupled.java | 2 ++ src/javax/vecmath/Tuplef.java | 2 ++ src/javax/vecmath/Tuplei.java | 2 ++ 13 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/javax/vecmath/Tuple.java b/src/javax/vecmath/Tuple.java index e390b3e..83e8ace 100644 --- a/src/javax/vecmath/Tuple.java +++ b/src/javax/vecmath/Tuple.java @@ -1,6 +1,9 @@ package javax.vecmath; -public abstract class Tuple> { +public abstract class Tuple> +implements java.io.Serializable, Cloneable { + + private static final long serialVersionUID = 2172728256449529639L; public abstract void absolute(); public abstract void absolute(T t); diff --git a/src/javax/vecmath/Tuple2d.java b/src/javax/vecmath/Tuple2d.java index 3619e3b..6da24cc 100644 --- a/src/javax/vecmath/Tuple2d.java +++ b/src/javax/vecmath/Tuple2d.java @@ -32,8 +32,7 @@ * floating point x,y coordinates. * */ -public abstract class Tuple2d extends Tupled -implements java.io.Serializable, Cloneable { +public abstract class Tuple2d extends Tupled { static final long serialVersionUID = 6205762482756093838L; diff --git a/src/javax/vecmath/Tuple2f.java b/src/javax/vecmath/Tuple2f.java index af679a4..862f3cb 100644 --- a/src/javax/vecmath/Tuple2f.java +++ b/src/javax/vecmath/Tuple2f.java @@ -32,7 +32,7 @@ * floating point x,y coordinates. * */ -public abstract class Tuple2f extends Tuplef implements java.io.Serializable, Cloneable { +public abstract class Tuple2f extends Tuplef { static final long serialVersionUID = 9011180388985266884L; diff --git a/src/javax/vecmath/Tuple2i.java b/src/javax/vecmath/Tuple2i.java index 25d4cd9..1241ba5 100644 --- a/src/javax/vecmath/Tuple2i.java +++ b/src/javax/vecmath/Tuple2i.java @@ -33,7 +33,7 @@ * * @since vecmath 1.4 */ -public abstract class Tuple2i extends Tuplei implements java.io.Serializable, Cloneable { +public abstract class Tuple2i extends Tuplei { static final long serialVersionUID = -3555701650170169638L; diff --git a/src/javax/vecmath/Tuple3d.java b/src/javax/vecmath/Tuple3d.java index bfde06b..d9c98c1 100644 --- a/src/javax/vecmath/Tuple3d.java +++ b/src/javax/vecmath/Tuple3d.java @@ -32,8 +32,7 @@ * floating point x,y,z coordinates. * */ -public abstract class Tuple3d extends Tupled -implements java.io.Serializable, Cloneable { +public abstract class Tuple3d extends Tupled { static final long serialVersionUID = 5542096614926168415L; diff --git a/src/javax/vecmath/Tuple3f.java b/src/javax/vecmath/Tuple3f.java index 7b6301c..685c18d 100644 --- a/src/javax/vecmath/Tuple3f.java +++ b/src/javax/vecmath/Tuple3f.java @@ -32,8 +32,7 @@ * point x,y,z coordinates. * */ -public abstract class Tuple3f extends Tuplef -implements java.io.Serializable, Cloneable { +public abstract class Tuple3f extends Tuplef { static final long serialVersionUID=5019834619484343712L; diff --git a/src/javax/vecmath/Tuple3i.java b/src/javax/vecmath/Tuple3i.java index 04bdce5..c842136 100644 --- a/src/javax/vecmath/Tuple3i.java +++ b/src/javax/vecmath/Tuple3i.java @@ -33,8 +33,7 @@ * * @since vecmath 1.2 */ -public abstract class Tuple3i extends Tuplei -implements java.io.Serializable, Cloneable { +public abstract class Tuple3i extends Tuplei { static final long serialVersionUID = -732740491767276200L; diff --git a/src/javax/vecmath/Tuple4d.java b/src/javax/vecmath/Tuple4d.java index 1de839c..ee6805e 100644 --- a/src/javax/vecmath/Tuple4d.java +++ b/src/javax/vecmath/Tuple4d.java @@ -32,8 +32,7 @@ * x,y,z,w coordinates. * */ -public abstract class Tuple4d extends Tupled -implements java.io.Serializable, Cloneable { +public abstract class Tuple4d extends Tupled { static final long serialVersionUID = -4748953690425311052L; diff --git a/src/javax/vecmath/Tuple4f.java b/src/javax/vecmath/Tuple4f.java index 3709012..0284f43 100644 --- a/src/javax/vecmath/Tuple4f.java +++ b/src/javax/vecmath/Tuple4f.java @@ -32,8 +32,7 @@ * coordinates. * */ -public abstract class Tuple4f extends Tuplef -implements java.io.Serializable, Cloneable { +public abstract class Tuple4f extends Tuplef { static final long serialVersionUID = 7068460319248845763L; diff --git a/src/javax/vecmath/Tuple4i.java b/src/javax/vecmath/Tuple4i.java index ccd443d..330bbce 100644 --- a/src/javax/vecmath/Tuple4i.java +++ b/src/javax/vecmath/Tuple4i.java @@ -33,8 +33,7 @@ * * @since vecmath 1.2 */ -public abstract class Tuple4i extends Tuplei -implements java.io.Serializable, Cloneable { +public abstract class Tuple4i extends Tuplei { static final long serialVersionUID = 8064614250942616720L; diff --git a/src/javax/vecmath/Tupled.java b/src/javax/vecmath/Tupled.java index ee5bc72..4e6ab2b 100644 --- a/src/javax/vecmath/Tupled.java +++ b/src/javax/vecmath/Tupled.java @@ -2,6 +2,8 @@ public abstract class Tupled> extends Tuple { + private static final long serialVersionUID = -3801927462376993083L; + public abstract void clamp(double min, double max); public abstract void clamp(double min, double max, T t); public abstract void clampMax(double max); diff --git a/src/javax/vecmath/Tuplef.java b/src/javax/vecmath/Tuplef.java index 447e659..2d4806c 100644 --- a/src/javax/vecmath/Tuplef.java +++ b/src/javax/vecmath/Tuplef.java @@ -2,6 +2,8 @@ public abstract class Tuplef> extends Tuple { + private static final long serialVersionUID = 8831086203906732583L; + public abstract void clamp(float min, float max); public abstract void clamp(float min, float max, T t); public abstract void clampMax(float max); diff --git a/src/javax/vecmath/Tuplei.java b/src/javax/vecmath/Tuplei.java index 61d4fb3..1f97fb6 100644 --- a/src/javax/vecmath/Tuplei.java +++ b/src/javax/vecmath/Tuplei.java @@ -2,6 +2,8 @@ public abstract class Tuplei> extends Tuple { + private static final long serialVersionUID = -7508116170295643350L; + public abstract void clamp(int min, int max); public abstract void clamp(int min, int max, T t); public abstract void clampMax(int max); From 0c76dbf64d65fbfc27f6aa6ce281edf68f766c8d Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Tue, 6 Jan 2015 15:32:20 -0600 Subject: [PATCH 4/7] Add equals(Tuple) as an abstract method Specify the abstract method equals(T) in type Tuple. --- src/javax/vecmath/Tuple.java | 8 ++++++++ src/javax/vecmath/Tuple2i.java | 10 ++++++++++ src/javax/vecmath/Tuple3i.java | 10 ++++++++++ src/javax/vecmath/Tuple4i.java | 11 +++++++++++ 4 files changed, 39 insertions(+) diff --git a/src/javax/vecmath/Tuple.java b/src/javax/vecmath/Tuple.java index 83e8ace..1fd6740 100644 --- a/src/javax/vecmath/Tuple.java +++ b/src/javax/vecmath/Tuple.java @@ -16,6 +16,14 @@ public abstract class Tuple> public abstract void sub(T t1); public abstract void sub(T t1, T t2); + /** + * Returns true if the data members of t1 are equal to the corresponding + * data members in this Tuple. + * @param t1 the tuple with which the comparison is made + * @return true or false + */ + public abstract boolean equals(T t); + public Object clone() { try { return super.clone(); diff --git a/src/javax/vecmath/Tuple2i.java b/src/javax/vecmath/Tuple2i.java index 1241ba5..f6660f9 100644 --- a/src/javax/vecmath/Tuple2i.java +++ b/src/javax/vecmath/Tuple2i.java @@ -286,6 +286,16 @@ public boolean equals(Object t1) { } + @Override + public boolean equals(Tuple2i t1) { + try { + return (this.x == t1.x && this.y == t1.y); + } catch (NullPointerException e2) { + return false; + } + } + + /** * Returns a hash code value based on the data values in this * object. Two different Tuple2i objects with identical data values diff --git a/src/javax/vecmath/Tuple3i.java b/src/javax/vecmath/Tuple3i.java index c842136..693306f 100644 --- a/src/javax/vecmath/Tuple3i.java +++ b/src/javax/vecmath/Tuple3i.java @@ -312,6 +312,16 @@ public boolean equals(Object t1) { } + @Override + public boolean equals(Tuple3i t1) { + try { + return (this.x == t1.x && this.y == t1.y && this.z == t1.z); + } catch (NullPointerException e2) { + return false; + } + } + + /** * Returns a hash code value based on the data values in this * object. Two different Tuple3i objects with identical data values diff --git a/src/javax/vecmath/Tuple4i.java b/src/javax/vecmath/Tuple4i.java index 330bbce..9b7b305 100644 --- a/src/javax/vecmath/Tuple4i.java +++ b/src/javax/vecmath/Tuple4i.java @@ -340,6 +340,17 @@ public boolean equals(Object t1) { } + @Override + public boolean equals(Tuple4i t1) { + try { + return (this.x == t1.x && this.y == t1.y && + this.z == t1.z && this.w == t1.w); + } catch (NullPointerException e2) { + return false; + } + } + + /** * Returns a hash code value based on the data values in this * object. Two different Tuple4i objects with identical data values From 643a45823aa3fc327c782fbb75b25913786e280a Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Tue, 6 Jan 2015 15:55:23 -0600 Subject: [PATCH 5/7] Added documentation Documented Tuple, Tupled, Tuplef, Tuplei and their methods. --- src/javax/vecmath/Tuple.java | 69 +++++++++++++++++++++++++++- src/javax/vecmath/Tupled.java | 85 +++++++++++++++++++++++++++++++++++ src/javax/vecmath/Tuplef.java | 85 +++++++++++++++++++++++++++++++++++ src/javax/vecmath/Tuplei.java | 85 +++++++++++++++++++++++++++++++++++ 4 files changed, 322 insertions(+), 2 deletions(-) diff --git a/src/javax/vecmath/Tuple.java b/src/javax/vecmath/Tuple.java index 1fd6740..7b5d6db 100644 --- a/src/javax/vecmath/Tuple.java +++ b/src/javax/vecmath/Tuple.java @@ -1,19 +1,84 @@ package javax.vecmath; +/** + * This is the top-level class of the hierarchy of Tuples. It specifies + * methods which accept as their arguments other Tuples of the same number + * and type as the Tuple on which the method is invoked, or methods which + * accept no arguments. Methods which accept primitives are specified by the + * subclasses of Tuple. + * + * @param The type of this tuple as a subclass of Tuple; the number and + * type of primitives held by this Tuple are determined by this parameter. + * Subclasses of Tuple should provide themselves to fill this parameter. + * + * @since 1.6 + */ public abstract class Tuple> implements java.io.Serializable, Cloneable { - private static final long serialVersionUID = 2172728256449529639L; + private static final long serialVersionUID = 2172728256449529639L; + /** + * Sets each component of this tuple to its absolute value. + */ public abstract void absolute(); + + /** + * Sets each component of the tuple parameter to its absolute + * value and places the modified values into this tuple. + * @param t the source tuple, which will not be modified + */ public abstract void absolute(T t); - public abstract void add(T t); + + /** + * Sets the value of this tuple to the vector sum of itself and tuple t1. + * @param t1 the other tuple + */ + public abstract void add(T t1); + + /** + * Sets the value of this tuple to the vector sum of tuples t1 and t2. + * @param t1 the first tuple + * @param t2 the second tuple + */ public abstract void add(T t1, T t2); + + /** + * Gets the value of this tuple and copies the values into t. + * @param t the Tuple object into which the values of this object are copied + */ public abstract void get(T t); + + /** + * Negates the value of this tuple in place. + */ public abstract void negate(); + + /** + * Sets the value of this tuple to the negation of tuple t1. + * @param t1 the source tuple + */ public abstract void negate(T t); + + /** + * Sets the value of this tuple to the value of tuple t1. + * @param t1 the tuple to be copied + */ public abstract void set(T t); + + /** + * Sets the value of this tuple to the vector difference of + * itself and tuple t1 (this = this - t1) . + * @param t1 the other tuple + */ public abstract void sub(T t1); + + /** + * Sets the value of this tuple to the vector difference + * of tuples t1 and t2 (this = t1 - t2). + * @param t1 the first tuple + * @param t2 the second tuple + */ public abstract void sub(T t1, T t2); /** diff --git a/src/javax/vecmath/Tupled.java b/src/javax/vecmath/Tupled.java index 4e6ab2b..f00807f 100644 --- a/src/javax/vecmath/Tupled.java +++ b/src/javax/vecmath/Tupled.java @@ -1,20 +1,105 @@ package javax.vecmath; +/** + * This class describes a Tuple that holds doubles. The number of doubles is + * determined by subclasses. + * + * @param The type of this tuple. Subclasses should provide themselves to + * fill this parameter. + * + * @since 1.6 + */ public abstract class Tupled> extends Tuple { private static final long serialVersionUID = -3801927462376993083L; + /** + * Clamps this tuple to the range [low, high]. + * @param min the lowest value in this tuple after clamping + * @param max the highest value in this tuple after clamping + */ public abstract void clamp(double min, double max); + + /** + * Clamps the tuple parameter to the range [low, high] and + * places the values into this tuple. + * @param min the lowest value in the tuple after clamping + * @param max the highest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clamp(double min, double max, T t); + + /** + * Clamps the maximum value of this tuple to the max parameter. + * @param max the highest value in the tuple after clamping + */ public abstract void clampMax(double max); + + /** + * Clamps the maximum value of the tuple parameter to the max + * parameter and places the values into this tuple. + * @param max the highest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clampMax(double max, T t); + + /** + * Clamps the minimum value of this tuple to the min parameter. + * @param min the lowest value in this tuple after clamping + */ public abstract void clampMin(double min); + + /** + * Clamps the minimum value of the tuple parameter to the min + * parameter and places the values into this tuple. + * @param min the lowest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clampMin(double min, T t); + + /** + * Gets the value of this tuple and copies the values into t. + * @param t the array into which the values are copied + */ public abstract void get(double[] t); + + /** + * Sets the value of this vector to the scalar multiplication + * of tuple t1. + * @param s the scalar value + * @param t1 the source tuple + */ public abstract void scale(double s); + + /** + * Sets the value of this tuple to the scalar multiplication + * of the scale factor with this. + * @param s the scalar value + */ public abstract void scale(double s, T t); + + /** + * Sets the value of this tuple to the scalar multiplication + * of itself and then adds tuple t1 (this = s*this + t1). + * @param s the scalar value + * @param t1 the tuple to be added + */ public abstract void scaleAdd(double s, T t); + + /** + * Sets the value of this tuple to the scalar multiplication + * of tuple t1 and then adds tuple t2 (this = s*t1 + t2). + * @param s the scalar value + * @param t1 the tuple to be scaled and added + * @param t2 the tuple to be added without a scale + */ public abstract void scaleAdd(double s, T t1, T t2); + + /** + * Sets the value of this tuple to the coordinates specified in + * the array. + * @param t the array containing the coordintes in order + */ public abstract void set(double[] t); } diff --git a/src/javax/vecmath/Tuplef.java b/src/javax/vecmath/Tuplef.java index 2d4806c..5484246 100644 --- a/src/javax/vecmath/Tuplef.java +++ b/src/javax/vecmath/Tuplef.java @@ -1,20 +1,105 @@ package javax.vecmath; +/** + * This class describes a Tuple that holds floats. The number of floats is + * determined by subclasses. + * + * @param The type of this tuple. Subclasses should provide themselves to + * fill this parameter. + * + * @since 1.6 + */ public abstract class Tuplef> extends Tuple { private static final long serialVersionUID = 8831086203906732583L; + /** + * Clamps this tuple to the range [low, high]. + * @param min the lowest value in this tuple after clamping + * @param max the highest value in this tuple after clamping + */ public abstract void clamp(float min, float max); + + /** + * Clamps the tuple parameter to the range [low, high] and + * places the values into this tuple. + * @param min the lowest value in the tuple after clamping + * @param max the highest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clamp(float min, float max, T t); + + /** + * Clamps the maximum value of this tuple to the max parameter. + * @param max the highest value in the tuple after clamping + */ public abstract void clampMax(float max); + + /** + * Clamps the maximum value of the tuple parameter to the max + * parameter and places the values into this tuple. + * @param max the highest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clampMax(float max, T t); + + /** + * Clamps the minimum value of this tuple to the min parameter. + * @param min the lowest value in this tuple after clamping + */ public abstract void clampMin(float min); + + /** + * Clamps the minimum value of the tuple parameter to the min + * parameter and places the values into this tuple. + * @param min the lowest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clampMin(float min, T t); + + /** + * Gets the value of this tuple and copies the values into t. + * @param t the array into which the values are copied + */ public abstract void get(float[] t); + + /** + * Sets the value of this vector to the scalar multiplication + * of tuple t1. + * @param s the scalar value + * @param t1 the source tuple + */ public abstract void scale(float s); + + /** + * Sets the value of this tuple to the scalar multiplication + * of the scale factor with this. + * @param s the scalar value + */ public abstract void scale(float s, T t); + + /** + * Sets the value of this tuple to the scalar multiplication + * of itself and then adds tuple t1 (this = s*this + t1). + * @param s the scalar value + * @param t1 the tuple to be added + */ public abstract void scaleAdd(float s, T t); + + /** + * Sets the value of this tuple to the scalar multiplication + * of tuple t1 and then adds tuple t2 (this = s*t1 + t2). + * @param s the scalar value + * @param t1 the tuple to be scaled and added + * @param t2 the tuple to be added without a scale + */ public abstract void scaleAdd(float s, T t1, T t2); + + /** + * Sets the value of this tuple to the coordinates specified in + * the array. + * @param t the array containing the coordintes in order + */ public abstract void set(float[] t); } diff --git a/src/javax/vecmath/Tuplei.java b/src/javax/vecmath/Tuplei.java index 1f97fb6..01d969a 100644 --- a/src/javax/vecmath/Tuplei.java +++ b/src/javax/vecmath/Tuplei.java @@ -1,20 +1,105 @@ package javax.vecmath; +/** + * This class describes a Tuple that holds ints. The number of ints is + * determined by subclasses. + * + * @param The type of this tuple. Subclasses should provide themselves to + * fill this parameter. + * + * @since 1.6 + */ public abstract class Tuplei> extends Tuple { private static final long serialVersionUID = -7508116170295643350L; + /** + * Clamps this tuple to the range [low, high]. + * @param min the lowest value in this tuple after clamping + * @param max the highest value in this tuple after clamping + */ public abstract void clamp(int min, int max); + + /** + * Clamps the tuple parameter to the range [low, high] and + * places the values into this tuple. + * @param min the lowest value in the tuple after clamping + * @param max the highest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clamp(int min, int max, T t); + + /** + * Clamps the maximum value of this tuple to the max parameter. + * @param max the highest value in the tuple after clamping + */ public abstract void clampMax(int max); + + /** + * Clamps the maximum value of the tuple parameter to the max + * parameter and places the values into this tuple. + * @param max the highest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clampMax(int max, T t); + + /** + * Clamps the minimum value of this tuple to the min parameter. + * @param min the lowest value in this tuple after clamping + */ public abstract void clampMin(int min); + + /** + * Clamps the minimum value of the tuple parameter to the min + * parameter and places the values into this tuple. + * @param min the lowest value in the tuple after clamping + * @param t the source tuple, which will not be modified + */ public abstract void clampMin(int min, T t); + + /** + * Gets the value of this tuple and copies the values into t. + * @param t the array into which the values are copied + */ public abstract void get(int[] t); + + /** + * Sets the value of this vector to the scalar multiplication + * of tuple t1. + * @param s the scalar value + * @param t1 the source tuple + */ public abstract void scale(int s); + + /** + * Sets the value of this tuple to the scalar multiplication + * of the scale factor with this. + * @param s the scalar value + */ public abstract void scale(int s, T t); + + /** + * Sets the value of this tuple to the scalar multiplication + * of itself and then adds tuple t1 (this = s*this + t1). + * @param s the scalar value + * @param t1 the tuple to be added + */ public abstract void scaleAdd(int s, T t); + + /** + * Sets the value of this tuple to the scalar multiplication + * of tuple t1 and then adds tuple t2 (this = s*t1 + t2). + * @param s the scalar value + * @param t1 the tuple to be scaled and added + * @param t2 the tuple to be added without a scale + */ public abstract void scaleAdd(int s, T t1, T t2); + + /** + * Sets the value of this tuple to the coordinates specified in + * the array. + * @param t the array containing the coordinates in order + */ public abstract void set(int[] t); } From 7aa2345d87cf721f564d55f9bbc691dc7b6fbb7d Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Wed, 7 Jan 2015 12:27:44 -0600 Subject: [PATCH 6/7] Add more abstract methods Add both interpolate methods to Tupled and Tuplef, as well as epsilonEquals to Tupled. (For some reason, Tuplef subclasses don't have epsilonEquals, and I didn't bother to add them.) --- src/javax/vecmath/Tupled.java | 28 ++++++++++++++++++++++++++++ src/javax/vecmath/Tuplef.java | 17 +++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/javax/vecmath/Tupled.java b/src/javax/vecmath/Tupled.java index f00807f..4ab1a4d 100644 --- a/src/javax/vecmath/Tupled.java +++ b/src/javax/vecmath/Tupled.java @@ -102,4 +102,32 @@ public abstract class Tupled> extends Tuple { */ public abstract void set(double[] t); + /** + * Returns true if the L-infinite distance between this tuple + * and tuple t1 is less than or equal to the epsilon parameter, + * otherwise returns false. The L-infinite distance is equal to + * MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2)] for a tuple with 3 parts. + * @param t1 the tuple to be compared to this tuple + * @param epsilon the threshold value + * @return true or false + */ + public abstract boolean epsilonEquals(T t, double epsilon); + + /** + * Linearly interpolates between this tuple and tuple t1 and + * places the result into this tuple: this = (1-alpha)*this + alpha*t1. + * @param t1 the first tuple + * @param alpha the alpha interpolation parameter + */ + public abstract void interpolate(T t1, double alpha); + + /** + * Linearly interpolates between tuples t1 and t2 and places the + * result into this tuple: this = (1-alpha)*t1 + alpha*t2. + * @param t1 the first tuple + * @param t2 the second tuple + * @param alpha the alpha interpolation parameter + */ + public abstract void interpolate(T t1, T t2, double alpha); + } diff --git a/src/javax/vecmath/Tuplef.java b/src/javax/vecmath/Tuplef.java index 5484246..319e1db 100644 --- a/src/javax/vecmath/Tuplef.java +++ b/src/javax/vecmath/Tuplef.java @@ -102,4 +102,21 @@ public abstract class Tuplef> extends Tuple { */ public abstract void set(float[] t); + /** + * Linearly interpolates between this tuple and tuple t1 and + * places the result into this tuple: this = (1-alpha)*this + alpha*t1. + * @param t1 the first tuple + * @param alpha the alpha interpolation parameter + */ + public abstract void interpolate(T t1, float alpha); + + /** + * Linearly interpolates between tuples t1 and t2 and places the + * result into this tuple: this = (1-alpha)*t1 + alpha*t2. + * @param t1 the first tuple + * @param t2 the second tuple + * @param alpha the alpha interpolation parameter + */ + public abstract void interpolate(T t1, T t2, float alpha); + } From f3e24179414e1ca14503ac978de7d84629b642b3 Mon Sep 17 00:00:00 2001 From: Brian McCutchon Date: Fri, 10 Jul 2015 11:49:20 -0500 Subject: [PATCH 7/7] Add docs to Tuple3f --- src/javax/vecmath/Tuple3f.java | 131 +-------------------------------- 1 file changed, 1 insertion(+), 130 deletions(-) diff --git a/src/javax/vecmath/Tuple3f.java b/src/javax/vecmath/Tuple3f.java index 685c18d..db7e78d 100644 --- a/src/javax/vecmath/Tuple3f.java +++ b/src/javax/vecmath/Tuple3f.java @@ -138,11 +138,6 @@ public final void set(float x, float y, float z) } - /** - * Sets the value of this tuple to the xyz coordinates specified in - * the array of length 3. - * @param t the array of length 3 containing xyz in order - */ public final void set(float[] t) { this.x = t[0]; @@ -151,10 +146,6 @@ public final void set(float[] t) } - /** - * Sets the value of this tuple to the value of tuple t1. - * @param t1 the tuple to be copied - */ public final void set(Tuple3f t1) { this.x = t1.x; @@ -175,10 +166,6 @@ public final void set(Tuple3d t1) } - /** - * Gets the value of this tuple and copies the values into t. - * @param t the array of length 3 into which the values are copied - */ public final void get(float[] t) { t[0] = this.x; @@ -187,10 +174,6 @@ public final void get(float[] t) } - /** - * Gets the value of this tuple and copies the values into t. - * @param t the Tuple3f object into which the values of this object are copied - */ public final void get(Tuple3f t) { t.x = this.x; @@ -199,11 +182,6 @@ public final void get(Tuple3f t) } - /** - * Sets the value of this tuple to the vector sum of tuples t1 and t2. - * @param t1 the first tuple - * @param t2 the second tuple - */ public final void add(Tuple3f t1, Tuple3f t2) { this.x = t1.x + t2.x; @@ -212,10 +190,6 @@ public final void add(Tuple3f t1, Tuple3f t2) } - /** - * Sets the value of this tuple to the vector sum of itself and tuple t1. - * @param t1 the other tuple - */ public final void add(Tuple3f t1) { this.x += t1.x; @@ -224,12 +198,6 @@ public final void add(Tuple3f t1) } - /** - * Sets the value of this tuple to the vector difference - * of tuples t1 and t2 (this = t1 - t2). - * @param t1 the first tuple - * @param t2 the second tuple - */ public final void sub(Tuple3f t1, Tuple3f t2) { this.x = t1.x - t2.x; @@ -238,11 +206,6 @@ public final void sub(Tuple3f t1, Tuple3f t2) } - /** - * Sets the value of this tuple to the vector difference of - * itself and tuple t1 (this = this - t1) . - * @param t1 the other tuple - */ public final void sub(Tuple3f t1) { this.x -= t1.x; @@ -251,10 +214,6 @@ public final void sub(Tuple3f t1) } - /** - * Sets the value of this tuple to the negation of tuple t1. - * @param t1 the source tuple - */ public final void negate(Tuple3f t1) { this.x = -t1.x; @@ -263,9 +222,6 @@ public final void negate(Tuple3f t1) } - /** - * Negates the value of this tuple in place. - */ public final void negate() { this.x = -this.x; @@ -274,12 +230,6 @@ public final void negate() } - /** - * Sets the value of this vector to the scalar multiplication - * of tuple t1. - * @param s the scalar value - * @param t1 the source tuple - */ public final void scale(float s, Tuple3f t1) { this.x = s*t1.x; @@ -288,11 +238,6 @@ public final void scale(float s, Tuple3f t1) } - /** - * Sets the value of this tuple to the scalar multiplication - * of the scale factor with this. - * @param s the scalar value - */ public final void scale(float s) { this.x *= s; @@ -301,13 +246,6 @@ public final void scale(float s) } - /** - * Sets the value of this tuple to the scalar multiplication - * of tuple t1 and then adds tuple t2 (this = s*t1 + t2). - * @param s the scalar value - * @param t1 the tuple to be scaled and added - * @param t2 the tuple to be added without a scale - */ public final void scaleAdd(float s, Tuple3f t1, Tuple3f t2) { this.x = s*t1.x + t2.x; @@ -316,13 +254,6 @@ public final void scaleAdd(float s, Tuple3f t1, Tuple3f t2) } - - /** - * Sets the value of this tuple to the scalar multiplication - * of itself and then adds tuple t1 (this = s*this + t1). - * @param s the scalar value - * @param t1 the tuple to be added - */ public final void scaleAdd(float s, Tuple3f t1) { this.x = s*this.x + t1.x; @@ -331,13 +262,6 @@ public final void scaleAdd(float s, Tuple3f t1) } - /** - * Returns true if the Object t1 is of type Tuple3f and all of the - * data members of t1 are equal to the corresponding data members in - * this Tuple3f. - * @param t1 the vector with which the comparison is made - * @return true or false - */ public boolean equals(Tuple3f t1) { try { @@ -345,6 +269,7 @@ public boolean equals(Tuple3f t1) } catch (NullPointerException e2) {return false;} } + /** * Returns true if the Object t1 is of type Tuple3f and all of the * data members of t1 are equal to the corresponding data members in @@ -413,13 +338,6 @@ public int hashCode() { - /** - * Clamps the tuple parameter to the range [low, high] and - * places the values into this tuple. - * @param min the lowest value in the tuple after clamping - * @param max the highest value in the tuple after clamping - * @param t the source tuple, which will not be modified - */ public final void clamp(float min, float max, Tuple3f t) { if( t.x > max ) { @@ -449,12 +367,6 @@ public final void clamp(float min, float max, Tuple3f t) } - /** - * Clamps the minimum value of the tuple parameter to the min - * parameter and places the values into this tuple. - * @param min the lowest value in the tuple after clamping - * @param t the source tuple, which will not be modified - */ public final void clampMin(float min, Tuple3f t) { if( t.x < min ) { @@ -478,12 +390,6 @@ public final void clampMin(float min, Tuple3f t) } - /** - * Clamps the maximum value of the tuple parameter to the max - * parameter and places the values into this tuple. - * @param max the highest value in the tuple after clamping - * @param t the source tuple, which will not be modified - */ public final void clampMax(float max, Tuple3f t) { if( t.x > max ) { @@ -507,11 +413,6 @@ public final void clampMax(float max, Tuple3f t) } - /** - * Sets each component of the tuple parameter to its absolute - * value and places the modified values into this tuple. - * @param t the source tuple, which will not be modified - */ public final void absolute(Tuple3f t) { x = Math.abs(t.x); @@ -520,12 +421,6 @@ public final void absolute(Tuple3f t) } - - /** - * Clamps this tuple to the range [low, high]. - * @param min the lowest value in this tuple after clamping - * @param max the highest value in this tuple after clamping - */ public final void clamp(float min, float max) { if( x > max ) { @@ -549,10 +444,6 @@ public final void clamp(float min, float max) } - /** - * Clamps the minimum value of this tuple to the min parameter. - * @param min the lowest value in this tuple after clamping - */ public final void clampMin(float min) { if( x < min ) x=min; @@ -562,10 +453,6 @@ public final void clampMin(float min) } - /** - * Clamps the maximum value of this tuple to the max parameter. - * @param max the highest value in the tuple after clamping - */ public final void clampMax(float max) { if( x > max ) x=max; @@ -575,9 +462,6 @@ public final void clampMax(float max) } - /** - * Sets each component of this tuple to its absolute value. - */ public final void absolute() { x = Math.abs(x); @@ -587,13 +471,6 @@ public final void absolute() } - /** - * Linearly interpolates between tuples t1 and t2 and places the - * result into this tuple: this = (1-alpha)*t1 + alpha*t2. - * @param t1 the first tuple - * @param t2 the second tuple - * @param alpha the alpha interpolation parameter - */ public final void interpolate(Tuple3f t1, Tuple3f t2, float alpha) { this.x = (1-alpha)*t1.x + alpha*t2.x; @@ -604,12 +481,6 @@ public final void interpolate(Tuple3f t1, Tuple3f t2, float alpha) } - /** - * Linearly interpolates between this tuple and tuple t1 and - * places the result into this tuple: this = (1-alpha)*this + alpha*t1. - * @param t1 the first tuple - * @param alpha the alpha interpolation parameter - */ public final void interpolate(Tuple3f t1, float alpha) { this.x = (1-alpha)*this.x + alpha*t1.x;