summaryrefslogtreecommitdiffstats
path: root/src/javax/vecmath/Tuple3f.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/javax/vecmath/Tuple3f.java')
-rw-r--r--src/javax/vecmath/Tuple3f.java192
1 files changed, 96 insertions, 96 deletions
diff --git a/src/javax/vecmath/Tuple3f.java b/src/javax/vecmath/Tuple3f.java
index 9ca6940..3eb9fe3 100644
--- a/src/javax/vecmath/Tuple3f.java
+++ b/src/javax/vecmath/Tuple3f.java
@@ -34,7 +34,7 @@ package javax.vecmath;
import java.lang.Math;
/**
- * A generic 3-element tuple that is represented by single precision-floating
+ * A generic 3-element tuple that is represented by single precision-floating
* point x,y,z coordinates.
*
*/
@@ -123,7 +123,7 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
* Returns a string that contains the values of this Tuple3f.
* The form is (x,y,z).
* @return the String representation
- */
+ */
public String toString() {
return "(" + this.x + ", " + this.y + ", " + this.z + ")";
}
@@ -180,9 +180,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
}
- /**
+ /**
* 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
+ * @param t the array of length 3 into which the values are copied
*/
public final void get(float[] t)
{
@@ -197,7 +197,7 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
* @param t the Tuple3f object into which the values of this object are copied
*/
public final void get(Tuple3f t)
- {
+ {
t.x = this.x;
t.y = this.y;
t.z = this.z;
@@ -217,10 +217,10 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
}
- /**
+ /**
* 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;
@@ -243,13 +243,13 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
}
- /**
+ /**
* 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;
this.y -= t1.y;
this.z -= t1.z;
@@ -342,7 +342,7 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
* this Tuple3f.
* @param t1 the vector with which the comparison is made
* @return true or false
- */
+ */
public boolean equals(Tuple3f t1)
{
try {
@@ -356,7 +356,7 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
* this Tuple3f.
* @param t1 the Object with which the comparison is made
* @return true or false
- */
+ */
public boolean equals(Object t1)
{
try {
@@ -370,11 +370,11 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Returns true if the L-infinite distance between this tuple
- * and tuple t1 is less than or equal to the epsilon parameter,
+ * 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)].
* @param t1 the tuple to be compared to this tuple
- * @param epsilon the threshold value
+ * @param epsilon the threshold value
* @return true or false
*/
public boolean epsilonEquals(Tuple3f t1, float epsilon)
@@ -405,7 +405,7 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
* code value. Two objects with different data members may return the
* same hash value, although this is not likely.
* @return the integer hash code value
- */
+ */
public int hashCode() {
long bits = 1L;
bits = 31L * bits + (long)VecMathUtil.floatToIntBits(x);
@@ -415,16 +415,16 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
}
-
- /**
- * 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
+
+ /**
+ * 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)
- {
+ */
+ public final void clamp(float min, float max, Tuple3f t)
+ {
if( t.x > max ) {
x = max;
} else if( t.x < min ){
@@ -432,7 +432,7 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
} else {
x = t.x;
}
-
+
if( t.y > max ) {
y = max;
} else if( t.y < min ){
@@ -449,72 +449,72 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
z = t.z;
}
- }
-
-
- /**
- * 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
+ }
+
+
+ /**
+ * 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)
- {
+ */
+ public final void clampMin(float min, Tuple3f t)
+ {
if( t.x < min ) {
x = min;
} else {
x = t.x;
}
-
+
if( t.y < min ) {
y = min;
} else {
y = t.y;
}
-
+
if( t.z < min ) {
z = min;
} else {
z = t.z;
}
- }
-
-
- /**
- * 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
+ }
+
+
+ /**
+ * 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)
- {
+ */
+ public final void clampMax(float max, Tuple3f t)
+ {
if( t.x > max ) {
x = max;
} else {
x = t.x;
}
-
+
if( t.y > max ) {
y = max;
} else {
y = t.y;
}
-
+
if( t.z > max ) {
z = max;
} else {
z = t.z;
}
- }
-
-
- /**
+ }
+
+
+ /**
* 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);
@@ -536,13 +536,13 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
} else if( x < min ){
x = min;
}
-
+
if( y > max ) {
y = max;
} else if( y < min ){
y = min;
}
-
+
if( z > max ) {
z = max;
} else if( z < min ){
@@ -551,26 +551,26 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
}
-
+
/**
* 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;
if( y < min ) y=min;
if( z < min ) z=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;
if( y > max ) y=max;
if( z > max ) z=max;
@@ -590,38 +590,38 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
}
- /**
- * Linearly interpolates between tuples t1 and t2 and places the
+ /**
+ * 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)
- {
+ * @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;
this.y = (1-alpha)*t1.y + alpha*t2.y;
this.z = (1-alpha)*t1.z + alpha*t2.z;
-
-
- }
-
-
- /**
- * 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)
- {
+
+
+ }
+
+
+ /**
+ * 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;
this.y = (1-alpha)*this.y + alpha*t1.y;
this.z = (1-alpha)*this.z + alpha*t1.z;
- }
-
+ }
+
/**
* Creates a new object of the same class as this object.
*
@@ -643,9 +643,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Get the <i>x</i> coordinate.
- *
+ *
* @return the <i>x</i> coordinate.
- *
+ *
* @since vecmath 1.5
*/
public final float getX() {
@@ -655,9 +655,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Set the <i>x</i> coordinate.
- *
+ *
* @param x value to <i>x</i> coordinate.
- *
+ *
* @since vecmath 1.5
*/
public final void setX(float x) {
@@ -667,9 +667,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Get the <i>y</i> coordinate.
- *
+ *
* @return the <i>y</i> coordinate.
- *
+ *
* @since vecmath 1.5
*/
public final float getY() {
@@ -679,9 +679,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Set the <i>y</i> coordinate.
- *
+ *
* @param y value to <i>y</i> coordinate.
- *
+ *
* @since vecmath 1.5
*/
public final void setY(float y) {
@@ -690,9 +690,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Get the <i>z</i> coordinate.
- *
+ *
* @return the <i>z</i> coordinate
- *
+ *
* @since vecmath 1.5
*/
public final float getZ() {
@@ -702,9 +702,9 @@ public abstract class Tuple3f implements java.io.Serializable, Cloneable {
/**
* Set the <i>Z</i> coordinate.
- *
+ *
* @param z value to <i>z</i> coordinate.
- *
+ *
* @since vecmath 1.5
*/
public final void setZ(float z) {