A 4x4 matrix with 64-bit floating-point precision.
struct
|
Mat4F
|
implements
|
IEquatable<Mat4F>
|
/ \ | M11 M12 M13 M14 | | M21 M22 M23 M24 | | M31 M32 M33 M34 | | M41 M42 M43 M44 | \ /
The serialization helper object for values of Mat4F.
public
static
readonly
field
|
Serializer
|
||
type
|
ITypeSerializer<Mat4F>
|
The identity matrix.
public
static
readonly
field
|
Identity
|
||
type
|
Mat4F
|
The zero matrix.
public
static
readonly
field
|
Zero
|
||
type
|
Mat4F
|
Returns the determinant of this matrix.
public
property
|
Determinant
{
get
}
|
||
type
|
float32
|
||
value
|
The determinant value. |
Returns the inverse of this matrix.
public
property
|
Inverse
{
get
}
|
||
type
|
Mat4F
|
||
value
|
The inverse matrix. |
Matrix component in first row, first column.
public
readonly
field
|
M11
|
||
type
|
float32
|
Matrix component in first row, second column.
public
readonly
field
|
M12
|
||
type
|
float32
|
Matrix component in first row, third column.
public
readonly
field
|
M13
|
||
type
|
float32
|
Matrix component in first row, fourth column.
public
readonly
field
|
M14
|
||
type
|
float32
|
Matrix component in second row, first column.
public
readonly
field
|
M21
|
||
type
|
float32
|
Matrix component in second row, second column.
public
readonly
field
|
M22
|
||
type
|
float32
|
Matrix component in second row, third column.
public
readonly
field
|
M23
|
||
type
|
float32
|
Matrix component in second row, fourth column.
public
readonly
field
|
M24
|
||
type
|
float32
|
Matrix component in third row, first column.
public
readonly
field
|
M31
|
||
type
|
float32
|
Matrix component in third row, second column.
public
readonly
field
|
M32
|
||
type
|
float32
|
Matrix component in third row, third column.
public
readonly
field
|
M33
|
||
type
|
float32
|
Matrix component in third row, fourth column.
public
readonly
field
|
M34
|
||
type
|
float32
|
Matrix component in fourth row, first column.
public
readonly
field
|
M41
|
||
type
|
float32
|
Matrix component in fourth row, second column.
public
readonly
field
|
M42
|
||
type
|
float32
|
Matrix component in fourth row, third column.
public
readonly
field
|
M43
|
||
type
|
float32
|
Matrix component in fourth row, fourth column.
public
readonly
field
|
M44
|
||
type
|
float32
|
Returns the transpose of this matrix.
public
property
|
Transpose
{
get
}
|
||
type
|
Mat4F
|
||
value
|
The transposed matrix. |
Creates a new instance of Mat4F.
public
constructor
|
Mat4F
(float32 m11,
float32 m12,
float32 m13,
float32 m14,
float32 m21,
float32 m22,
float32 m23,
float32 m24,
float32 m31,
float32 m32,
float32 m33,
float32 m34,
float32 m41,
float32 m42,
float32 m43,
float32 m44)
|
||
params
|
m11
|
Matrix component in first row, first column. | |
m12
|
Matrix component in first row, second column. | ||
m13
|
Matrix component in first row, third column. | ||
m14
|
Matrix component in first row, fourth column. | ||
m21
|
Matrix component in second row, first column. | ||
m22
|
Matrix component in second row, second column. | ||
m23
|
Matrix component in second row, third column. | ||
m24
|
Matrix component in second row, fourth column. | ||
m31
|
Matrix component in third row, first column. | ||
m32
|
Matrix component in third row, second column. | ||
m33
|
Matrix component in third row, third column. | ||
m34
|
Matrix component in third row, fourth column. | ||
m41
|
Matrix component in fourth row, first column. | ||
m42
|
Matrix component in fourth row, second column. | ||
m43
|
Matrix component in fourth row, third column. | ||
m44
|
Matrix component in fourth row, fourth column. |
public
method
|
Equals
(Mat4F other)
|
||
type
|
bool
|
||
params
|
other
|
public
method
|
EqualsAlmost
(Mat4F other)
|
||
type
|
bool
|
||
params
|
other
|
Performs a component-wise linear interpolation between this matrix and the given one.
[Pure]
|
||||
public
method
|
Lerp
(Mat4F other,
float32 factor)
|
|||
type
|
Mat4F
|
|||
params
|
other
|
The other matrix. | ||
factor
|
The
interpolation
factor
(0 :
this,
1 :
other).
|
|||
returns
|
The resulting matrix. |
Multiplies
this
matrix
(left-side)
with
the
given
one
(right-side):
result
=
this
*
m
.
[Pure]
|
||||
public
method
|
Mul
(Mat4F m)
|
|||
type
|
Mat4F
|
|||
params
|
m
|
The matrix. | ||
returns
|
The resulting matrix. |
Multiplies
this
matrix
(left-side)
with
the
given
3D
vector
(right-side):
result
=
this
*
v
.
[Pure]
|
||||
public
method
|
Mul3
(Vec3F v,
float32 w)
|
|||
type
|
Vec3F
|
|||
params
|
v
|
The vector. | ||
w
|
The W-component to assume. | |||
returns
|
The
resulting
vector,
scaled
by
1/result.W . |
Multiplies
this
matrix
(left-side)
with
the
given
3D
vector
(right-side):
result
=
this
*
v
.
[Pure]
|
||||
public
method
|
Mul3
(float32 x,
float32 y,
float32 z,
float32 w)
|
|||
type
|
Vec3F
|
|||
params
|
x
|
X-component of vector. | ||
y
|
Y-component of vector. | |||
z
|
Z-component of vector. | |||
w
|
The W-component to assume. | |||
returns
|
The
resulting
vector,
scaled
by
1/result.W . |
Multiplies
this
matrix
(left-side)
with
the
given
4F
vector
(right-side):
result
=
this
*
v
.
[Pure]
|
||||
public
method
|
Mul4
(Vec4F v)
|
|||
type
|
Vec4F
|
|||
params
|
v
|
The vector. | ||
returns
|
The resulting vector. |
Multiplies
this
matrix
(left-side)
with
the
given
4F
vector
(right-side):
result
=
this
*
v
.
[Pure]
|
||||
public
method
|
Mul4
(float32 x,
float32 y,
float32 z,
float32 w)
|
|||
type
|
Vec4F
|
|||
params
|
x
|
X-component of vector. | ||
y
|
Y-component of vector. | |||
z
|
Z-component of vector. | |||
w
|
W-component of vector. | |||
returns
|
The resulting vector. |
public
static
method
|
Rotate
(Vec3F axis,
float32 angle)
|
||
type
|
Mat4F
|
||
params
|
axis
|
||
angle
|
public
static
method
|
Rotate
(float32 x,
float32 y,
float32 z,
float32 angle)
|
||
type
|
Mat4F
|
||
params
|
x
|
||
y
|
|||
z
|
|||
angle
|
Returns a rotation matrix (counter-clockwise around X-axis).
public
static
method
|
RotateX
(float32 angle)
|
||
type
|
Mat4F
|
||
params
|
angle
|
The rotation angle, in radians. | |
returns
|
The resulting matrix. |
Returns a rotation matrix (counter-clockwise around Y-axis).
public
static
method
|
RotateY
(float32 angle)
|
||
type
|
Mat4F
|
||
params
|
angle
|
The rotation angle, in radians. | |
returns
|
The resulting matrix. |
Returns a rotation matrix (counter-clockwise around Z-axis).
public
static
method
|
RotateZ
(float32 angle)
|
||
type
|
Mat4F
|
||
params
|
angle
|
The rotation angle, in radians. | |
returns
|
The resulting matrix. |
Returns a scaling matrix.
public
static
method
|
Scale
(float32 f)
|
||
type
|
Mat4F
|
||
params
|
f
|
The scale factor. | |
returns
|
The resulting matrix. |
Returns a scaling matrix.
public
static
method
|
Scale
(Vec4F f)
|
||
type
|
Mat4F
|
||
params
|
f
|
The scale factors. | |
returns
|
The resulting matrix. |
Returns a scaling matrix.
public
static
method
|
Scale
(float32 fx,
float32 fy,
float32 fz,
float32 fw)
|
||
type
|
Mat4F
|
||
params
|
fx
|
The scale factor along the X-axis. | |
fy
|
The scale factor along the Y-axis. | ||
fz
|
The scale factor along the Z-axis. | ||
fw
|
The scale factor along the W-axis. | ||
returns
|
The resulting matrix. |
Copies matrix elements to the given array.
[Pure]
|
||||
public
method
|
ToArray
([]
float32[] values,
int32 offset = 0,
int32 strideRow = 4,
int32 strideCol = 1)
|
|||
params
|
values
|
[not-null]
|
The output array. | |
offset
|
Offset
into
values
to
top-left
matrix
element.
Defaults
to
0 .
|
|||
strideRow
|
Array
index
distance
between
matrix
rows.
Defaults
to
4 .
|
|||
strideCol
|
Array
index
distance
between
matrix
columns.
Defaults
to
1 .
|
Remarks:
The method uses the following indexing scheme to write values to values:
values[offset + (row - 1) * strideRow + (col - 1) * strideCol := matrix[row, col];where
row
and
col
depict
the
matrix
row
and
column
number
(starting
at
1
).
Returns a translation matrix.
public
static
method
|
Translate
(Vec3F v)
|
||
type
|
Mat4F
|
||
params
|
v
|
The translation vector. | |
returns
|
The translation matrix. |
Returns a translation matrix.
public
static
method
|
Translate
(float32 x,
float32 y,
float32 z)
|
||
type
|
Mat4F
|
||
params
|
x
|
X-component of translation vector. | |
y
|
Y-component of translation vector. | ||
z
|
Z-component of translation vector. | ||
returns
|
The translation matrix. |