Package com.ardor3d.math
Class Matrix3
java.lang.Object
com.ardor3d.math.Matrix3
- All Implemented Interfaces:
Poolable
,ReadOnlyMatrix3
,Savable
,Externalizable
,Serializable
,Cloneable
public class Matrix3
extends Object
implements Cloneable, Savable, Externalizable, ReadOnlyMatrix3, Poolable
Matrix3 represents a double precision 3x3 matrix.
Note: some algorithms in this class were ported from Eberly, Wolfram, Game Gems and others to Java.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
static final double
Used with equals method to determine if two Matrix3 objects are close enough to be considered equal.static final ReadOnlyMatrix3
1, 0, 0 0, 1, 0 0, 0, 1 -
Constructor Summary
ConstructorDescriptionMatrix3()
Constructs a new, mutable matrix set to identity.Matrix3
(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) Constructs a new, mutable matrix using the given matrix values (names are mRC = m[ROW][COL])Matrix3
(ReadOnlyMatrix3 source) Constructs a new, mutable matrix using the values from the given matrix -
Method Summary
Modifier and TypeMethodDescriptionadd
(ReadOnlyMatrix3 matrix, Matrix3 store) addLocal
(ReadOnlyMatrix3 matrix) Internally adds the values of the given matrix to this matrix.applyPost
(ReadOnlyVector3 vec, Vector3 store) Multiplies the given vector by this matrix (M * v).applyPre
(ReadOnlyVector3 vec, Vector3 store) Multiplies the given vector by this matrix (v * M).applyRotation
(double angle, double x, double y, double z) applyRotationX
(double angle) Apply rotation around X (Mrx * this)applyRotationY
(double angle) Apply rotation around Y (Mry * this)applyRotationZ
(double angle) Apply rotation around Z (Mrz * this)clone()
double
boolean
static final Matrix3
fromAngleAxis
(double angle, ReadOnlyVector3 axis) Sets this matrix to the rotation indicated by the given angle and axis of rotation.fromAngleNormalAxis
(double angle, ReadOnlyVector3 axis) Sets this matrix to the rotation indicated by the given angle and a unit-length axis of rotation.fromAngles
(double yaw, double roll, double pitch) XXX: Need to redo this again... or at least correct the terms.fromArray
(double[] source) Sets the values of this matrix to the values of the provided double array.fromArray
(double[] source, boolean rowMajor) Sets the values of this matrix to the values of the provided double array.fromAxes
(ReadOnlyVector3 uAxis, ReadOnlyVector3 vAxis, ReadOnlyVector3 wAxis) Set the values of this matrix from the axes (columns) provided.fromDoubleBuffer
(DoubleBuffer source) fromDoubleBuffer
(DoubleBuffer source, boolean rowMajor) fromFloatBuffer
(FloatBuffer source) Note: data is cast to floats.fromFloatBuffer
(FloatBuffer source, boolean rowMajor) Note: data is cast to floats.fromStartEndLocal
(ReadOnlyVector3 start, ReadOnlyVector3 end) A function for creating a rotation matrix that rotates a vector called "start" into another vector called "end".double
getM00()
double
getM01()
double
getM02()
double
getM10()
double
getM11()
double
getM12()
double
getM20()
double
getM21()
double
getM22()
double
getValue
(int row, int column) float
getValuef
(int row, int column) int
hashCode()
Inverts this matrix locally.boolean
boolean
static boolean
isValid
(ReadOnlyMatrix3 matrix) Check a matrix... if it is null or its doubles are NaN or infinite, return false.lookAt
(ReadOnlyVector3 direction, ReadOnlyVector3 up) Modifies this matrix to equal the rotation required to point the z-axis at 'direction' and the y-axis to 'up'.multiply
(ReadOnlyMatrix3 matrix, Matrix3 store) multiplyDiagonalPost
(ReadOnlyVector3 vec, Matrix3 store) Multiplies this matrix by the diagonal matrix formed by the given vector (M * v^D).multiplyDiagonalPre
(ReadOnlyVector3 vec, Matrix3 store) Multiplies this matrix by the diagonal matrix formed by the given vector (v^D * M).multiplyLocal
(double scalar) Internally scales all values of this matrix by the given scalar.multiplyLocal
(ReadOnlyMatrix3 matrix) void
read
(InputCapsule capsule) void
Used with serialization.static final void
Releases a Matrix3 back to be used by a future call to fetchTempInstance.scale
(ReadOnlyVector3 scale, Matrix3 store) Applies the given scale to this matrix and returns the result as a new matrixscaleLocal
(ReadOnlyVector3 scale) Applies the given scale to this matrix values internallyset
(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) Sets the values of this matrix to the values given.set
(ReadOnlyMatrix3 source) Sets the values of this matrix to the values of the provided source matrix.set
(ReadOnlyQuaternion quaternion) Sets the values of this matrix to the rotational value of the given quaternion.setColumn
(int columnIndex, ReadOnlyVector3 columnData) Replaces a column in this matrix with the values of the given vector.Same as set(IDENTITY)void
setM00
(double m00) void
setM01
(double m01) void
setM02
(double m02) void
setM10
(double m10) void
setM11
(double m11) void
setM12
(double m12) void
setM20
(double m20) void
setM21
(double m21) void
setM22
(double m22) setRow
(int rowIndex, ReadOnlyVector3 rowData) Replaces a row in this matrix with the values of the given vector.setValue
(int row, int column, double value) Sets the value of this matrix at row, column to the given value.boolean
subtract
(ReadOnlyMatrix3 matrix, Matrix3 store) subtractLocal
(ReadOnlyMatrix3 matrix) Internally subtracts the values of the given matrix from this matrix.double[]
toAngles
(double[] store) converts this matrix to Euler rotation angles (yaw, roll, pitch).double[]
toArray
(double[] store) double[]
toArray
(double[] store, boolean rowMajor) toDoubleBuffer
(DoubleBuffer store) toDoubleBuffer
(DoubleBuffer store, boolean rowMajor) toFloatBuffer
(FloatBuffer store) Note: data is cast to floats.toFloatBuffer
(FloatBuffer store, boolean rowMajor) Note: data is cast to floats.toString()
transposes this matrix as a new matrix, basically flipping it across the diagonaltransposes this matrix in placevoid
write
(OutputCapsule capsule) void
Used with serialization.
-
Field Details
-
ALLOWED_DEVIANCE
public static final double ALLOWED_DEVIANCEUsed with equals method to determine if two Matrix3 objects are close enough to be considered equal.- See Also:
-
IDENTITY
1, 0, 0 0, 1, 0 0, 0, 1
-
_m00
protected double _m00 -
_m01
protected double _m01 -
_m02
protected double _m02 -
_m10
protected double _m10 -
_m11
protected double _m11 -
_m12
protected double _m12 -
_m20
protected double _m20 -
_m21
protected double _m21 -
_m22
protected double _m22
-
-
Constructor Details
-
Matrix3
public Matrix3()Constructs a new, mutable matrix set to identity. -
Matrix3
public Matrix3(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) Constructs a new, mutable matrix using the given matrix values (names are mRC = m[ROW][COL])- Parameters:
m00
- m00m01
- m01m02
- m02m10
- m10m11
- m11m12
- m12m20
- m20m21
- m21m22
- m22
-
Matrix3
Constructs a new, mutable matrix using the values from the given matrix- Parameters:
source
- the source matrix
-
-
Method Details
-
getValue
public double getValue(int row, int column) - Specified by:
getValue
in interfaceReadOnlyMatrix3
- Parameters:
row
- the row indexcolumn
- the column index- Returns:
- the value stored in this matrix at row, column.
- Throws:
IllegalArgumentException
- if row and column are not in bounds [0, 2]
-
getValuef
public float getValuef(int row, int column) - Specified by:
getValuef
in interfaceReadOnlyMatrix3
- Parameters:
row
- the row indexcolumn
- the column index- Returns:
- the value stored in this matrix at row, column, pre-cast to a float for convenience.
- Throws:
IllegalArgumentException
- if row and column are not in bounds [0, 2]
-
getM00
public double getM00()- Specified by:
getM00
in interfaceReadOnlyMatrix3
-
getM01
public double getM01()- Specified by:
getM01
in interfaceReadOnlyMatrix3
-
getM02
public double getM02()- Specified by:
getM02
in interfaceReadOnlyMatrix3
-
getM10
public double getM10()- Specified by:
getM10
in interfaceReadOnlyMatrix3
-
getM11
public double getM11()- Specified by:
getM11
in interfaceReadOnlyMatrix3
-
getM12
public double getM12()- Specified by:
getM12
in interfaceReadOnlyMatrix3
-
getM20
public double getM20()- Specified by:
getM20
in interfaceReadOnlyMatrix3
-
getM21
public double getM21()- Specified by:
getM21
in interfaceReadOnlyMatrix3
-
getM22
public double getM22()- Specified by:
getM22
in interfaceReadOnlyMatrix3
-
setM00
public void setM00(double m00) -
setM01
public void setM01(double m01) -
setM02
public void setM02(double m02) -
setM10
public void setM10(double m10) -
setM11
public void setM11(double m11) -
setM12
public void setM12(double m12) -
setM20
public void setM20(double m20) -
setM21
public void setM21(double m21) -
setM22
public void setM22(double m22) -
setIdentity
Same as set(IDENTITY)- Returns:
- this matrix for chaining
-
isIdentity
public boolean isIdentity()- Specified by:
isIdentity
in interfaceReadOnlyMatrix3
- Returns:
- true if this matrix equals the 3x3 identity matrix
-
setValue
Sets the value of this matrix at row, column to the given value.- Parameters:
row
- the row indexcolumn
- the column indexvalue
- the value to set- Returns:
- this matrix for chaining
- Throws:
IllegalArgumentException
- if row and column are not in bounds [0, 2]
-
set
public Matrix3 set(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) Sets the values of this matrix to the values given.- Parameters:
m00
- m00m01
- m01m02
- m02m10
- m10m11
- m11m12
- m12m20
- m20m21
- m21m22
- m22- Returns:
- this matrix for chaining
-
set
Sets the values of this matrix to the values of the provided source matrix.- Parameters:
source
- the source matrix- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if source is null.
-
set
Sets the values of this matrix to the rotational value of the given quaternion.- Parameters:
quaternion
- the quaternion- Returns:
- this matrix for chaining
-
fromDoubleBuffer
- Parameters:
source
- the buffer to read our matrix data from.- Returns:
- this matrix for chaining.
-
fromDoubleBuffer
- Parameters:
source
- the buffer to read our matrix data from.rowMajor
- if true, data is stored row by row. Otherwise it is stored column by column.- Returns:
- this matrix for chaining.
-
fromFloatBuffer
Note: data is cast to floats.- Parameters:
source
- the buffer to read our matrix data from.- Returns:
- this matrix for chaining.
-
fromFloatBuffer
Note: data is cast to floats.- Parameters:
source
- the buffer to read our matrix data from.rowMajor
- if true, data is stored row by row. Otherwise it is stored column by column.- Returns:
- this matrix for chaining.
-
fromArray
Sets the values of this matrix to the values of the provided double array.- Parameters:
source
- the source matrix- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if source is null.ArrayIndexOutOfBoundsException
- if source array has a length less than 9.
-
fromArray
Sets the values of this matrix to the values of the provided double array.- Parameters:
source
- the source matrixrowMajor
-true
if the matrix is row major- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if source is null.ArrayIndexOutOfBoundsException
- if source array has a length less than 9.
-
setColumn
Replaces a column in this matrix with the values of the given vector.- Parameters:
columnIndex
- the column indexcolumnData
- the column data- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if columnData is null.IllegalArgumentException
- if columnIndex is not in [0, 2]
-
setRow
Replaces a row in this matrix with the values of the given vector.- Parameters:
rowIndex
- the row indexrowData
- the row date- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if rowData is null.IllegalArgumentException
- if rowIndex is not in [0, 2]
-
fromAxes
Set the values of this matrix from the axes (columns) provided.- Parameters:
uAxis
- the u axisvAxis
- the v axiswAxis
- the w axis- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if any of the axes are null.
-
fromAngleAxis
Sets this matrix to the rotation indicated by the given angle and axis of rotation. Note: This method creates an object, so use fromAngleNormalAxis when possible, particularly if your axis is already normalized.- Parameters:
angle
- the angle to rotate (in radians).axis
- the axis of rotation.- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if axis is null.
-
fromAngleNormalAxis
Sets this matrix to the rotation indicated by the given angle and a unit-length axis of rotation.- Parameters:
angle
- the angle to rotate (in radians).axis
- the axis of rotation (already normalized).- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if axis is null.
-
fromAngles
XXX: Need to redo this again... or at least correct the terms. YRP are arbitrary terms, based on a specific frame of axis. Updates this matrix from the given Euler rotation angles (y,r,p). Note that we are applying in order: roll, pitch, yaw but we've ordered them in x, y, and z for convenience. See: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToMatrix/index.htm- Parameters:
yaw
- the Euler yaw of rotation (in radians). (aka Bank, often rot around x)roll
- the Euler roll of rotation (in radians). (aka Heading, often rot around y)pitch
- the Euler pitch of rotation (in radians). (aka Attitude, often rot around z)- Returns:
- this matrix for chaining
-
applyRotation
-
applyRotationX
Apply rotation around X (Mrx * this)- Parameters:
angle
- the rotation angle- Returns:
- this matrix for chaining
-
applyRotationY
Apply rotation around Y (Mry * this)- Parameters:
angle
- the rotation angle- Returns:
- this matrix for chaining
-
applyRotationZ
Apply rotation around Z (Mrz * this)- Parameters:
angle
- the rotation angle- Returns:
- this matrix for chaining
-
getColumn
- Specified by:
getColumn
in interfaceReadOnlyMatrix3
- Parameters:
index
- the index of the columnstore
- the vector object to store the result in. if null, a new one is created.- Returns:
- the column specified by the index.
- Throws:
IllegalArgumentException
- if index is not in bounds [0, 2]
-
getRow
- Specified by:
getRow
in interfaceReadOnlyMatrix3
- Parameters:
index
- the index of the rowstore
- the vector object to store the result in. if null, a new one is created.- Returns:
- the row specified by the index.
- Throws:
IllegalArgumentException
- if index is not in bounds [0, 2]
-
toDoubleBuffer
- Specified by:
toDoubleBuffer
in interfaceReadOnlyMatrix3
- Parameters:
store
- the buffer to store our matrix data in. Must not be null. Data is entered starting at current buffer position.- Returns:
- matrix data as a DoubleBuffer in row major order. The position is at the end of the inserted data.
- Throws:
NullPointerException
- if store is null.BufferOverflowException
- if there is not enough room left in the buffer to write all 9 values.
-
toDoubleBuffer
- Specified by:
toDoubleBuffer
in interfaceReadOnlyMatrix3
- Parameters:
store
- the buffer to store our matrix data in. Must not be null. Data is entered starting at current buffer position.rowMajor
- if true, data is stored row by row. Otherwise it is stored column by column.- Returns:
- matrix data as a DoubleBuffer in the specified order. The position is at the end of the inserted data.
- Throws:
NullPointerException
- if store is null.BufferOverflowException
- if there is not enough room left in the buffer to write all 9 values.
-
toFloatBuffer
Note: data is cast to floats.- Specified by:
toFloatBuffer
in interfaceReadOnlyMatrix3
- Parameters:
store
- the buffer to store our matrix data in. Must not be null. Data is entered starting at current buffer position.- Returns:
- matrix data as a FloatBuffer in row major order. The position is at the end of the inserted data.
- Throws:
NullPointerException
- if store is null.BufferOverflowException
- if there is not enough room left in the buffer to write all 9 values.
-
toFloatBuffer
Note: data is cast to floats.- Specified by:
toFloatBuffer
in interfaceReadOnlyMatrix3
- Parameters:
store
- the buffer to store our matrix data in. Must not be null. Data is entered starting at current buffer position.rowMajor
- if true, data is stored row by row. Otherwise it is stored column by column.- Returns:
- matrix data as a FloatBuffer in the specified order. The position is at the end of the inserted data.
- Throws:
NullPointerException
- if store is null.BufferOverflowException
- if there is not enough room left in the buffer to write all 9 values.
-
toArray
public double[] toArray(double[] store) - Specified by:
toArray
in interfaceReadOnlyMatrix3
- Parameters:
store
- the double array to store our matrix data in. If null, a new array is created.- Returns:
- matrix data as a double array in row major order.
- Throws:
IllegalArgumentException
- if the store is non-null and has a length < 9
-
toArray
public double[] toArray(double[] store, boolean rowMajor) - Specified by:
toArray
in interfaceReadOnlyMatrix3
- Parameters:
store
- the double array to store our matrix data in. If null, a new array is created.rowMajor
- if true, data is stored row by row. Otherwise it is stored column by column.- Returns:
- matrix data as a double array in the specified order.
- Throws:
IllegalArgumentException
- if the store is non-null and has a length < 9
-
toAngles
public double[] toAngles(double[] store) converts this matrix to Euler rotation angles (yaw, roll, pitch). See http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm- Specified by:
toAngles
in interfaceReadOnlyMatrix3
- Parameters:
store
- the double[] array to store the computed angles in. If null, a new double[] will be created- Returns:
- the double[] array.
- Throws:
IllegalArgumentException
- if non-null store is not at least length 3- See Also:
-
multiplyLocal
- Parameters:
matrix
- the matrix- Returns:
- This matrix for chaining, modified internally to reflect multiplication against the given matrix
- Throws:
NullPointerException
- if matrix is null
-
multiply
- Specified by:
multiply
in interfaceReadOnlyMatrix3
- Parameters:
matrix
- the matrixstore
- a matrix to store the result in. if null, a new matrix is created. It is safe for the given matrix and this parameter to be the same object.- Returns:
- this matrix multiplied by the given matrix.
- Throws:
NullPointerException
- if matrix is null.
-
multiplyDiagonalPre
Multiplies this matrix by the diagonal matrix formed by the given vector (v^D * M). If supplied, the result is stored into the supplied "store" matrix.- Specified by:
multiplyDiagonalPre
in interfaceReadOnlyMatrix3
- Parameters:
vec
- the vectorstore
- a matrix to store the result in. If store is null, a new matrix is created. Note that it IS safe for vec and store to be the same object.- Returns:
- the store matrix, or a new matrix if store is null.
- Throws:
NullPointerException
- if vec is null
-
multiplyDiagonalPost
Multiplies this matrix by the diagonal matrix formed by the given vector (M * v^D). If supplied, the result is stored into the supplied "store" matrix.- Specified by:
multiplyDiagonalPost
in interfaceReadOnlyMatrix3
- Parameters:
vec
- the vectorstore
- a matrix to store the result in. If store is null, a new matrix is created. Note that it IS safe for vec and store to be the same object.- Returns:
- the store matrix, or a new matrix if store is null.
- Throws:
NullPointerException
- if vec is null
-
multiplyLocal
Internally scales all values of this matrix by the given scalar.- Parameters:
scalar
- the scalar value- Returns:
- this matrix for chaining.
-
add
- Specified by:
add
in interfaceReadOnlyMatrix3
- Parameters:
matrix
- the matrix to add to this.store
- a matrix to store the result in. If store is null, a new matrix is created. Note that it IS safe for matrix and store to be the same object.- Returns:
- the result.
- Throws:
NullPointerException
- if matrix is null
-
addLocal
Internally adds the values of the given matrix to this matrix.- Parameters:
matrix
- the matrix to add to this.- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if matrix is null
-
subtract
- Specified by:
subtract
in interfaceReadOnlyMatrix3
- Parameters:
matrix
- the matrix to subtract from this.store
- a matrix to store the result in. If store is null, a new matrix is created. Note that it IS safe for matrix and store to be the same object.- Returns:
- the result.
- Throws:
NullPointerException
- if matrix is null
-
subtractLocal
Internally subtracts the values of the given matrix from this matrix.- Parameters:
matrix
- the matrix to subtract from this.- Returns:
- this matrix for chaining
- Throws:
NullPointerException
- if matrix is null
-
scale
Applies the given scale to this matrix and returns the result as a new matrix- Specified by:
scale
in interfaceReadOnlyMatrix3
- Parameters:
scale
- the scale valuestore
- a matrix to store the result in. If store is null, a new matrix is created.- Returns:
- the new matrix
- Throws:
NullPointerException
- if scale is null.
-
scaleLocal
Applies the given scale to this matrix values internally- Parameters:
scale
- the scale value- Returns:
- this matrix for chaining.
- Throws:
NullPointerException
- if scale is null.
-
transpose
transposes this matrix as a new matrix, basically flipping it across the diagonal- Specified by:
transpose
in interfaceReadOnlyMatrix3
- Parameters:
store
- a matrix to store the result in. If store is null, a new matrix is created.- Returns:
- this matrix for chaining.
- See Also:
-
transposeLocal
transposes this matrix in place- Returns:
- this matrix for chaining.
- See Also:
-
invert
- Specified by:
invert
in interfaceReadOnlyMatrix3
- Parameters:
store
- a matrix to store the result in. If store is null, a new matrix is created. Note that it IS safe for store == this.- Returns:
- a matrix that represents this matrix, inverted. if store is not null and is read only
- Throws:
ArithmeticException
- if this matrix can not be inverted.
-
invertLocal
Inverts this matrix locally.- Returns:
- this matrix inverted internally.
- Throws:
ArithmeticException
- if this matrix can not be inverted.
-
adjugate
- Specified by:
adjugate
in interfaceReadOnlyMatrix3
- Parameters:
store
- The matrix to store the result in. If null, a new matrix is created.- Returns:
- The adjugate, or classical adjoint, of this matrix
- See Also:
-
adjugateLocal
- Returns:
- this matrix, modified to represent its adjugate, or classical adjoint
- See Also:
-
determinant
public double determinant()- Specified by:
determinant
in interfaceReadOnlyMatrix3
- Returns:
- the determinate of this 3x3 matrix (aei+bfg+cdh-ceg-bdi-afh)
- See Also:
-
fromStartEndLocal
A function for creating a rotation matrix that rotates a vector called "start" into another vector called "end".- Parameters:
start
- normalized non-zero starting vectorend
- normalized non-zero ending vector- Returns:
- this matrix, for chaining
- See Also:
-
applyPre
Multiplies the given vector by this matrix (v * M). If supplied, the result is stored into the supplied "store" vector.- Specified by:
applyPre
in interfaceReadOnlyMatrix3
- Parameters:
vec
- the vector to multiply this matrix by.store
- a vector to store the result in. If store is null, a new vector is created. Note that it IS safe for vec and store to be the same object.- Returns:
- the store vector, or a new vector if store is null.
- Throws:
NullPointerException
- if vec is null
-
applyPost
Multiplies the given vector by this matrix (M * v). If supplied, the result is stored into the supplied "store" vector.- Specified by:
applyPost
in interfaceReadOnlyMatrix3
- Parameters:
vec
- the vector to multiply this matrix by.store
- a vector to store the result in. If store is null, a new vector is created. Note that it IS safe for vec and store to be the same object.- Returns:
- the store vector, or a new vector if store is null.
- Throws:
NullPointerException
- if vec is null
-
lookAt
Modifies this matrix to equal the rotation required to point the z-axis at 'direction' and the y-axis to 'up'.- Parameters:
direction
- where to 'look' atup
- a vector indicating the local up direction.- Returns:
- this matrix for chaining
-
isValid
Check a matrix... if it is null or its doubles are NaN or infinite, return false. Else return true.- Parameters:
matrix
- the vector to check- Returns:
- true or false as stated above.
-
isOrthonormal
public boolean isOrthonormal()- Specified by:
isOrthonormal
in interfaceReadOnlyMatrix3
- Returns:
- true if this Matrix is orthonormal - its rows are orthogonal, unit vectors.
-
toString
-
hashCode
public int hashCode() -
equals
-
strictEquals
- Parameters:
o
- the object to compare for equality- Returns:
- true if this matrix and the provided matrix have the exact same double values.
-
clone
- Specified by:
clone
in interfaceReadOnlyMatrix3
- Overrides:
clone
in classObject
-
getClassTag
- Specified by:
getClassTag
in interfaceSavable
-
write
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
readExternal
Used with serialization. Not to be called manually.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- ObjectInput- Throws:
IOException
- if something wrong occurs while readingClassNotFoundException
- if a class is not found
-
writeExternal
Used with serialization. Not to be called manually.- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- ObjectOutput- Throws:
IOException
- if something wrong occurs while writing
-
fetchTempInstance
- Returns:
- An instance of Matrix3 that is intended for temporary use in calculations and so forth. Multiple calls to the method should return instances of this class that are not currently in use.
-
releaseTempInstance
Releases a Matrix3 back to be used by a future call to fetchTempInstance. TAKE CARE: this Matrix3 object should no longer have other classes referencing it or "Bad Things" will happen.- Parameters:
mat
- the Matrix3 to release.
-