Modifier and Type | Field and Description |
---|---|
float[] |
mat |
Constructor and Description |
---|
Mat()
Constructor for an identity matrix.
|
Mat(float[] data)
Same as
this(data, false) . |
Mat(float[] data,
boolean transposed)
Sets the matrix contents from the 16 entry float array.
|
Mat(float _m0,
float _m1,
float _m2,
float _m3,
float _m4,
float _m5,
float _m6,
float _m7,
float _m8,
float _m9,
float _m10,
float _m11,
float _m12,
float _m13,
float _m14,
float _m15)
16 consecutive values that are used as the elements of a 4 x 4 column-major matrix.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(float[] source)
Multiply this matrix by the 16 consecutive float array defined by
source . |
void |
apply(float m0,
float m1,
float m2,
float m3,
float m4,
float m5,
float m6,
float m7,
float m8,
float m9,
float m10,
float m11,
float m12,
float m13,
float m14,
float m15)
Multiply this matrix by the 16 consecutive values that are used as the elements of a
4 x 4 column-major matrix.
|
void |
apply(Mat source)
Multiply this matrix by the one defined from
source . |
void |
applyTransposed(float[] rowMajor)
Multiply this matrix by the transposed matrix defined from the 16 consecutive float
source array. |
void |
applyTransposed(float n00,
float n01,
float n02,
float n03,
float n10,
float n11,
float n12,
float n13,
float n20,
float n21,
float n22,
float n23,
float n30,
float n31,
float n32,
float n33)
Multiply this matrix by the 16 consecutive values that are used as the elements of a
4 x 4 row-major matrix.
|
float |
determinant() |
boolean |
equals(Object obj) |
Mat |
get()
Returns a copy of this Matrix.
|
float[] |
get(float[] target)
Copies the matrix contents into a 16 entry float array.
|
float[] |
getData()
Retubs the matrix contents as a 16 entry float array.
|
float[] |
getTransposed(float[] rowMajor)
Copies the transposed matrix contents into a 16 entry float array.
|
int |
hashCode()
Array col major representation
|
boolean |
invert()
Invert this matrix.
|
boolean |
invert(Mat m)
Invert this matrix into
m , i.e., doesn't modify this matrix. |
void |
link(float[] source)
Share the src array data.
|
float |
m00()
Sets the 1st-row, 1st-column matrix entry.
|
float |
m01()
Returns the 1st-row, 2nd-column matrix entry.
|
float |
m02()
Returns the 1st-row, 3rd-column matrix entry.
|
float |
m03()
Returns the 1st-row, 4th-column matrix entry.
|
float |
m10()
Returns the 2nd-row, 1st-column matrix entry.
|
float |
m11()
Returns the 2nd-row, 2nd-column matrix entry.
|
float |
m12()
Returns the 2nd-row, 3rd-column matrix entry.
|
float |
m13()
Returns the 2nd-row, 4th-column matrix entry.
|
float |
m20()
Returns the 3rd-row, 1st-column matrix entry.
|
float |
m21()
Returns the 3rd-row, 2nd-column matrix entry.
|
float |
m22()
Returns the 3rd-row, 3rd-column matrix entry.
|
float |
m23()
Returns the 3rd-row, 4th-column matrix entry.
|
float |
m30()
Returns the 4th-row, 1st-column matrix entry.
|
float |
m31()
Returns the 4th-row, 2nd-column matrix entry.
|
float |
m32()
Returns the 4th-row, 3rd-column matrix entry.
|
float |
m33()
Returns the 4th-row, 4th-column matrix entry.
|
float[] |
multiply(float[] source,
float[] target)
Multiply a three or four element vector against this matrix.
|
static Mat |
multiply(Mat a,
Mat b)
Returns
a x b . |
static void |
multiply(Mat a,
Mat b,
Mat c)
Define
c as a x b . |
Vec |
multiply(Vec source)
Same as
return multiply(source, null) . |
Vec |
multiply(Vec source,
Vec target)
Multiply this matrix by the
source Vec and stores the result in the
target Vec which is then returned. |
void |
preApply(float[] source)
Pre-multiply this matrix by the 16 consecutive float array defined by
source . |
void |
preApply(float m0,
float m1,
float m2,
float m3,
float m4,
float m5,
float m6,
float m7,
float m8,
float m9,
float m10,
float m11,
float m12,
float m13,
float m14,
float m15)
Pre-multiply this matrix by the 16 consecutive values that are used as the elements
of a 4 x 4 column-major matrix.
|
void |
preApply(Mat left)
Pre-multiply this matrix by the one defined from
source . |
void |
preApplyTransposed(float[] rowMajor)
Pre-multiply this matrix by the transposed matrix defined from the 16 consecutive
float
rowMajor array. |
void |
preApplyTransposed(float n00,
float n01,
float n02,
float n03,
float n10,
float n11,
float n12,
float n13,
float n20,
float n21,
float n22,
float n23,
float n30,
float n31,
float n32,
float n33)
Pre-multiply this matrix by the 16 consecutive values that are used as the elements
of a 4 x 4 row-major matrix.
|
void |
print()
Print this matrix contents onto the console.
|
void |
reset()
Sets the identity matrix.
|
void |
rotate(float angle)
Same as
rotateZ(angle) . |
void |
rotate(float angle,
float v0,
float v1,
float v2)
Multiply this matrix by the rotation matrix defined from the
(v0,v1,v2) and
angle . |
void |
rotateX(float angle)
Multiply this matrix by the rotation around x-axis matrix defined from
angle . |
void |
rotateY(float angle)
Multiply this matrix by the rotation around y-axis matrix defined from
angle . |
void |
rotateZ(float angle)
Multiply this matrix by the rotation around z-axis matrix defined from
angle . |
void |
scale(float s)
Multiply this matrix by the scaling matrix defined from
s . |
void |
scale(float sx,
float sy)
Multiply this matrix by the scaling matrix defined from
sx and sy . |
void |
scale(float x,
float y,
float z)
Multiply this matrix by the scaling matrix defined from
x , y and
z . |
void |
set(float[] source)
Sets representation from the array data
|
void |
set(float _m0,
float _m1,
float _m2,
float _m3,
float _m4,
float _m5,
float _m6,
float _m7,
float _m8,
float _m9,
float _m10,
float _m11,
float _m12,
float _m13,
float _m14,
float _m15)
Sets the column-major matrix contents from the given 16 consecutive values.
|
void |
set(Linkable src)
Links array data representation with the source
|
void |
set(Mat src)
Sets the matrix contents from the
src matrix contents. |
void |
setM00(float v)
Sets the 1st-row, 1st-column matrix entry.
|
void |
setM01(float v)
Sets the 1st-row, 2nd-column matrix entry.
|
void |
setM02(float v)
Sets the 1st-row, 3rd-column matrix entry.
|
void |
setM03(float v)
Sets the 1st-row, 4th-column matrix entry.
|
void |
setM10(float v)
Sets the 2nd-row, 1st-column matrix entry.
|
void |
setM11(float v)
Sets the 2nd-row, 2nd-column matrix entry.
|
void |
setM12(float v)
Sets the 2nd-row, 3rd-column matrix entry.
|
void |
setM13(float v)
Sets the 2nd-row, 4th-column matrix entry.
|
void |
setM20(float v)
Sets the 3rd-row, 1st-column matrix entry.
|
void |
setM21(float v)
Sets the 3rd-row, 2nd-column matrix entry.
|
void |
setM22(float v)
Sets the 3rd-row, 3rd-column matrix entry.
|
void |
setM23(float v)
Sets the 3rd-row, 4th-column matrix entry.
|
void |
setM30(float v)
Sets the 4th-row, 1st-column matrix entry.
|
void |
setM31(float v)
Sets the 4th-row, 2nd-column matrix entry.
|
void |
setM32(float v)
Sets the 4th-row, 3rd-column matrix entry.
|
void |
setM33(float v)
Sets the 4th-row, 4th-column matrix entry.
|
void |
setTransposed(float[] rowMajor)
Sets the row-major matrix contents from the given 16 consecutive values.
|
void |
setTransposed(float _m00,
float _m01,
float _m02,
float _m03,
float _m10,
float _m11,
float _m12,
float _m13,
float _m20,
float _m21,
float _m22,
float _m23,
float _m30,
float _m31,
float _m32,
float _m33)
Sets the matrix contents from the given elements where first "index" is row, second
is column, e.g., _m20 corresponds to the element located at the third row and first
column of the matrix.
|
void |
shearX(float angle)
Multiply this matrix by the x-shearing matrix defined from
angle . |
void |
shearY(float angle)
Multiply this matrix by the y-shearing matrix defined from
angle . |
void |
translate(float tx,
float ty)
Same as
translate(tx, ty, 0 . |
void |
translate(float tx,
float ty,
float tz)
Multiply this matrix by the translation matrix defined from
tx , ty
and tz . |
void |
transpose()
Transpose this matrix.
|
void |
unLink()
Stop sharing data with the source
|
public Mat()
public Mat(float _m0, float _m1, float _m2, float _m3, float _m4, float _m5, float _m6, float _m7, float _m8, float _m9, float _m10, float _m11, float _m12, float _m13, float _m14, float _m15)
public Mat(float[] data)
this(data, false)
.Mat(float[], boolean)
public Mat(float[] data, boolean transposed)
transpose
is false
the matrix contents are set in column major order, otherwise they're set in row-major
order.public void setM00(float v)
public void setM01(float v)
public void setM02(float v)
public void setM03(float v)
public void setM10(float v)
public void setM11(float v)
public void setM12(float v)
public void setM13(float v)
public void setM20(float v)
public void setM21(float v)
public void setM22(float v)
public void setM23(float v)
public void setM30(float v)
public void setM31(float v)
public void setM32(float v)
public void setM33(float v)
public float m00()
public float m01()
public float m02()
public float m03()
public float m10()
public float m11()
public float m12()
public float m13()
public float m20()
public float m21()
public float m22()
public float m23()
public float m30()
public float m31()
public float m32()
public float m33()
public float[] getData()
public void link(float[] source)
Linkable
public void unLink()
Linkable
public Mat get()
public float[] get(float[] target)
public float[] getTransposed(float[] rowMajor)
public void set(Linkable src)
Linkable
public void set(Mat src)
src
matrix contents.public void set(float[] source)
Linkable
public void setTransposed(float[] rowMajor)
set(float[])
public void set(float _m0, float _m1, float _m2, float _m3, float _m4, float _m5, float _m6, float _m7, float _m8, float _m9, float _m10, float _m11, float _m12, float _m13, float _m14, float _m15)
public void setTransposed(float _m00, float _m01, float _m02, float _m03, float _m10, float _m11, float _m12, float _m13, float _m20, float _m21, float _m22, float _m23, float _m30, float _m31, float _m32, float _m33)
public void translate(float tx, float ty)
translate(tx, ty, 0
.public void translate(float tx, float ty, float tz)
tx
, ty
and tz
.public void rotate(float angle)
rotateZ(angle)
.rotateZ(float)
public void rotateX(float angle)
angle
.public void rotateY(float angle)
angle
.public void rotateZ(float angle)
angle
.public void rotate(float angle, float v0, float v1, float v2)
(v0,v1,v2)
and
angle
.public void scale(float s)
s
.public void scale(float sx, float sy)
sx
and sy
.public void scale(float x, float y, float z)
x
, y
and
z
.public void shearX(float angle)
angle
.public void shearY(float angle)
angle
.public void apply(float[] source)
source
.public void applyTransposed(float[] rowMajor)
source
array.public void apply(Mat source)
source
.public void apply(float m0, float m1, float m2, float m3, float m4, float m5, float m6, float m7, float m8, float m9, float m10, float m11, float m12, float m13, float m14, float m15)
public void applyTransposed(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
public void preApply(float[] source)
source
.public void preApplyTransposed(float[] rowMajor)
rowMajor
array.public void preApply(Mat left)
source
.public void preApply(float m0, float m1, float m2, float m3, float m4, float m5, float m6, float m7, float m8, float m9, float m10, float m11, float m12, float m13, float m14, float m15)
public void preApplyTransposed(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
public Vec multiply(Vec source)
return multiply(source, null)
.multiply(Vec, Vec)
public Vec multiply(Vec source, Vec target)
source
Vec and stores the result in the
target
Vec which is then returned.public float[] multiply(float[] source, float[] target)
public void transpose()
public boolean invert(Mat m)
m
, i.e., doesn't modify this matrix.
m
should be non-null.
public boolean invert()
public float determinant()
public void print()
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia