summaryrefslogtreecommitdiffstats
path: root/src/javax/vecmath/Matrix4d.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/javax/vecmath/Matrix4d.java')
-rw-r--r--src/javax/vecmath/Matrix4d.java1056
1 files changed, 528 insertions, 528 deletions
diff --git a/src/javax/vecmath/Matrix4d.java b/src/javax/vecmath/Matrix4d.java
index 66dc806..c9771eb 100644
--- a/src/javax/vecmath/Matrix4d.java
+++ b/src/javax/vecmath/Matrix4d.java
@@ -128,7 +128,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
double[] tmp_scale = new double[3]; // scratch matrix
*/
private static final double EPS = 1.0E-10;
-
+
/**
* Constructs and initializes a Matrix4d from the specified 16 values.
@@ -215,7 +215,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param s the scale value applied to the rotational components
*/
public Matrix4d(Quat4d q1, Vector3d t1, double s)
- {
+ {
m00 = s*(1.0 - 2.0*q1.y*q1.y - 2.0*q1.z*q1.z);
m10 = s*(2.0*(q1.x*q1.y + q1.w*q1.z));
m20 = s*(2.0*(q1.x*q1.z - q1.w*q1.y));
@@ -239,15 +239,15 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
- /**
+ /**
* Constructs and initializes a Matrix4d from the quaternion,
- * translation, and scale values; the scale is applied only to the
- * rotational components of the matrix (upper 3x3) and not to the
- * translational components.
- * @param q1 the quaternion value representing the rotational component
- * @param t1 the translational component of the matrix
- * @param s the scale value applied to the rotational components
- */
+ * translation, and scale values; the scale is applied only to the
+ * rotational components of the matrix (upper 3x3) and not to the
+ * translational components.
+ * @param q1 the quaternion value representing the rotational component
+ * @param t1 the translational component of the matrix
+ * @param s the scale value applied to the rotational components
+ */
public Matrix4d(Quat4f q1, Vector3d t1, double s)
{
m00 = s*(1.0 - 2.0*q1.y*q1.y - 2.0*q1.z*q1.z);
@@ -274,7 +274,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
/**
- * Constructs a new matrix with the same values as the
+ * Constructs a new matrix with the same values as the
* Matrix4d parameter.
* @param m1 the source matrix
*/
@@ -303,31 +303,31 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
/**
- * Constructs a new matrix with the same values as the
+ * Constructs a new matrix with the same values as the
* Matrix4f parameter.
* @param m1 the source matrix
*/
public Matrix4d(Matrix4f m1)
{
- this.m00 = m1.m00;
- this.m01 = m1.m01;
- this.m02 = m1.m02;
- this.m03 = m1.m03;
-
+ this.m00 = m1.m00;
+ this.m01 = m1.m01;
+ this.m02 = m1.m02;
+ this.m03 = m1.m03;
+
this.m10 = m1.m10;
- this.m11 = m1.m11;
- this.m12 = m1.m12;
- this.m13 = m1.m13;
-
- this.m20 = m1.m20;
- this.m21 = m1.m21;
- this.m22 = m1.m22;
- this.m23 = m1.m23;
-
- this.m30 = m1.m30;
- this.m31 = m1.m31;
- this.m32 = m1.m32;
- this.m33 = m1.m33;
+ this.m11 = m1.m11;
+ this.m12 = m1.m12;
+ this.m13 = m1.m13;
+
+ this.m20 = m1.m20;
+ this.m21 = m1.m21;
+ this.m22 = m1.m22;
+ this.m23 = m1.m23;
+
+ this.m30 = m1.m30;
+ this.m31 = m1.m31;
+ this.m32 = m1.m32;
+ this.m33 = m1.m33;
}
@@ -342,29 +342,29 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
*/
public Matrix4d(Matrix3f m1, Vector3d t1, double s)
{
- this.m00 = m1.m00*s;
- this.m01 = m1.m01*s;
- this.m02 = m1.m02*s;
- this.m03 = t1.x;
-
- this.m10 = m1.m10*s;
- this.m11 = m1.m11*s;
- this.m12 = m1.m12*s;
- this.m13 = t1.y;
-
- this.m20 = m1.m20*s;
- this.m21 = m1.m21*s;
- this.m22 = m1.m22*s;
- this.m23 = t1.z;
-
- this.m30 = 0.0;
- this.m31 = 0.0;
- this.m32 = 0.0;
- this.m33 = 1.0;
-
- }
-
- /**
+ this.m00 = m1.m00*s;
+ this.m01 = m1.m01*s;
+ this.m02 = m1.m02*s;
+ this.m03 = t1.x;
+
+ this.m10 = m1.m10*s;
+ this.m11 = m1.m11*s;
+ this.m12 = m1.m12*s;
+ this.m13 = t1.y;
+
+ this.m20 = m1.m20*s;
+ this.m21 = m1.m21*s;
+ this.m22 = m1.m22*s;
+ this.m23 = t1.z;
+
+ this.m30 = 0.0;
+ this.m31 = 0.0;
+ this.m32 = 0.0;
+ this.m33 = 1.0;
+
+ }
+
+ /**
* Constructs and initializes a Matrix4f from the rotation matrix,
* translation, and scale values; the scale is applied only to the
* rotational components of the matrix (upper 3x3) and not to the
@@ -372,28 +372,28 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param m1 the rotation matrix representing the rotational components
* @param t1 the translational components of the matrix
* @param s the scale value applied to the rotational components
- */
+ */
public Matrix4d(Matrix3d m1, Vector3d t1, double s)
{
- this.m00 = m1.m00*s;
- this.m01 = m1.m01*s;
- this.m02 = m1.m02*s;
- this.m03 = t1.x;
-
- this.m10 = m1.m10*s;
- this.m11 = m1.m11*s;
- this.m12 = m1.m12*s;
- this.m13 = t1.y;
-
- this.m20 = m1.m20*s;
- this.m21 = m1.m21*s;
- this.m22 = m1.m22*s;
- this.m23 = t1.z;
-
- this.m30 = 0.0;
- this.m31 = 0.0;
- this.m32 = 0.0;
- this.m33 = 1.0;
+ this.m00 = m1.m00*s;
+ this.m01 = m1.m01*s;
+ this.m02 = m1.m02*s;
+ this.m03 = t1.x;
+
+ this.m10 = m1.m10*s;
+ this.m11 = m1.m11*s;
+ this.m12 = m1.m12*s;
+ this.m13 = t1.y;
+
+ this.m20 = m1.m20*s;
+ this.m21 = m1.m21*s;
+ this.m22 = m1.m22*s;
+ this.m23 = t1.z;
+
+ this.m30 = 0.0;
+ this.m31 = 0.0;
+ this.m32 = 0.0;
+ this.m33 = 1.0;
}
@@ -427,7 +427,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Returns a string that contains the values of this Matrix4d.
* @return the String representation
- */
+ */
public String toString() {
return
this.m00 + ", " + this.m01 + ", " + this.m02 + ", " + this.m03 + "\n" +
@@ -470,7 +470,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
*/
public final void setElement(int row, int column, double value)
{
- switch (row)
+ switch (row)
{
case 0:
switch(column)
@@ -493,7 +493,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
break;
case 1:
- switch(column)
+ switch(column)
{
case 0:
this.m10 = value;
@@ -513,7 +513,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
break;
case 2:
- switch(column)
+ switch(column)
{
case 0:
this.m20 = value;
@@ -533,7 +533,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
break;
case 3:
- switch(column)
+ switch(column)
{
case 0:
this.m30 = value;
@@ -565,7 +565,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
*/
public final double getElement(int row, int column)
{
- switch (row)
+ switch (row)
{
case 0:
switch(column)
@@ -583,7 +583,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
break;
case 1:
- switch(column)
+ switch(column)
{
case 0:
return(this.m10);
@@ -597,9 +597,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
break;
}
break;
-
+
case 2:
- switch(column)
+ switch(column)
{
case 0:
return(this.m20);
@@ -613,9 +613,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
break;
}
break;
-
+
case 3:
- switch(column)
+ switch(column)
{
case 0:
return(this.m30);
@@ -629,21 +629,21 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
break;
}
break;
-
+
default:
break;
}
throw new ArrayIndexOutOfBoundsException(VecMathI18N.getString("Matrix4d1"));
}
- /**
- * Copies the matrix values in the specified row into the vector parameter.
- * @param row the matrix row
- * @param v the vector into which the matrix row values will be copied
- */
+ /**
+ * Copies the matrix values in the specified row into the vector parameter.
+ * @param row the matrix row
+ * @param v the vector into which the matrix row values will be copied
+ */
public final void getRow(int row, Vector4d v) {
if( row == 0 ) {
- v.x = m00;
+ v.x = m00;
v.y = m01;
v.z = m02;
v.w = m03;
@@ -665,15 +665,15 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
} else {
throw new ArrayIndexOutOfBoundsException(VecMathI18N.getString("Matrix4d2"));
}
- }
-
-
- /**
+ }
+
+
+ /**
* Copies the matrix values in the specified row into the array parameter.
- * @param row the matrix row
- * @param v the array into which the matrix row values will be copied
- */
- public final void getRow(int row, double v[]) {
+ * @param row the matrix row
+ * @param v the array into which the matrix row values will be copied
+ */
+ public final void getRow(int row, double v[]) {
if( row == 0 ) {
v[0] = m00;
v[1] = m01;
@@ -699,33 +699,33 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
throw new ArrayIndexOutOfBoundsException(VecMathI18N.getString("Matrix4d2"));
}
}
-
-
-
- /**
- * Copies the matrix values in the specified column into the vector
+
+
+
+ /**
+ * Copies the matrix values in the specified column into the vector
* parameter.
* @param column the matrix column
- * @param v the vector into which the matrix column values will be copied
- */
- public final void getColumn(int column, Vector4d v) {
+ * @param v the vector into which the matrix column values will be copied
+ */
+ public final void getColumn(int column, Vector4d v) {
if( column == 0 ) {
- v.x = m00;
+ v.x = m00;
v.y = m10;
v.z = m20;
v.w = m30;
} else if(column == 1) {
- v.x = m01;
+ v.x = m01;
v.y = m11;
v.z = m21;
v.w = m31;
} else if(column == 2) {
- v.x = m02;
+ v.x = m02;
v.y = m12;
v.z = m22;
v.w = m32;
} else if(column == 3) {
- v.x = m03;
+ v.x = m03;
v.y = m13;
v.z = m23;
v.w = m33;
@@ -734,16 +734,16 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
- }
-
-
-
- /**
- * Copies the matrix values in the specified column into the array
- * parameter.
+ }
+
+
+
+ /**
+ * Copies the matrix values in the specified column into the array
+ * parameter.
* @param column the matrix column
- * @param v the array into which the matrix column values will be copied
- */
+ * @param v the array into which the matrix column values will be copied
+ */
public final void getColumn(int column, double v[]) {
if( column == 0 ) {
v[0] = m00;
@@ -770,18 +770,18 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
- }
-
+ }
+
- /**
+ /**
* Performs an SVD normalization of this matrix in order to acquire
* the normalized rotational component; the values are placed into
* the Matrix3d parameter.
* @param m1 the matrix into which the rotational component is placed
- */
+ */
public final void get(Matrix3d m1)
{
-
+
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
@@ -797,21 +797,21 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m1.m20 = tmp_rot[6];
m1.m21 = tmp_rot[7];
m1.m22 = tmp_rot[8];
-
+
}
-
- /**
- * Performs an SVD normalization of this matrix in order to acquire
- * the normalized rotational component; the values are placed into
- * the Matrix3f parameter.
- * @param m1 the matrix into which the rotational component is placed
- */
- public final void get(Matrix3f m1)
+
+ /**
+ * Performs an SVD normalization of this matrix in order to acquire
+ * the normalized rotational component; the values are placed into
+ * the Matrix3f parameter.
+ * @param m1 the matrix into which the rotational component is placed
+ */
+ public final void get(Matrix3f m1)
{
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
-
+
getScaleRotate( tmp_scale, tmp_rot );
m1.m00 = (float)tmp_rot[0];
@@ -825,7 +825,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m1.m20 = (float)tmp_rot[6];
m1.m21 = (float)tmp_rot[7];
m1.m22 = (float)tmp_rot[8];
- }
+ }
/**
* Performs an SVD normalization of this matrix to calculate
@@ -834,10 +834,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param m1 the normalized matrix representing the rotation
* @param t1 the translation component
* @return the scale component of this transform
- */
+ */
public final double get(Matrix3d m1, Vector3d t1)
- {
-
+ {
+
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
@@ -859,19 +859,19 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
t1.z = m23;
return( Matrix3d.max3( tmp_scale ));
-
+
}
- /**
+ /**
* Performs an SVD normalization of this matrix to calculate
* the rotation as a 3x3 matrix, the translation, and the scale.
* None of the matrix values are modified.
* @param m1 the normalized matrix representing the rotation
* @param t1 the translation component
* @return the scale component of this transform
- */
+ */
public final double get(Matrix3f m1, Vector3d t1){
-
+
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
@@ -893,15 +893,15 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
t1.z = m23;
return( Matrix3d.max3( tmp_scale ));
-
- }
+
+ }
/**
* Performs an SVD normalization of this matrix in order to acquire
* the normalized rotational component; the values are placed into
* the Quat4f parameter.
* @param q1 quaternion into which the rotation component is placed
- */
+ */
public final void get(Quat4f q1)
{
@@ -909,12 +909,12 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
- double ww;
+ double ww;
ww = 0.25*(1.0 + tmp_rot[0] + tmp_rot[4] + tmp_rot[8]);
if(!((ww<0?-ww:ww) < 1.0e-30)) {
q1.w = (float)Math.sqrt(ww);
- ww = 0.25/q1.w;
+ ww = 0.25/q1.w;
q1.x = (float)((tmp_rot[7] - tmp_rot[5])*ww);
q1.y = (float)((tmp_rot[2] - tmp_rot[6])*ww);
q1.z = (float)((tmp_rot[3] - tmp_rot[1])*ww);
@@ -925,7 +925,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
ww = -0.5*(tmp_rot[4] + tmp_rot[8]);
if(!((ww<0?-ww:ww) < 1.0e-30)) {
q1.x = (float)Math.sqrt(ww);
- ww = 0.5/q1.x;
+ ww = 0.5/q1.x;
q1.y = (float)(tmp_rot[3]*ww);
q1.z = (float)(tmp_rot[6]*ww);
return;
@@ -938,31 +938,31 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
q1.z = (float)(tmp_rot[7]/(2.0*q1.y));
return;
}
-
+
q1.y = 0.0f;
q1.z = 1.0f;
}
- /**
- * Performs an SVD normalization of q1 matrix in order to acquire
- * the normalized rotational component; the values are placed into
- * the Quat4d parameter.
- * @param q1 the quaternion into which the rotation component is placed
- */
- public final void get(Quat4d q1)
- {
+ /**
+ * Performs an SVD normalization of q1 matrix in order to acquire
+ * the normalized rotational component; the values are placed into
+ * the Quat4d parameter.
+ * @param q1 the quaternion into which the rotation component is placed
+ */
+ public final void get(Quat4d q1)
+ {
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
-
+
getScaleRotate( tmp_scale, tmp_rot );
- double ww;
+ double ww;
ww = 0.25*(1.0 + tmp_rot[0] + tmp_rot[4] + tmp_rot[8]);
if(!((ww<0?-ww:ww) < 1.0e-30)) {
q1.w = Math.sqrt(ww);
- ww = 0.25/q1.w;
+ ww = 0.25/q1.w;
q1.x = (tmp_rot[7] - tmp_rot[5])*ww;
q1.y = (tmp_rot[2] - tmp_rot[6])*ww;
q1.z = (tmp_rot[3] - tmp_rot[1])*ww;
@@ -973,7 +973,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
ww = -0.5*(tmp_rot[4] + tmp_rot[8]);
if(!((ww<0?-ww:ww) < 1.0e-30)) {
q1.x = Math.sqrt(ww);
- ww = 0.5/q1.x;
+ ww = 0.5/q1.x;
q1.y = tmp_rot[3]*ww;
q1.z = tmp_rot[6]*ww;
return;
@@ -986,15 +986,15 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
q1.z = tmp_rot[7]/(2.0*q1.y);
return;
}
-
+
q1.y = 0.0;
q1.z = 1.0;
- }
+ }
/**
* Retrieves the translational components of this matrix.
* @param trans the vector that will receive the translational component
- */
+ */
public final void get(Vector3d trans)
{
trans.x = m03;
@@ -1014,28 +1014,28 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m1.m20 = (float)m20; m1.m21 = (float)m21; m1.m22 = (float)m22;
}
- /**
- * Gets the upper 3x3 values of this matrix and places them into
- * the matrix m1.
- * @param m1 the matrix that will hold the values
+ /**
+ * Gets the upper 3x3 values of this matrix and places them into
+ * the matrix m1.
+ * @param m1 the matrix that will hold the values
*/
public final void getRotationScale(Matrix3d m1)
- {
- m1.m00 = m00; m1.m01 = m01; m1.m02 = m02;
- m1.m10 = m10; m1.m11 = m11; m1.m12 = m12;
- m1.m20 = m20; m1.m21 = m21; m1.m22 = m22;
- }
+ {
+ m1.m00 = m00; m1.m01 = m01; m1.m02 = m02;
+ m1.m10 = m10; m1.m11 = m11; m1.m12 = m12;
+ m1.m20 = m20; m1.m21 = m21; m1.m22 = m22;
+ }
/**
* Performs an SVD normalization of this matrix to calculate
- * and return the uniform scale factor. If the matrix has non-uniform
- * scale factors, the largest of the x, y, and z scale factors will
+ * and return the uniform scale factor. If the matrix has non-uniform
+ * scale factors, the largest of the x, y, and z scale factors will
* be returned. This matrix is not modified.
* @return the scale factor of this matrix
- */
+ */
public final double getScale()
{
-
+
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
@@ -1056,17 +1056,17 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m20 = m1.m20; m21 = m1.m21; m22 = m1.m22;
}
- /**
- * Replaces the upper 3x3 matrix values of this matrix with the
- * values in the matrix m1.
- * @param m1 the matrix that will be the new upper 3x3
- */
- public final void setRotationScale(Matrix3f m1)
- {
- m00 = m1.m00; m01 = m1.m01; m02 = m1.m02;
- m10 = m1.m10; m11 = m1.m11; m12 = m1.m12;
- m20 = m1.m20; m21 = m1.m21; m22 = m1.m22;
- }
+ /**
+ * Replaces the upper 3x3 matrix values of this matrix with the
+ * values in the matrix m1.
+ * @param m1 the matrix that will be the new upper 3x3
+ */
+ public final void setRotationScale(Matrix3f m1)
+ {
+ m00 = m1.m00; m01 = m1.m01; m02 = m1.m02;
+ m10 = m1.m10; m11 = m1.m11; m12 = m1.m12;
+ m20 = m1.m20; m21 = m1.m21; m22 = m1.m22;
+ }
/**
* Sets the scale component of the current matrix by factoring
@@ -1078,7 +1078,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
{
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
-
+
getScaleRotate( tmp_scale, tmp_rot );
m00 = tmp_rot[0]*scale;
@@ -1134,7 +1134,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
this.m33 = w;
break;
- default:
+ default:
throw new ArrayIndexOutOfBoundsException(VecMathI18N.getString("Matrix4d4"));
}
@@ -1351,7 +1351,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Adds a scalar to each component of this matrix.
* @param scalar the scalar adder
- */
+ */
public final void add(double scalar)
{
m00 += scalar;
@@ -1377,25 +1377,25 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* the result into this. Matrix m1 is not modified.
* @param scalar the scalar adder
* @param m1 the original matrix values
- */
+ */
public final void add(double scalar, Matrix4d m1)
{
- this.m00 = m1.m00 + scalar;
- this.m01 = m1.m01 + scalar;
- this.m02 = m1.m02 + scalar;
- this.m03 = m1.m03 + scalar;
- this.m10 = m1.m10 + scalar;
- this.m11 = m1.m11 + scalar;
- this.m12 = m1.m12 + scalar;
- this.m13 = m1.m13 + scalar;
- this.m20 = m1.m20 + scalar;
- this.m21 = m1.m21 + scalar;
- this.m22 = m1.m22 + scalar;
- this.m23 = m1.m23 + scalar;
- this.m30 = m1.m30 + scalar;
- this.m31 = m1.m31 + scalar;
- this.m32 = m1.m32 + scalar;
- this.m33 = m1.m33 + scalar;
+ this.m00 = m1.m00 + scalar;
+ this.m01 = m1.m01 + scalar;
+ this.m02 = m1.m02 + scalar;
+ this.m03 = m1.m03 + scalar;
+ this.m10 = m1.m10 + scalar;
+ this.m11 = m1.m11 + scalar;
+ this.m12 = m1.m12 + scalar;
+ this.m13 = m1.m13 + scalar;
+ this.m20 = m1.m20 + scalar;
+ this.m21 = m1.m21 + scalar;
+ this.m22 = m1.m22 + scalar;
+ this.m23 = m1.m23 + scalar;
+ this.m30 = m1.m30 + scalar;
+ this.m31 = m1.m31 + scalar;
+ this.m32 = m1.m32 + scalar;
+ this.m33 = m1.m33 + scalar;
}
/**
@@ -1431,27 +1431,27 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param m1 the other matrix
*/
public final void add(Matrix4d m1)
- {
+ {
this.m00 += m1.m00;
this.m01 += m1.m01;
this.m02 += m1.m02;
this.m03 += m1.m03;
-
+
this.m10 += m1.m10;
this.m11 += m1.m11;
this.m12 += m1.m12;
this.m13 += m1.m13;
-
+
this.m20 += m1.m20;
this.m21 += m1.m21;
this.m22 += m1.m22;
this.m23 += m1.m23;
-
+
this.m30 += m1.m30;
this.m31 += m1.m31;
this.m32 += m1.m32;
this.m33 += m1.m33;
- }
+ }
/**
* Sets the value of this matrix to the matrix difference
@@ -1482,34 +1482,34 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
this.m33 = m1.m33 - m2.m33;
}
-
+
/**
* Sets the value of this matrix to the matrix difference of itself
* and matrix m1 (this = this - m1).
* @param m1 the other matrix
*/
public final void sub(Matrix4d m1)
- {
+ {
this.m00 -= m1.m00;
this.m01 -= m1.m01;
this.m02 -= m1.m02;
this.m03 -= m1.m03;
-
+
this.m10 -= m1.m10;
this.m11 -= m1.m11;
this.m12 -= m1.m12;
this.m13 -= m1.m13;
-
+
this.m20 -= m1.m20;
this.m21 -= m1.m21;
this.m22 -= m1.m22;
this.m23 -= m1.m23;
-
+
this.m30 -= m1.m30;
this.m31 -= m1.m31;
this.m32 -= m1.m32;
this.m33 -= m1.m33;
- }
+ }
/**
* Sets the value of this matrix to its transpose.
@@ -1599,13 +1599,13 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m33 = m[15];
}
- /**
+ /**
* Sets the rotational component (upper 3x3) of this matrix to the
* matrix values in the single precision Matrix3f argument; the other
* elements of this matrix are initialized as if this were an identity
* matrix (i.e., affine matrix with no translational component).
* @param m1 the double precision 3x3 matrix
- */
+ */
public final void set(Matrix3f m1)
{
m00 = m1.m00; m01 = m1.m01; m02 = m1.m02; m03 = 0.0;
@@ -1614,20 +1614,20 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m30 = 0.0; m31 = 0.0 ; m32 = 0.0 ; m33 = 1.0;
}
- /**
- * Sets the rotational component (upper 3x3) of this matrix to the
- * matrix values in the double precision Matrix3d argument; the other
- * elements of this matrix are initialized as if this were an identity
+ /**
+ * Sets the rotational component (upper 3x3) of this matrix to the
+ * matrix values in the double precision Matrix3d argument; the other
+ * elements of this matrix are initialized as if this were an identity
* matrix (i.e., affine matrix with no translational component).
- * @param m1 the double precision 3x3 matrix
- */
- public final void set(Matrix3d m1)
+ * @param m1 the double precision 3x3 matrix
+ */
+ public final void set(Matrix3d m1)
{
m00 = m1.m00; m01 = m1.m01; m02 = m1.m02; m03 = 0.0;
m10 = m1.m10; m11 = m1.m11; m12 = m1.m12; m13 = 0.0;
m20 = m1.m20; m21 = m1.m21; m22 = m1.m22; m23 = 0.0;
m30 = 0.0; m31 = 0.0 ; m32 = 0.0 ; m33 = 1.0;
- }
+ }
/**
* Sets the value of this matrix to the matrix conversion of the
@@ -1688,11 +1688,11 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
double sinTheta = Math.sin(a1.angle);
double cosTheta = Math.cos(a1.angle);
double t = 1.0 - cosTheta;
-
+
double xz = ax * az;
double xy = ax * ay;
double yz = ay * az;
-
+
m00 = t * ax * ax + cosTheta;
m01 = t * xy - sinTheta * az;
m02 = t * xz + sinTheta * ay;
@@ -1802,7 +1802,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m33 = 1.0;
}
- /**
+ /**
* Sets the value of this matrix from the rotation expressed
* by the quaternion q1, the translation t1, and the scale s.
* @param q1 the rotation expressed as a quaternion
@@ -1810,23 +1810,23 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param s the scale value
*/
public final void set(Quat4d q1, Vector3d t1, double s)
- {
+ {
this.m00 = s*(1.0 - 2.0*q1.y*q1.y - 2.0*q1.z*q1.z);
this.m10 = s*(2.0*(q1.x*q1.y + q1.w*q1.z));
this.m20 = s*(2.0*(q1.x*q1.z - q1.w*q1.y));
-
+
this.m01 = s*(2.0*(q1.x*q1.y - q1.w*q1.z));
this.m11 = s*(1.0 - 2.0*q1.x*q1.x - 2.0*q1.z*q1.z);
this.m21 = s*(2.0*(q1.y*q1.z + q1.w*q1.x));
-
+
this.m02 = s*(2.0*(q1.x*q1.z + q1.w*q1.y));
this.m12 = s*(2.0*(q1.y*q1.z - q1.w*q1.x));
this.m22 = s*(1.0 - 2.0*q1.x*q1.x - 2.0*q1.y*q1.y);
-
+
this.m03 = t1.x;
this.m13 = t1.y;
this.m23 = t1.z;
-
+
this.m30 = 0.0;
this.m31 = 0.0;
this.m32 = 0.0;
@@ -1839,7 +1839,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param q1 the rotation expressed as a quaternion
* @param t1 the translation
* @param s the scale value
- */
+ */
public final void set(Quat4f q1, Vector3d t1, double s)
{
this.m00 = s*(1.0 - 2.0*q1.y*q1.y - 2.0*q1.z*q1.z);
@@ -1870,7 +1870,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param q1 the rotation expressed as a quaternion
* @param t1 the translation
* @param s the scale value
- */
+ */
public final void set(Quat4f q1, Vector3f t1, float s)
{
this.m00 = s*(1.0 - 2.0*q1.y*q1.y - 2.0*q1.z*q1.z);
@@ -1898,7 +1898,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Sets the value of this matrix to a copy of the
* passed matrix m1.
- * @param m1 the matrix4f
+ * @param m1 the matrix4f
*/
public final void set(Matrix4f m1)
{
@@ -1959,7 +1959,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
public final void invert(Matrix4d m1)
{
- invertGeneral( m1);
+ invertGeneral( m1);
}
/**
@@ -1967,7 +1967,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
*/
public final void invert()
{
- invertGeneral( this );
+ invertGeneral( this );
}
/**
@@ -1986,34 +1986,34 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
// Use LU decomposition and backsubstitution code specifically
// for floating-point 4x4 matrices.
double[] tmp = new double[16]; // scratch matrix
- // Copy source matrix to t1tmp
+ // Copy source matrix to t1tmp
tmp[0] = m1.m00;
tmp[1] = m1.m01;
tmp[2] = m1.m02;
tmp[3] = m1.m03;
-
+
tmp[4] = m1.m10;
tmp[5] = m1.m11;
tmp[6] = m1.m12;
tmp[7] = m1.m13;
-
+
tmp[8] = m1.m20;
tmp[9] = m1.m21;
tmp[10] = m1.m22;
tmp[11] = m1.m23;
-
+
tmp[12] = m1.m30;
tmp[13] = m1.m31;
tmp[14] = m1.m32;
tmp[15] = m1.m33;
- // Calculate LU decomposition: Is the matrix singular?
+ // Calculate LU decomposition: Is the matrix singular?
if (!luDecomposition(tmp, row_perm)) {
- // Matrix has no inverse
+ // Matrix has no inverse
throw new SingularMatrixException(VecMathI18N.getString("Matrix4d10"));
}
- // Perform back substitution on the identity matrix
+ // Perform back substitution on the identity matrix
for(i=0;i<16;i++) result[i] = 0.0;
result[0] = 1.0; result[5] = 1.0; result[10] = 1.0; result[15] = 1.0;
luBacksubstitution(tmp, row_perm, result);
@@ -2027,12 +2027,12 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
this.m11 = result[5];
this.m12 = result[6];
this.m13 = result[7];
-
+
this.m20 = result[8];
this.m21 = result[9];
this.m22 = result[10];
this.m23 = result[11];
-
+
this.m30 = result[12];
this.m31 = result[13];
this.m32 = result[14];
@@ -2041,13 +2041,13 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
/**
- * Given a 4x4 array "matrix0", this function replaces it with the
- * LU decomposition of a row-wise permutation of itself. The input
- * parameters are "matrix0" and "dimen". The array "matrix0" is also
- * an output parameter. The vector "row_perm[4]" is an output
- * parameter that contains the row permutations resulting from partial
- * pivoting. The output parameter "even_row_xchg" is 1 when the
- * number of row exchanges is even, or -1 otherwise. Assumes data
+ * Given a 4x4 array "matrix0", this function replaces it with the
+ * LU decomposition of a row-wise permutation of itself. The input
+ * parameters are "matrix0" and "dimen". The array "matrix0" is also
+ * an output parameter. The vector "row_perm[4]" is an output
+ * parameter that contains the row permutations resulting from partial
+ * pivoting. The output parameter "even_row_xchg" is 1 when the
+ * number of row exchanges is even, or -1 otherwise. Assumes data
* type is always double.
*
* This function is similar to luDecomposition, except that it
@@ -2056,8 +2056,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @return true if the matrix is nonsingular, or false otherwise.
*/
//
- // Reference: Press, Flannery, Teukolsky, Vetterling,
- // _Numerical_Recipes_in_C_, Cambridge University Press,
+ // Reference: Press, Flannery, Teukolsky, Vetterling,
+ // _Numerical_Recipes_in_C_, Cambridge University Press,
// 1988, pp 40-45.
//
static boolean luDecomposition(double[] matrix0,
@@ -2065,7 +2065,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
double row_scale[] = new double[4];
- // Determine implicit scaling information by looping over rows
+ // Determine implicit scaling information by looping over rows
{
int i, j;
int ptr, rs;
@@ -2074,12 +2074,12 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
ptr = 0;
rs = 0;
- // For each row ...
+ // For each row ...
i = 4;
while (i-- != 0) {
big = 0.0;
- // For each column, find the largest element in the row
+ // For each column, find the largest element in the row
j = 4;
while (j-- != 0) {
temp = matrix0[ptr++];
@@ -2089,7 +2089,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
}
- // Is the matrix singular?
+ // Is the matrix singular?
if (big == 0.0) {
return false;
}
@@ -2103,13 +2103,13 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
mtx = 0;
- // For all columns, execute Crout's method
+ // For all columns, execute Crout's method
for (j = 0; j < 4; j++) {
int i, imax, k;
int target, p1, p2;
double sum, big, temp;
- // Determine elements of upper diagonal matrix U
+ // Determine elements of upper diagonal matrix U
for (i = 0; i < j; i++) {
target = mtx + (4*i) + j;
sum = matrix0[target];
@@ -2141,7 +2141,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
matrix0[target] = sum;
- // Is this the best pivot so far?
+ // Is this the best pivot so far?
if ((temp = row_scale[i] * Math.abs(sum)) >= big) {
big = temp;
imax = i;
@@ -2152,9 +2152,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
throw new RuntimeException(VecMathI18N.getString("Matrix4d11"));
}
- // Is a row exchange necessary?
+ // Is a row exchange necessary?
if (j != imax) {
- // Yes: exchange rows
+ // Yes: exchange rows
k = 4;
p1 = mtx + (4*imax);
p2 = mtx + (4*j);
@@ -2164,19 +2164,19 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
matrix0[p2++] = temp;
}
- // Record change in scale factor
+ // Record change in scale factor
row_scale[imax] = row_scale[j];
}
- // Record row permutation
+ // Record row permutation
row_perm[j] = imax;
- // Is the matrix singular
+ // Is the matrix singular
if (matrix0[(mtx + (4*j) + j)] == 0.0) {
return false;
}
- // Divide elements of lower diagonal matrix L by pivot
+ // Divide elements of lower diagonal matrix L by pivot
if (j != (4-1)) {
temp = 1.0 / (matrix0[(mtx + (4*j) + j)]);
target = mtx + (4*(j+1)) + j;
@@ -2206,8 +2206,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* derived.
*/
//
- // Reference: Press, Flannery, Teukolsky, Vetterling,
- // _Numerical_Recipes_in_C_, Cambridge University Press,
+ // Reference: Press, Flannery, Teukolsky, Vetterling,
+ // _Numerical_Recipes_in_C_, Cambridge University Press,
// 1988, pp 44-45.
//
static void luBacksubstitution(double[] matrix1,
@@ -2217,17 +2217,17 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
int i, ii, ip, j, k;
int rp;
int cv, rv;
-
+
// rp = row_perm;
rp = 0;
- // For each column vector of matrix2 ...
+ // For each column vector of matrix2 ...
for (k = 0; k < 4; k++) {
// cv = &(matrix2[0][k]);
cv = k;
ii = -1;
- // Forward substitution
+ // Forward substitution
for (i = 0; i < 4; i++) {
double sum;
@@ -2247,7 +2247,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
matrix2[cv+4*i] = sum;
}
- // Backsubstitution
+ // Backsubstitution
// rv = &(matrix1[3][0]);
rv = 3*4;
matrix2[cv+4*3] /= matrix1[rv+3];
@@ -2271,21 +2271,21 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Computes the determinant of this matrix.
- * @return the determinant of the matrix
+ * @return the determinant of the matrix
*/
public final double determinant()
{
double det;
- // cofactor exapainsion along first row
+ // cofactor exapainsion along first row
- det = m00*(m11*m22*m33+ m12*m23*m31 + m13*m21*m32
+ det = m00*(m11*m22*m33+ m12*m23*m31 + m13*m21*m32
- m13*m22*m31 -m11*m23*m32 - m12*m21*m33);
- det -= m01*(m10*m22*m33+ m12*m23*m30 + m13*m20*m32
+ det -= m01*(m10*m22*m33+ m12*m23*m30 + m13*m20*m32
- m13*m22*m30 -m10*m23*m32 - m12*m20*m33);
- det += m02*(m10*m21*m33+ m11*m23*m30 + m13*m20*m31
+ det += m02*(m10*m21*m33+ m11*m23*m30 + m13*m20*m31
- m13*m21*m30 -m10*m23*m31 - m11*m20*m33);
- det -= m03*(m10*m21*m32+ m11*m22*m30 + m12*m20*m31
+ det -= m03*(m10*m21*m32+ m11*m22*m30 + m12*m20*m31
- m12*m21*m30 -m10*m22*m31 - m11*m20*m32);
return( det );
@@ -2416,7 +2416,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param scale the scale component
*/
public final void set(Matrix3f m1, Vector3f t1, float scale)
- {
+ {
this.m00 = m1.m00*scale;
this.m01 = m1.m01*scale;
this.m02 = m1.m02*scale;
@@ -2437,18 +2437,18 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
this.m32 = 0.0;
this.m33 = 1.0;
}
-
+
/**
- * Sets the value of this matrix from the rotation expressed by
+ * Sets the value of this matrix from the rotation expressed by
* the rotation matrix m1, the translation t1, and the scale factor.
- * The translation is not modified by the scale.
- * @param m1 the rotation component
+ * The translation is not modified by the scale.
+ * @param m1 the rotation component
* @param t1 the translation component
- * @param scale the scale component
- */
- public final void set(Matrix3d m1, Vector3d t1, double scale)
- {
+ * @param scale the scale component
+ */
+ public final void set(Matrix3d m1, Vector3d t1, double scale)
+ {
this.m00 = m1.m00*scale;
this.m01 = m1.m01*scale;
this.m02 = m1.m02*scale;
@@ -2468,23 +2468,23 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
this.m31 = 0.0;
this.m32 = 0.0;
this.m33 = 1.0;
- }
+ }
- /**
- * Modifies the translational components of this matrix to the values
- * of the Vector3d argument; the other values of this matrix are not
- * modified.
+ /**
+ * Modifies the translational components of this matrix to the values
+ * of the Vector3d argument; the other values of this matrix are not
+ * modified.
* @param trans the translational component
- */
- public final void setTranslation(Vector3d trans)
- {
- m03 = trans.x;
+ */
+ public final void setTranslation(Vector3d trans)
+ {
+ m03 = trans.x;
m13 = trans.y;
- m23 = trans.z;
- }
+ m23 = trans.z;
+ }
/**
- * Sets the value of this matrix to a counter-clockwise rotation
+ * Sets the value of this matrix to a counter-clockwise rotation
* about the x axis.
* @param angle the angle to rotate about the X axis in radians
*/
@@ -2517,7 +2517,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
/**
- * Sets the value of this matrix to a counter-clockwise rotation
+ * Sets the value of this matrix to a counter-clockwise rotation
* about the y axis.
* @param angle the angle to rotate about the Y axis in radians
*/
@@ -2550,7 +2550,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
/**
- * Sets the value of this matrix to a counter-clockwise rotation
+ * Sets the value of this matrix to a counter-clockwise rotation
* about the z axis.
* @param angle the angle to rotate about the Z axis in radians
*/
@@ -2611,7 +2611,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* the result into this. Matrix m1 is not modified.
* @param scalar the scalar multiplier
* @param m1 the original matrix
- */
+ */
public final void mul(double scalar, Matrix4d m1)
{
this.m00 = m1.m00 * scalar;
@@ -2637,47 +2637,47 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* with matrix m1.
* @param m1 the other matrix
*/
- public final void mul(Matrix4d m1)
+ public final void mul(Matrix4d m1)
{
double m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23,
- m30, m31, m32, m33; // vars for temp result matrix
+ m30, m31, m32, m33; // vars for temp result matrix
- m00 = this.m00*m1.m00 + this.m01*m1.m10 +
+ m00 = this.m00*m1.m00 + this.m01*m1.m10 +
this.m02*m1.m20 + this.m03*m1.m30;
- m01 = this.m00*m1.m01 + this.m01*m1.m11 +
+ m01 = this.m00*m1.m01 + this.m01*m1.m11 +
this.m02*m1.m21 + this.m03*m1.m31;
- m02 = this.m00*m1.m02 + this.m01*m1.m12 +
+ m02 = this.m00*m1.m02 + this.m01*m1.m12 +
this.m02*m1.m22 + this.m03*m1.m32;
- m03 = this.m00*m1.m03 + this.m01*m1.m13 +
+ m03 = this.m00*m1.m03 + this.m01*m1.m13 +
this.m02*m1.m23 + this.m03*m1.m33;
- m10 = this.m10*m1.m00 + this.m11*m1.m10 +
+ m10 = this.m10*m1.m00 + this.m11*m1.m10 +
this.m12*m1.m20 + this.m13*m1.m30;
- m11 = this.m10*m1.m01 + this.m11*m1.m11 +
+ m11 = this.m10*m1.m01 + this.m11*m1.m11 +
this.m12*m1.m21 + this.m13*m1.m31;
- m12 = this.m10*m1.m02 + this.m11*m1.m12 +
+ m12 = this.m10*m1.m02 + this.m11*m1.m12 +
this.m12*m1.m22 + this.m13*m1.m32;
- m13 = this.m10*m1.m03 + this.m11*m1.m13 +
+ m13 = this.m10*m1.m03 + this.m11*m1.m13 +
this.m12*m1.m23 + this.m13*m1.m33;
- m20 = this.m20*m1.m00 + this.m21*m1.m10 +
+ m20 = this.m20*m1.m00 + this.m21*m1.m10 +
this.m22*m1.m20 + this.m23*m1.m30;
- m21 = this.m20*m1.m01 + this.m21*m1.m11 +
+ m21 = this.m20*m1.m01 + this.m21*m1.m11 +
this.m22*m1.m21 + this.m23*m1.m31;
- m22 = this.m20*m1.m02 + this.m21*m1.m12 +
+ m22 = this.m20*m1.m02 + this.m21*m1.m12 +
this.m22*m1.m22 + this.m23*m1.m32;
- m23 = this.m20*m1.m03 + this.m21*m1.m13 +
+ m23 = this.m20*m1.m03 + this.m21*m1.m13 +
this.m22*m1.m23 + this.m23*m1.m33;
- m30 = this.m30*m1.m00 + this.m31*m1.m10 +
+ m30 = this.m30*m1.m00 + this.m31*m1.m10 +
this.m32*m1.m20 + this.m33*m1.m30;
- m31 = this.m30*m1.m01 + this.m31*m1.m11 +
+ m31 = this.m30*m1.m01 + this.m31*m1.m11 +
this.m32*m1.m21 + this.m33*m1.m31;
- m32 = this.m30*m1.m02 + this.m31*m1.m12 +
+ m32 = this.m30*m1.m02 + this.m31*m1.m12 +
this.m32*m1.m22 + this.m33*m1.m32;
- m33 = this.m30*m1.m03 + this.m31*m1.m13 +
+ m33 = this.m30*m1.m03 + this.m31*m1.m13 +
this.m32*m1.m23 + this.m33*m1.m33;
this.m00 = m00; this.m01 = m01; this.m02 = m02; this.m03 = m03;
@@ -2695,49 +2695,49 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
public final void mul(Matrix4d m1, Matrix4d m2)
{
if (this != m1 && this != m2) {
- // code for mat mul
- this.m00 = m1.m00*m2.m00 + m1.m01*m2.m10 +
+ // code for mat mul
+ this.m00 = m1.m00*m2.m00 + m1.m01*m2.m10 +
m1.m02*m2.m20 + m1.m03*m2.m30;
- this.m01 = m1.m00*m2.m01 + m1.m01*m2.m11 +
+ this.m01 = m1.m00*m2.m01 + m1.m01*m2.m11 +
m1.m02*m2.m21 + m1.m03*m2.m31;
- this.m02 = m1.m00*m2.m02 + m1.m01*m2.m12 +
+ this.m02 = m1.m00*m2.m02 + m1.m01*m2.m12 +
m1.m02*m2.m22 + m1.m03*m2.m32;
- this.m03 = m1.m00*m2.m03 + m1.m01*m2.m13 +
+ this.m03 = m1.m00*m2.m03 + m1.m01*m2.m13 +
m1.m02*m2.m23 + m1.m03*m2.m33;
- this.m10 = m1.m10*m2.m00 + m1.m11*m2.m10 +
+ this.m10 = m1.m10*m2.m00 + m1.m11*m2.m10 +
m1.m12*m2.m20 + m1.m13*m2.m30;
- this.m11 = m1.m10*m2.m01 + m1.m11*m2.m11 +
+ this.m11 = m1.m10*m2.m01 + m1.m11*m2.m11 +
m1.m12*m2.m21 + m1.m13*m2.m31;
- this.m12 = m1.m10*m2.m02 + m1.m11*m2.m12 +
+ this.m12 = m1.m10*m2.m02 + m1.m11*m2.m12 +
m1.m12*m2.m22 + m1.m13*m2.m32;
- this.m13 = m1.m10*m2.m03 + m1.m11*m2.m13 +
+ this.m13 = m1.m10*m2.m03 + m1.m11*m2.m13 +
m1.m12*m2.m23 + m1.m13*m2.m33;
- this.m20 = m1.m20*m2.m00 + m1.m21*m2.m10 +
+ this.m20 = m1.m20*m2.m00 + m1.m21*m2.m10 +
m1.m22*m2.m20 + m1.m23*m2.m30;
- this.m21 = m1.m20*m2.m01 + m1.m21*m2.m11 +
+ this.m21 = m1.m20*m2.m01 + m1.m21*m2.m11 +
m1.m22*m2.m21 + m1.m23*m2.m31;
- this.m22 = m1.m20*m2.m02 + m1.m21*m2.m12 +
+ this.m22 = m1.m20*m2.m02 + m1.m21*m2.m12 +
m1.m22*m2.m22 + m1.m23*m2.m32;
- this.m23 = m1.m20*m2.m03 + m1.m21*m2.m13 +
+ this.m23 = m1.m20*m2.m03 + m1.m21*m2.m13 +
m1.m22*m2.m23 + m1.m23*m2.m33;
- this.m30 = m1.m30*m2.m00 + m1.m31*m2.m10 +
+ this.m30 = m1.m30*m2.m00 + m1.m31*m2.m10 +
m1.m32*m2.m20 + m1.m33*m2.m30;
- this.m31 = m1.m30*m2.m01 + m1.m31*m2.m11 +
+ this.m31 = m1.m30*m2.m01 + m1.m31*m2.m11 +
m1.m32*m2.m21 + m1.m33*m2.m31;
- this.m32 = m1.m30*m2.m02 + m1.m31*m2.m12 +
+ this.m32 = m1.m30*m2.m02 + m1.m31*m2.m12 +
m1.m32*m2.m22 + m1.m33*m2.m32;
- this.m33 = m1.m30*m2.m03 + m1.m31*m2.m13 +
+ this.m33 = m1.m30*m2.m03 + m1.m31*m2.m13 +
m1.m32*m2.m23 + m1.m33*m2.m33;
} else {
double m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23,
- m30, m31, m32, m33; // vars for temp result matrix
+ m30, m31, m32, m33; // vars for temp result matrix
- // code for mat mul
+ // code for mat mul
m00 = m1.m00*m2.m00 + m1.m01*m2.m10 + m1.m02*m2.m20 + m1.m03*m2.m30;
m01 = m1.m00*m2.m01 + m1.m01*m2.m11 + m1.m02*m2.m21 + m1.m03*m2.m31;
m02 = m1.m00*m2.m02 + m1.m01*m2.m12 + m1.m02*m2.m22 + m1.m03*m2.m32;
@@ -2769,11 +2769,11 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Multiplies the transpose of matrix m1 times the transpose of matrix
* m2, and places the result into this.
- * @param m1 the matrix on the left hand side of the multiplication
+ * @param m1 the matrix on the left hand side of the multiplication
* @param m2 the matrix on the right hand side of the multiplication
- */
- public final void mulTransposeBoth(Matrix4d m1, Matrix4d m2)
- {
+ */
+ public final void mulTransposeBoth(Matrix4d m1, Matrix4d m2)
+ {
if (this != m1 && this != m2) {
this.m00 = m1.m00*m2.m00 + m1.m10*m2.m01 + m1.m20*m2.m02 + m1.m30*m2.m03;
this.m01 = m1.m00*m2.m10 + m1.m10*m2.m11 + m1.m20*m2.m12 + m1.m30*m2.m13;
@@ -2797,53 +2797,53 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
} else {
double m00, m01, m02, m03,
m10, m11, m12, m13,
- m20, m21, m22, m23, // vars for temp result matrix
+ m20, m21, m22, m23, // vars for temp result matrix
m30, m31, m32, m33;
-
+
m00 = m1.m00*m2.m00 + m1.m10*m2.m01 + m1.m20*m2.m02 + m1.m30*m2.m03;
m01 = m1.m00*m2.m10 + m1.m10*m2.m11 + m1.m20*m2.m12 + m1.m30*m2.m13;
m02 = m1.m00*m2.m20 + m1.m10*m2.m21 + m1.m20*m2.m22 + m1.m30*m2.m23;
m03 = m1.m00*m2.m30 + m1.m10*m2.m31 + m1.m20*m2.m32 + m1.m30*m2.m33;
-
+
m10 = m1.m01*m2.m00 + m1.m11*m2.m01 + m1.m21*m2.m02 + m1.m31*m2.m03;
m11 = m1.m01*m2.m10 + m1.m11*m2.m11 + m1.m21*m2.m12 + m1.m31*m2.m13;
m12 = m1.m01*m2.m20 + m1.m11*m2.m21 + m1.m21*m2.m22 + m1.m31*m2.m23;
m13 = m1.m01*m2.m30 + m1.m11*m2.m31 + m1.m21*m2.m32 + m1.m31*m2.m33;
-
+
m20 = m1.m02*m2.m00 + m1.m12*m2.m01 + m1.m22*m2.m02 + m1.m32*m2.m03;
m21 = m1.m02*m2.m10 + m1.m12*m2.m11 + m1.m22*m2.m12 + m1.m32*m2.m13;
m22 = m1.m02*m2.m20 + m1.m12*m2.m21 + m1.m22*m2.m22 + m1.m32*m2.m23;
m23 = m1.m02*m2.m30 + m1.m12*m2.m31 + m1.m22*m2.m32 + m1.m32*m2.m33;
-
+
m30 = m1.m03*m2.m00 + m1.m13*m2.m01 + m1.m23*m2.m02 + m1.m33*m2.m03;
m31 = m1.m03*m2.m10 + m1.m13*m2.m11 + m1.m23*m2.m12 + m1.m33*m2.m13;
m32 = m1.m03*m2.m20 + m1.m13*m2.m21 + m1.m23*m2.m22 + m1.m33*m2.m23;
m33 = m1.m03*m2.m30 + m1.m13*m2.m31 + m1.m23*m2.m32 + m1.m33*m2.m33;
-
+
this.m00 = m00; this.m01 = m01; this.m02 = m02; this.m03 = m03;
this.m10 = m10; this.m11 = m11; this.m12 = m12; this.m13 = m13;
this.m20 = m20; this.m21 = m21; this.m22 = m22; this.m23 = m23;
this.m30 = m30; this.m31 = m31; this.m32 = m32; this.m33 = m33;
}
-
- }
-
-
-
- /**
- * Multiplies matrix m1 times the transpose of matrix m2, and
- * places the result into this.
- * @param m1 the matrix on the left hand side of the multiplication
- * @param m2 the matrix on the right hand side of the multiplication
- */
- public final void mulTransposeRight(Matrix4d m1, Matrix4d m2)
- {
+
+ }
+
+
+
+ /**
+ * Multiplies matrix m1 times the transpose of matrix m2, and
+ * places the result into this.
+ * @param m1 the matrix on the left hand side of the multiplication
+ * @param m2 the matrix on the right hand side of the multiplication
+ */
+ public final void mulTransposeRight(Matrix4d m1, Matrix4d m2)
+ {
if (this != m1 && this != m2) {
this.m00 = m1.m00*m2.m00 + m1.m01*m2.m01 + m1.m02*m2.m02 + m1.m03*m2.m03;
this.m01 = m1.m00*m2.m10 + m1.m01*m2.m11 + m1.m02*m2.m12 + m1.m03*m2.m13;
this.m02 = m1.m00*m2.m20 + m1.m01*m2.m21 + m1.m02*m2.m22 + m1.m03*m2.m23;
this.m03 = m1.m00*m2.m30 + m1.m01*m2.m31 + m1.m02*m2.m32 + m1.m03*m2.m33;
-
+
this.m10 = m1.m10*m2.m00 + m1.m11*m2.m01 + m1.m12*m2.m02 + m1.m13*m2.m03;
this.m11 = m1.m10*m2.m10 + m1.m11*m2.m11 + m1.m12*m2.m12 + m1.m13*m2.m13;
this.m12 = m1.m10*m2.m20 + m1.m11*m2.m21 + m1.m12*m2.m22 + m1.m13*m2.m23;
@@ -2890,32 +2890,32 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
this.m30 = m30; this.m31 = m31; this.m32 = m32; this.m33 = m33;
}
}
-
-
- /**
- * Multiplies the transpose of matrix m1 times matrix m2, and
- * places the result into this.
- * @param m1 the matrix on the left hand side of the multiplication
- * @param m2 the matrix on the right hand side of the multiplication
- */
- public final void mulTransposeLeft(Matrix4d m1, Matrix4d m2)
+
+
+ /**
+ * Multiplies the transpose of matrix m1 times matrix m2, and
+ * places the result into this.
+ * @param m1 the matrix on the left hand side of the multiplication
+ * @param m2 the matrix on the right hand side of the multiplication
+ */
+ public final void mulTransposeLeft(Matrix4d m1, Matrix4d m2)
{
if (this != m1 && this != m2) {
this.m00 = m1.m00*m2.m00 + m1.m10*m2.m10 + m1.m20*m2.m20 + m1.m30*m2.m30;
this.m01 = m1.m00*m2.m01 + m1.m10*m2.m11 + m1.m20*m2.m21 + m1.m30*m2.m31;
this.m02 = m1.m00*m2.m02 + m1.m10*m2.m12 + m1.m20*m2.m22 + m1.m30*m2.m32;
this.m03 = m1.m00*m2.m03 + m1.m10*m2.m13 + m1.m20*m2.m23 + m1.m30*m2.m33;
-
+
this.m10 = m1.m01*m2.m00 + m1.m11*m2.m10 + m1.m21*m2.m20 + m1.m31*m2.m30;
this.m11 = m1.m01*m2.m01 + m1.m11*m2.m11 + m1.m21*m2.m21 + m1.m31*m2.m31;
this.m12 = m1.m01*m2.m02 + m1.m11*m2.m12 + m1.m21*m2.m22 + m1.m31*m2.m32;
this.m13 = m1.m01*m2.m03 + m1.m11*m2.m13 + m1.m21*m2.m23 + m1.m31*m2.m33;
-
+
this.m20 = m1.m02*m2.m00 + m1.m12*m2.m10 + m1.m22*m2.m20 + m1.m32*m2.m30;
this.m21 = m1.m02*m2.m01 + m1.m12*m2.m11 + m1.m22*m2.m21 + m1.m32*m2.m31;
this.m22 = m1.m02*m2.m02 + m1.m12*m2.m12 + m1.m22*m2.m22 + m1.m32*m2.m32;
this.m23 = m1.m02*m2.m03 + m1.m12*m2.m13 + m1.m22*m2.m23 + m1.m32*m2.m33;
-
+
this.m30 = m1.m03*m2.m00 + m1.m13*m2.m10 + m1.m23*m2.m20 + m1.m33*m2.m30;
this.m31 = m1.m03*m2.m01 + m1.m13*m2.m11 + m1.m23*m2.m21 + m1.m33*m2.m31;
this.m32 = m1.m03*m2.m02 + m1.m13*m2.m12 + m1.m23*m2.m22 + m1.m33*m2.m32;
@@ -2925,24 +2925,24 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m10, m11, m12, m13,
m20, m21, m22, m23, // vars for temp result matrix
m30, m31, m32, m33;
-
-
+
+
m00 = m1.m00*m2.m00 + m1.m10*m2.m10 + m1.m20*m2.m20 + m1.m30*m2.m30;
m01 = m1.m00*m2.m01 + m1.m10*m2.m11 + m1.m20*m2.m21 + m1.m30*m2.m31;
m02 = m1.m00*m2.m02 + m1.m10*m2.m12 + m1.m20*m2.m22 + m1.m30*m2.m32;
m03 = m1.m00*m2.m03 + m1.m10*m2.m13 + m1.m20*m2.m23 + m1.m30*m2.m33;
-
+
m10 = m1.m01*m2.m00 + m1.m11*m2.m10 + m1.m21*m2.m20 + m1.m31*m2.m30;
m11 = m1.m01*m2.m01 + m1.m11*m2.m11 + m1.m21*m2.m21 + m1.m31*m2.m31;
m12 = m1.m01*m2.m02 + m1.m11*m2.m12 + m1.m21*m2.m22 + m1.m31*m2.m32;
m13 = m1.m01*m2.m03 + m1.m11*m2.m13 + m1.m21*m2.m23 + m1.m31*m2.m33;
-
+
m20 = m1.m02*m2.m00 + m1.m12*m2.m10 + m1.m22*m2.m20 + m1.m32*m2.m30;
m21 = m1.m02*m2.m01 + m1.m12*m2.m11 + m1.m22*m2.m21 + m1.m32*m2.m31;
m22 = m1.m02*m2.m02 + m1.m12*m2.m12 + m1.m22*m2.m22 + m1.m32*m2.m32;
m23 = m1.m02*m2.m03 + m1.m12*m2.m13 + m1.m22*m2.m23 + m1.m32*m2.m33;
-
+
m30 = m1.m03*m2.m00 + m1.m13*m2.m10 + m1.m23*m2.m20 + m1.m33*m2.m30;
m31 = m1.m03*m2.m01 + m1.m13*m2.m11 + m1.m23*m2.m21 + m1.m33*m2.m31;
m32 = m1.m03*m2.m02 + m1.m13*m2.m12 + m1.m23*m2.m22 + m1.m33*m2.m32;
@@ -2955,8 +2955,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
}
}
-
-
+
+
/**
* Returns true if all of the data members of Matrix4d m1 are
* equal to the corresponding data members in this Matrix4d.
@@ -2972,7 +2972,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
&& this.m21 == m1.m21 && this.m22 == m1.m22 && this.m23 == m1.m23
&& this.m30 == m1.m30 && this.m31 == m1.m31 && this.m32 == m1.m32
&& this.m33 == m1.m33);
- }
+ }
catch (NullPointerException e2) { return false; }
}
@@ -2983,10 +2983,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* this Matrix4d.
* @param t1 the matrix with which the comparison is made
* @return true or false
- */
+ */
public boolean equals(Object t1)
{
- try {
+ try {
Matrix4d m2 = (Matrix4d) t1;
return(this.m00 == m2.m00 && this.m01 == m2.m01 && this.m02 == m2.m02
&& this.m03 == m2.m03 && this.m10 == m2.m10 && this.m11 == m2.m11
@@ -2995,27 +2995,27 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
&& this.m30 == m2.m30 && this.m31 == m2.m31 && this.m32 == m2.m32
&& this.m33 == m2.m33);
}
- catch (ClassCastException e1) { return false; }
+ catch (ClassCastException e1) { return false; }
catch (NullPointerException e2) { return false; }
}
- /**
+ /**
* @deprecated Use epsilonEquals(Matrix4d,double) instead
- */
+ */
public boolean epsilonEquals(Matrix4d m1, float epsilon) {
return epsilonEquals(m1, (double)epsilon);
}
- /**
- * Returns true if the L-infinite distance between this matrix
- * and matrix m1 is less than or equal to the epsilon parameter,
- * otherwise returns false. The L-infinite
- * distance is equal to
- * MAX[i=0,1,2,3 ; j=0,1,2,3 ; abs(this.m(i,j) - m1.m(i,j)]
- * @param m1 the matrix to be compared to this matrix
- * @param epsilon the threshold value
- */
- public boolean epsilonEquals(Matrix4d m1, double epsilon) {
+ /**
+ * Returns true if the L-infinite distance between this matrix
+ * and matrix m1 is less than or equal to the epsilon parameter,
+ * otherwise returns false. The L-infinite
+ * distance is equal to
+ * MAX[i=0,1,2,3 ; j=0,1,2,3 ; abs(this.m(i,j) - m1.m(i,j)]
+ * @param m1 the matrix to be compared to this matrix
+ * @param epsilon the threshold value
+ */
+ public boolean epsilonEquals(Matrix4d m1, double epsilon) {
double diff;
diff = m00 - m1.m00;
@@ -3067,7 +3067,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
if((diff<0?-diff:diff) > epsilon) return false;
return true;
- }
+ }
/**
* Returns a hash code value based on the data values in this
@@ -3076,7 +3076,7 @@ public class Matrix4d 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 + VecMathUtil.doubleToLongBits(m00);
@@ -3186,7 +3186,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
vec.y = y;
vec.z = z;
}
-
+
/**
* Transforms the point parameter with this Matrix4d and
@@ -3205,8 +3205,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
pointOut.y = y;
}
-
-
+
+
/**
* Transforms the point parameter with this Matrix4d and
* places the result back into point. The fourth element of the
@@ -3223,7 +3223,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
point.y = y;
}
-
+
/**
* Transforms the point parameter with this Matrix4d and
* places the result into pointOut. The fourth element of the
@@ -3241,8 +3241,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
pointOut.x = x;
pointOut.y = y;
}
-
-
+
+
/**
* Transforms the point parameter with this Matrix4d and
* places the result back into point. The fourth element of the
@@ -3258,7 +3258,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
point.x = x;
point.y = y;
}
-
+
/**
* Transforms the normal parameter by this Matrix4d and places the value
@@ -3275,8 +3275,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
normalOut.x = x;
normalOut.y = y;
}
-
-
+
+
/**
* Transforms the normal parameter by this transform and places the value
* back into normal. The fourth element of the normal is assumed to be zero.
@@ -3293,7 +3293,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
normal.y = y;
}
-
+
/**
* Transforms the normal parameter by this Matrix4d and places the value
* into normalOut. The fourth element of the normal is assumed to be zero.
@@ -3309,8 +3309,8 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
normalOut.x = x;
normalOut.y = y;
}
-
-
+
+
/**
* Transforms the normal parameter by this transform and places the value
* back into normal. The fourth element of the normal is assumed to be zero.
@@ -3319,7 +3319,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
public final void transform(Vector3f normal)
{
float x, y;
-
+
x = (float) (m00*normal.x + m01*normal.y + m02*normal.z);
y = (float) (m10*normal.x + m11*normal.y + m12*normal.z);
normal.z = (float) (m20*normal.x + m21*normal.y + m22*normal.z);
@@ -3336,11 +3336,11 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* are replaced by the passed rotation components,
* and then the scale is reapplied to the rotational components.
* @param m1 double precision 3x3 matrix
- */
- public final void setRotation( Matrix3d m1){
+ */
+ public final void setRotation( Matrix3d m1){
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
-
+
getScaleRotate( tmp_scale, tmp_rot );
m00 = m1.m00*tmp_scale[0];
@@ -3355,9 +3355,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m21 = m1.m21*tmp_scale[1];
m22 = m1.m22*tmp_scale[2];
- }
-
-
+ }
+
+
/**
* Sets the rotational component (upper 3x3) of this matrix to the
* matrix values in the single precision Matrix3f argument; the other
@@ -3367,9 +3367,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* are replaced by the passed rotation components,
* and then the scale is reapplied to the rotational components.
* @param m1 single precision 3x3 matrix
- */
- public final void setRotation( Matrix3f m1)
- {
+ */
+ public final void setRotation( Matrix3f m1)
+ {
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
@@ -3386,7 +3386,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m20 = m1.m20*tmp_scale[0];
m21 = m1.m21*tmp_scale[1];
m22 = m1.m22*tmp_scale[2];
- }
+ }
/**
* Sets the rotational component (upper 3x3) of this matrix to the
@@ -3397,39 +3397,39 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* are replaced by the matrix equivalent of the quaternion,
* and then the scale is reapplied to the rotational components.
* @param q1 the quaternion that specifies the rotation
- */
+ */
public final void setRotation(Quat4f q1){
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
-
+
m00 = (1.0 - 2.0f*q1.y*q1.y - 2.0f*q1.z*q1.z)*tmp_scale[0];
- m10 = (2.0*(q1.x*q1.y + q1.w*q1.z))*tmp_scale[0];
- m20 = (2.0*(q1.x*q1.z - q1.w*q1.y))*tmp_scale[0];
-
+ m10 = (2.0*(q1.x*q1.y + q1.w*q1.z))*tmp_scale[0];
+ m20 = (2.0*(q1.x*q1.z - q1.w*q1.y))*tmp_scale[0];
+
m01 = (2.0*(q1.x*q1.y - q1.w*q1.z))*tmp_scale[1];
- m11 = (1.0 - 2.0f*q1.x*q1.x - 2.0f*q1.z*q1.z)*tmp_scale[1];
- m21 = (2.0*(q1.y*q1.z + q1.w*q1.x))*tmp_scale[1];
-
+ m11 = (1.0 - 2.0f*q1.x*q1.x - 2.0f*q1.z*q1.z)*tmp_scale[1];
+ m21 = (2.0*(q1.y*q1.z + q1.w*q1.x))*tmp_scale[1];
+
m02 = (2.0*(q1.x*q1.z + q1.w*q1.y))*tmp_scale[2];
- m12 = (2.0*(q1.y*q1.z - q1.w*q1.x))*tmp_scale[2];
- m22 = (1.0 - 2.0f*q1.x*q1.x - 2.0f*q1.y*q1.y)*tmp_scale[2];
+ m12 = (2.0*(q1.y*q1.z - q1.w*q1.x))*tmp_scale[2];
+ m22 = (1.0 - 2.0f*q1.x*q1.x - 2.0f*q1.y*q1.y)*tmp_scale[2];
}
-
- /**
- * Sets the rotational component (upper 3x3) of this matrix to the
- * matrix equivalent values of the quaternion argument; the other
- * elements of this matrix are unchanged; a singular value
- * decomposition is performed on this object's upper 3x3 matrix to
+
+ /**
+ * Sets the rotational component (upper 3x3) of this matrix to the
+ * matrix equivalent values of the quaternion argument; the other
+ * elements of this matrix are unchanged; a singular value
+ * decomposition is performed on this object's upper 3x3 matrix to
* factor out the scale, then this object's upper 3x3 matrix components
* are replaced by the matrix equivalent of the quaternion,
- * and then the scale is reapplied to the rotational components.
- * @param q1 the quaternion that specifies the rotation
- */
+ * and then the scale is reapplied to the rotational components.
+ * @param q1 the quaternion that specifies the rotation
+ */
public final void setRotation(Quat4d q1){
-
+
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
getScaleRotate( tmp_scale, tmp_rot );
@@ -3437,18 +3437,18 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m00 = (1.0 - 2.0f*q1.y*q1.y - 2.0f*q1.z*q1.z)*tmp_scale[0];
m10 = (2.0*(q1.x*q1.y + q1.w*q1.z))*tmp_scale[0];
m20 = (2.0*(q1.x*q1.z - q1.w*q1.y))*tmp_scale[0];
-
+
m01 = (2.0*(q1.x*q1.y - q1.w*q1.z))*tmp_scale[1];
m11 = (1.0 - 2.0f*q1.x*q1.x - 2.0f*q1.z*q1.z)*tmp_scale[1];
m21 = (2.0*(q1.y*q1.z + q1.w*q1.x))*tmp_scale[1];
-
+
m02 = (2.0*(q1.x*q1.z + q1.w*q1.y))*tmp_scale[2];
m12 = (2.0*(q1.y*q1.z - q1.w*q1.x))*tmp_scale[2];
m22 = (1.0 - 2.0f*q1.x*q1.x - 2.0f*q1.y*q1.y)*tmp_scale[2];
-
+
}
- /**
+ /**
* Sets the rotational component (upper 3x3) of this matrix to the
* matrix equivalent values of the axis-angle argument; the other
* elements of this matrix are unchanged; a singular value
@@ -3459,10 +3459,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* @param a1 the axis-angle to be converted (x, y, z, angle)
*/
public final void setRotation(AxisAngle4d a1)
- {
+ {
double[] tmp_rot = new double[9]; // scratch matrix
double[] tmp_scale = new double[3]; // scratch matrix
-
+
getScaleRotate( tmp_scale, tmp_rot );
double mag = 1.0/Math.sqrt( a1.x*a1.x + a1.y*a1.y + a1.z*a1.z);
@@ -3485,7 +3485,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
m10 = (t * xy + sinTheta * az)*tmp_scale[0];
m11 = (t * ay * ay + cosTheta)*tmp_scale[1];
m12 = (t * yz - sinTheta * ax)*tmp_scale[2];
-
+
m20 = (t * xz - sinTheta * ay)*tmp_scale[0];
m21 = (t * yz + sinTheta * ax)*tmp_scale[1];
m22 = (t * az * az + cosTheta)*tmp_scale[2];
@@ -3517,7 +3517,7 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Negates the value of this matrix: this = -this.
- */
+ */
public final void negate()
{
m00 = -m00;
@@ -3542,10 +3542,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
* Sets the value of this matrix equal to the negation of
* of the Matrix4d parameter.
* @param m1 the source matrix
- */
+ */
public final void negate(Matrix4d m1)
{
- this.m00 = -m1.m00;
+ this.m00 = -m1.m00;
this.m01 = -m1.m01;
this.m02 = -m1.m02;
this.m03 = -m1.m03;
@@ -3603,9 +3603,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the first matrix element in the first row.
- *
+ *
* @return Returns the m00.
- *
+ *
* @since vecmath 1.5
*/
public final double getM00() {
@@ -3614,10 +3614,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the first matrix element in the first row.
- *
+ *
* @param m00 The m00 to set.
- *
- *
+ *
+ *
* @since vecmath 1.5
*/
public final void setM00(double m00) {
@@ -3626,9 +3626,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the second matrix element in the first row.
- *
+ *
* @return Returns the m01.
- *
+ *
* @since vecmath 1.5
*/
public final double getM01() {
@@ -3637,9 +3637,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the second matrix element in the first row.
- *
+ *
* @param m01 The m01 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM01(double m01) {
@@ -3648,9 +3648,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the third matrix element in the first row.
- *
+ *
* @return Returns the m02.
- *
+ *
* @since vecmath 1.5
*/
public final double getM02() {
@@ -3659,9 +3659,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the third matrix element in the first row.
- *
+ *
* @param m02 The m02 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM02(double m02) {
@@ -3670,9 +3670,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get first matrix element in the second row.
- *
+ *
* @return Returns the m10.
- *
+ *
* @since vecmath 1.5
*/
public final double getM10() {
@@ -3681,9 +3681,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set first matrix element in the second row.
- *
+ *
* @param m10 The m10 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM10(double m10) {
@@ -3692,9 +3692,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get second matrix element in the second row.
- *
+ *
* @return Returns the m11.
- *
+ *
* @since vecmath 1.5
*/
public final double getM11() {
@@ -3703,9 +3703,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the second matrix element in the second row.
- *
+ *
* @param m11 The m11 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM11(double m11) {
@@ -3714,9 +3714,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the third matrix element in the second row.
- *
+ *
* @return Returns the m12.
- *
+ *
* @since vecmath 1.5
*/
public final double getM12() {
@@ -3725,10 +3725,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the third matrix element in the second row.
- *
+ *
* @param m12 The m12 to set.
- *
- *
+ *
+ *
* @since vecmath 1.5
*/
public final void setM12(double m12) {
@@ -3737,9 +3737,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the first matrix element in the third row.
- *
+ *
* @return Returns the m20.
- *
+ *
* @since vecmath 1.5
*/
public final double getM20() {
@@ -3748,9 +3748,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the first matrix element in the third row.
- *
+ *
* @param m20 The m20 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM20(double m20) {
@@ -3759,9 +3759,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the second matrix element in the third row.
- *
+ *
* @return Returns the m21.
- *
+ *
* @since vecmath 1.5
*/
public final double getM21() {
@@ -3770,9 +3770,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the second matrix element in the third row.
- *
+ *
* @param m21 The m21 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM21(double m21) {
@@ -3781,9 +3781,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the third matrix element in the third row.
- *
+ *
* @return Returns the m22.
- *
+ *
* @since vecmath 1.5
*/
public final double getM22() {
@@ -3792,9 +3792,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the third matrix element in the third row.
- *
+ *
* @param m22 The m22 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM22(double m22) {
@@ -3803,9 +3803,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the fourth element of the first row.
- *
+ *
* @return Returns the m03.
- *
+ *
* @since vecmath 1.5
*/
public final double getM03() {
@@ -3814,9 +3814,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the fourth element of the first row.
- *
+ *
* @param m03 The m03 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM03(double m03) {
@@ -3825,9 +3825,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the fourth element of the second row.
- *
+ *
* @return Returns the m13.
- *
+ *
* @since vecmath 1.5
*/
public final double getM13() {
@@ -3836,9 +3836,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the fourth element of the second row.
- *
+ *
* @param m13 The m13 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM13(double m13) {
@@ -3847,9 +3847,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the fourth element of the third row.
- *
+ *
* @return Returns the m23.
- *
+ *
* @since vecmath 1.5
*/
public final double getM23() {
@@ -3858,9 +3858,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the fourth element of the third row.
- *
+ *
* @param m23 The m23 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM23(double m23) {
@@ -3869,9 +3869,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the first element of the fourth row.
- *
+ *
* @return Returns the m30.
- *
+ *
* @since vecmath 1.5
*/
public final double getM30() {
@@ -3880,9 +3880,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the first element of the fourth row.
- *
+ *
* @param m30 The m30 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM30(double m30) {
@@ -3891,9 +3891,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the second element of the fourth row.
- *
+ *
* @return Returns the m31.
- *
+ *
* @since vecmath 1.5
*/
public final double getM31() {
@@ -3902,9 +3902,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the second element of the fourth row.
- *
+ *
* @param m31 The m31 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM31(double m31) {
@@ -3913,10 +3913,10 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the third element of the fourth row.
- *
+ *
* @return Returns the m32.
- *
- *
+ *
+ *
* @since vecmath 1.5
*/
public final double getM32() {
@@ -3925,9 +3925,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the third element of the fourth row.
- *
+ *
* @param m32 The m32 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM32(double m32) {
@@ -3936,9 +3936,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Get the fourth element of the fourth row.
- *
+ *
* @return Returns the m33.
- *
+ *
* @since vecmath 1.5
*/
public final double getM33() {
@@ -3947,9 +3947,9 @@ public class Matrix4d implements java.io.Serializable, Cloneable {
/**
* Set the fourth element of the fourth row.
- *
+ *
* @param m33 The m33 to set.
- *
+ *
* @since vecmath 1.5
*/
public final void setM33(double m33) {