public class Matrix3 extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Matrix3 |
IDENTITY
the identity matrix.
|
double |
m00
The values of the matrix.
|
double |
m01 |
double |
m02 |
double |
m10
The values of the matrix.
|
double |
m11 |
double |
m12 |
double |
m20
The values of the matrix.
|
double |
m21 |
double |
m22 |
Constructor and Description |
---|
Matrix3()
Creates an identity matrix.
|
Matrix3(double[] values)
Creates a matrix from an array of values.
|
Matrix3(double m00,
double m10,
double m20,
double m01,
double m11,
double m21,
double m02,
double m12,
double m22)
Creates a matrix from its components.
|
Matrix3(Matrix3 other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Matrix3 |
add(pythagoras.d.IMatrix3 other)
Adds this matrix to another.
|
Matrix3 |
add(pythagoras.d.IMatrix3 other,
Matrix3 result)
Adds this matrix to another and stores the result in the object provided.
|
Matrix3 |
addLocal(pythagoras.d.IMatrix3 other)
Adds
other to this matrix, in place. |
double |
approximateUniformScale()
Returns an approximation of the uniform scale for this matrix (the square root of the
signed area of the parallelogram spanned by the axis vectors).
|
double |
element(int row,
int col)
Returns the matrix element at the specified row and column.
|
boolean |
equals(Object other) |
double |
extractRotation()
Extracts the rotation component of the matrix.
|
Vector |
extractScale()
Extracts the scale component of the matrix.
|
Vector |
extractScale(Vector result)
Extracts the scale component of the matrix and places it in the provided result vector.
|
DoubleBuffer |
get(DoubleBuffer buf)
Places the contents of this matrix into the given buffer in the standard OpenGL order.
|
void |
getColumn(int col,
Vector3 result)
Copies the requested column (0, 1, 2) into
result . |
void |
getRow(int row,
Vector3 result)
Copies the requested row (0, 1, 2) into
result . |
int |
hashCode() |
Matrix3 |
invert()
Inverts this matrix.
|
Matrix3 |
invert(Matrix3 result)
Inverts this matrix and places the result in the given object.
|
Matrix3 |
invertAffine()
Inverts this matrix as an affine matrix.
|
Matrix3 |
invertAffine(Matrix3 result)
Inverts this matrix as an affine matrix and places the result in the given object.
|
Matrix3 |
invertAffineLocal()
Inverts this matrix in-place as an affine matrix.
|
Matrix3 |
invertLocal()
Inverts this matrix in-place.
|
boolean |
isAffine()
Determines whether this matrix represents an affine transformation.
|
Matrix3 |
lerp(pythagoras.d.IMatrix3 other,
double t)
Linearly interpolates between this and the specified other matrix.
|
Matrix3 |
lerp(pythagoras.d.IMatrix3 other,
double t,
Matrix3 result)
Linearly interpolates between this and the specified other matrix, placing the result in
the object provided.
|
Matrix3 |
lerpAffine(pythagoras.d.IMatrix3 other,
double t)
Linearly interpolates between this and the specified other matrix, treating the matrices as
affine.
|
Matrix3 |
lerpAffine(pythagoras.d.IMatrix3 other,
double t,
Matrix3 result)
Linearly interpolates between this and the specified other matrix (treating the matrices as
affine), placing the result in the object provided.
|
Matrix3 |
lerpAffineLocal(pythagoras.d.IMatrix3 other,
double t)
Linearly interpolates between this and the specified other matrix (treating the matrices as
affine), placing the result in this matrix.
|
Matrix3 |
lerpLocal(pythagoras.d.IMatrix3 other,
double t)
Linearly interpolates between the this and the specified other matrix, placing the result in
this matrix.
|
double |
m00()
Returns column 0, row 0 of the matrix.
|
double |
m01()
Returns column 0, row 1 of the matrix.
|
double |
m02()
Returns column 0, row 2 of the matrix.
|
double |
m10()
Returns column 1, row 0 of the matrix.
|
double |
m11()
Returns column 1, row 1 of the matrix.
|
double |
m12()
Returns column 1, row 2 of the matrix.
|
double |
m20()
Returns column 2, row 0 of the matrix.
|
double |
m21()
Returns column 2, row 1 of the matrix.
|
double |
m22()
Returns column 2, row 2 of the matrix.
|
Matrix3 |
mult(pythagoras.d.IMatrix3 other)
Multiplies this matrix by another.
|
Matrix3 |
mult(pythagoras.d.IMatrix3 other,
Matrix3 result)
Multiplies this matrix by another and stores the result in the object provided.
|
Matrix3 |
multAffine(pythagoras.d.IMatrix3 other)
Multiplies this matrix by another, treating the matrices as affine.
|
Matrix3 |
multAffine(pythagoras.d.IMatrix3 other,
Matrix3 result)
Multiplies this matrix by another, treating the matrices as affine, and stores the result
in the object provided.
|
Matrix3 |
multAffineLocal(pythagoras.d.IMatrix3 other)
Multiplies this matrix in-place by another, treating the matricees as affine.
|
Matrix3 |
multLocal(pythagoras.d.IMatrix3 other)
Multiplies this matrix in-place by another.
|
Matrix3 |
set(double[] values)
Copies the elements of an array.
|
Matrix3 |
set(double m00,
double m10,
double m20,
double m01,
double m11,
double m21,
double m02,
double m12,
double m22)
Sets all of the matrix's components at once.
|
Matrix3 |
set(pythagoras.d.IMatrix3 other)
Copies the contents of another matrix.
|
void |
setColumn(int col,
double x,
double y,
double z)
Sets the specified column (0, 1, 2) to the supplied values.
|
void |
setColumn(int col,
Vector3 v)
Sets the specified column (0, 1, 2) to the supplied vector.
|
void |
setElement(int row,
int col,
double value)
Sets the matrix element at the specified row and column.
|
void |
setRow(int row,
double x,
double y,
double z)
Sets the specified row (0, 1, 2) to the supplied values.
|
void |
setRow(int row,
Vector3 v)
Sets the specified row (0, 1, 2) to the supplied vector.
|
Matrix3 |
setToIdentity()
Sets this matrix to the identity matrix.
|
Matrix3 |
setToReflection(double x,
double y,
double z)
Sets this to a reflection across a plane intersecting the origin with the supplied normal.
|
Matrix3 |
setToReflection(IVector3 normal)
Sets this to a reflection across a plane intersecting the origin with the supplied normal.
|
Matrix3 |
setToRotation(double angle)
Sets this to a rotation matrix.
|
Matrix3 |
setToRotation(double angle,
double x,
double y,
double z)
Sets this to a rotation matrix.
|
Matrix3 |
setToRotation(double angle,
IVector3 axis)
Sets this to a rotation matrix.
|
Matrix3 |
setToRotation(IQuaternion quat)
Sets this to a rotation matrix.
|
Matrix3 |
setToRotation(IVector3 from,
IVector3 to)
Sets this to a rotation matrix that rotates one vector onto another.
|
Matrix3 |
setToScale(double s)
Sets this to a uniform scale matrix.
|
Matrix3 |
setToScale(double x,
double y,
double z)
Sets this to a scale matrix.
|
Matrix3 |
setToScale(IVector3 scale)
Sets this to a scale matrix.
|
Matrix3 |
setToTransform(IVector translation,
double rotation)
Sets this to a matrix that first rotates, then translates.
|
Matrix3 |
setToTransform(IVector translation,
double rotation,
double scale)
Sets this to a matrix that first scales, then rotates, then translates.
|
Matrix3 |
setToTransform(IVector translation,
double rotation,
IVector scale)
Sets this to a matrix that first scales, then rotates, then translates.
|
Matrix3 |
setToTranslation(double x,
double y)
Sets this to a translation matrix.
|
Matrix3 |
setToTranslation(IVector translation)
Sets this to a translation matrix.
|
Matrix3 |
setToZero()
Sets this matrix to all zeroes.
|
Matrix3 |
setTranslation(double x,
double y)
Sets the translation component of this matrix.
|
Matrix3 |
setTranslation(IVector translation)
Sets the translation component of this matrix.
|
String |
toString() |
Vector3 |
transform(IVector3 vector)
Transforms a vector by this matrix.
|
Vector3 |
transform(IVector3 vector,
Vector3 result)
Transforms a vector by this matrix and places the result in the object provided.
|
Vector3 |
transformLocal(Vector3 vector)
Transforms a vector in-place by the inner 3x3 part of this matrix.
|
Vector |
transformPoint(IVector point)
Transforms a point by this matrix.
|
Vector |
transformPoint(IVector point,
Vector result)
Transforms a point by this matrix and places the result in the object provided.
|
Vector |
transformPointLocal(Vector point)
Transforms a point in-place by this matrix.
|
Vector |
transformVector(IVector vector)
Transforms a vector by this inner 2x2 part of this matrix.
|
Vector |
transformVector(IVector vector,
Vector result)
Transforms a vector by the inner 2x2 part of this matrix and places the result in the object
provided.
|
Vector |
transformVectorLocal(Vector vector)
Transforms a vector in-place by the inner 2x2 part of this matrix.
|
Matrix3 |
transpose()
Transposes this matrix.
|
Matrix3 |
transpose(Matrix3 result)
Transposes this matrix, storing the result in the provided object.
|
Matrix3 |
transposeLocal()
Transposes this matrix in-place.
|
public static final Matrix3 IDENTITY
public double m00
mCOLROW
.public double m10
mCOLROW
.public double m20
mCOLROW
.public double m01
public double m11
public double m21
public double m02
public double m12
public double m22
public Matrix3(double m00, double m10, double m20, double m01, double m11, double m21, double m02, double m12, double m22)
public Matrix3(double[] values)
public Matrix3(Matrix3 other)
public Matrix3()
public void setElement(int row, int col, double value)
public void setRow(int row, double x, double y, double z)
public void setRow(int row, Vector3 v)
public void setColumn(int col, double x, double y, double z)
public void setColumn(int col, Vector3 v)
public Matrix3 setToIdentity()
public Matrix3 setToZero()
public Matrix3 setToRotation(IVector3 from, IVector3 to)
public Matrix3 setToRotation(double angle, IVector3 axis)
public Matrix3 setToRotation(double angle, double x, double y, double z)
public Matrix3 setToRotation(IQuaternion quat)
public Matrix3 setToScale(IVector3 scale)
public Matrix3 setToScale(double s)
public Matrix3 setToScale(double x, double y, double z)
public Matrix3 setToReflection(IVector3 normal)
public Matrix3 setToReflection(double x, double y, double z)
public Matrix3 setToTransform(IVector translation, double rotation)
public Matrix3 setToTransform(IVector translation, double rotation, double scale)
public Matrix3 setToTransform(IVector translation, double rotation, IVector scale)
public Matrix3 setToTranslation(IVector translation)
public Matrix3 setToTranslation(double x, double y)
public Matrix3 setTranslation(IVector translation)
public Matrix3 setTranslation(double x, double y)
public Matrix3 setToRotation(double angle)
public Matrix3 transposeLocal()
public Matrix3 multLocal(pythagoras.d.IMatrix3 other)
public Matrix3 addLocal(pythagoras.d.IMatrix3 other)
other
to this matrix, in place.public Matrix3 multAffineLocal(pythagoras.d.IMatrix3 other)
public Matrix3 invertLocal()
public Matrix3 invertAffineLocal()
public Matrix3 lerpLocal(pythagoras.d.IMatrix3 other, double t)
public Matrix3 lerpAffineLocal(pythagoras.d.IMatrix3 other, double t)
public Matrix3 set(pythagoras.d.IMatrix3 other)
public Matrix3 set(double[] values)
public Matrix3 set(double m00, double m10, double m20, double m01, double m11, double m21, double m02, double m12, double m22)
public double m00()
public double m10()
public double m20()
public double m01()
public double m11()
public double m21()
public double m02()
public double m12()
public double m22()
public double element(int row, int col)
public void getRow(int row, Vector3 result)
result
.public void getColumn(int col, Vector3 result)
result
.public Matrix3 transpose()
public Matrix3 transpose(Matrix3 result)
public Matrix3 mult(pythagoras.d.IMatrix3 other)
public Matrix3 mult(pythagoras.d.IMatrix3 other, Matrix3 result)
public Matrix3 add(pythagoras.d.IMatrix3 other)
public Matrix3 add(pythagoras.d.IMatrix3 other, Matrix3 result)
public boolean isAffine()
public Matrix3 multAffine(pythagoras.d.IMatrix3 other)
public Matrix3 multAffine(pythagoras.d.IMatrix3 other, Matrix3 result)
public Matrix3 invert()
public Matrix3 invert(Matrix3 result) throws SingularMatrixException
SingularMatrixException
public Matrix3 invertAffine()
public Matrix3 invertAffine(Matrix3 result) throws SingularMatrixException
SingularMatrixException
public Matrix3 lerp(pythagoras.d.IMatrix3 other, double t)
public Matrix3 lerp(pythagoras.d.IMatrix3 other, double t, Matrix3 result)
public Matrix3 lerpAffine(pythagoras.d.IMatrix3 other, double t)
public Matrix3 lerpAffine(pythagoras.d.IMatrix3 other, double t, Matrix3 result)
public DoubleBuffer get(DoubleBuffer buf)
public Vector3 transformLocal(Vector3 vector)
public Vector3 transform(IVector3 vector)
public Vector3 transform(IVector3 vector, Vector3 result)
public Vector transformPointLocal(Vector point)
public Vector transformPoint(IVector point)
public Vector transformPoint(IVector point, Vector result)
public Vector transformVectorLocal(Vector vector)
public Vector transformVector(IVector vector)
public Vector transformVector(IVector vector, Vector result)
public double extractRotation()
public Vector extractScale()
public Vector extractScale(Vector result)
public double approximateUniformScale()
Copyright © 2017. All rights reserved.