Matrix4x4 结构
定义
表示 4x4 矩阵。Represents a 4x4 matrix.
public value class Matrix4x4 : IEquatable<System::Numerics::Matrix4x4>
public struct Matrix4x4 : IEquatable<System.Numerics.Matrix4x4>
type Matrix4x4 = struct
Public Structure Matrix4x4
Implements IEquatable(Of Matrix4x4)
- 继承
- 实现
注解
对于矩阵转换,Vector2、Vector3 和 Vector4 实例表示为行:矩阵 M 使用 vM 乘法转换矢量 v。For matrix transformations, the Vector2, Vector3, and Vector4 instances are represented as rows: a vector v is transformed by a matrix M with vM multiplication.
构造函数
Matrix4x4(Matrix3x2) |
从指定的 Matrix3x2 对象创建 Matrix4x4 对象。Creates a Matrix4x4 object from a specified Matrix3x2 object. |
Matrix4x4(Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single) |
从指定分量创建 4x4 矩阵。Creates a 4x4 matrix from the specified components. |
字段
M11 |
第一行的第一个元素。The first element of the first row. |
M12 |
第一行的第二个元素。The second element of the first row. |
M13 |
第一行的第三个元素。The third element of the first row. |
M14 |
第一行的第四个元素。The fourth element of the first row. |
M21 |
第二行的第一个元素。The first element of the second row. |
M22 |
第二行的第二个元素。The second element of the second row. |
M23 |
第二行的第三个元素。The third element of the second row. |
M24 |
第二行的第四个元素。The fourth element of the second row. |
M31 |
第三行的第一个元素。The first element of the third row. |
M32 |
第三行的第二个元素。The second element of the third row. |
M33 |
第三行的第三个元素。The third element of the third row. |
M34 |
第三行的第四个元素。The fourth element of the third row. |
M41 |
第四行的第一个元素。The first element of the fourth row. |
M42 |
第四行的第二个元素。The second element of the fourth row. |
M43 |
第四行的第三个元素。The third element of the fourth row. |
M44 |
第四行的第四个元素。The fourth element of the fourth row. |
属性
Identity |
获取乘法单位矩阵。Gets the multiplicative identity matrix. |
IsIdentity |
指示当前矩阵是否为单位矩阵。Indicates whether the current matrix is the identity matrix. |
Translation |
获取或设置此矩阵的平移分量。Gets or sets the translation component of this matrix. |
方法
Add(Matrix4x4, Matrix4x4) |
将一个矩阵中的每个元素与第二个矩阵中的对应元素相加。Adds each element in one matrix with its corresponding element in a second matrix. |
CreateBillboard(Vector3, Vector3, Vector3, Vector3) |
创建围绕指定对象位置旋转的球状宣传位置。Creates a spherical billboard that rotates around a specified object position. |
CreateConstrainedBillboard(Vector3, Vector3, Vector3, Vector3, Vector3) |
创建围绕指定轴旋转的圆柱宣传位置。Creates a cylindrical billboard that rotates around a specified axis. |
CreateFromAxisAngle(Vector3, Single) |
创建围绕任意向量旋转的矩阵。Creates a matrix that rotates around an arbitrary vector. |
CreateFromQuaternion(Quaternion) |
从指定四元数旋转值创建旋转矩阵。Creates a rotation matrix from the specified Quaternion rotation value. |
CreateFromYawPitchRoll(Single, Single, Single) |
从指定的绕 Y 轴旋转、绕 X 轴旋转和绕 Z 轴旋转创建旋转矩阵。Creates a rotation matrix from the specified yaw, pitch, and roll. |
CreateLookAt(Vector3, Vector3, Vector3) |
创建视图矩阵。Creates a view matrix. |
CreateOrthographic(Single, Single, Single, Single) |
从给定视图体维度创建正交透视矩阵。Creates an orthographic perspective matrix from the given view volume dimensions. |
CreateOrthographicOffCenter(Single, Single, Single, Single, Single, Single) |
创建自定义正交投影矩阵。Creates a customized orthographic projection matrix. |
CreatePerspective(Single, Single, Single, Single) |
从给定视图体维度创建透视投影矩阵。Creates a perspective projection matrix from the given view volume dimensions. |
CreatePerspectiveFieldOfView(Single, Single, Single, Single) |
基于视野、纵横比以及近和远视图平面距离创建透视投影矩阵。Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. |
CreatePerspectiveOffCenter(Single, Single, Single, Single, Single, Single) |
创建自定义透视投影矩阵。Creates a customized perspective projection matrix. |
CreateReflection(Plane) |
创建围绕指定平面反射坐标系统的矩阵。Creates a matrix that reflects the coordinate system about a specified plane. |
CreateRotationX(Single) |
创建用于围绕 X 轴旋转的矩阵。Creates a matrix for rotating points around the X axis. |
CreateRotationX(Single, Vector3) |
创建用于从中心点围绕 X 轴旋转的矩阵。Creates a matrix for rotating points around the X axis from a center point. |
CreateRotationY(Single) |
创建用于围绕 Y 轴旋转的矩阵。Creates a matrix for rotating points around the Y axis. |
CreateRotationY(Single, Vector3) |
要从中心点围绕 Y 轴旋转的量(以弧度表示)。The amount, in radians, by which to rotate around the Y axis from a center point. |
CreateRotationZ(Single) |
创建用于围绕 Z 轴旋转的矩阵。Creates a matrix for rotating points around the Z axis. |
CreateRotationZ(Single, Vector3) |
创建用于从中心点围绕 Z 轴旋转的矩阵。Creates a matrix for rotating points around the Z axis from a center point. |
CreateScale(Single) |
创建在每个轴上均匀缩放的统一缩放矩阵。Creates a uniform scaling matrix that scale equally on each axis. |
CreateScale(Single, Single, Single) |
从指定 X、Y 和 Z 分量创建缩放矩阵。Creates a scaling matrix from the specified X, Y, and Z components. |
CreateScale(Single, Single, Single, Vector3) |
创建按给定中心点偏移的缩放矩阵。Creates a scaling matrix that is offset by a given center point. |
CreateScale(Single, Vector3) |
创建具有中心点并且在每个轴上均匀缩放的统一缩放矩阵。Creates a uniform scaling matrix that scales equally on each axis with a center point. |
CreateScale(Vector3) |
从指定向量比例创建缩放矩阵。Creates a scaling matrix from the specified vector scale. |
CreateScale(Vector3, Vector3) |
创建具有中心点的缩放矩阵。Creates a scaling matrix with a center point. |
CreateShadow(Vector3, Plane) |
创建将几何图形平展到指定平面中(如同从指定光源进行投影)的矩阵。Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. |
CreateTranslation(Single, Single, Single) |
从指定 X、Y 和 Z 分量创建平移矩阵。Creates a translation matrix from the specified X, Y, and Z components. |
CreateTranslation(Vector3) |
从指定三维向量创建平移矩阵。Creates a translation matrix from the specified 3-dimensional vector. |
CreateWorld(Vector3, Vector3, Vector3) |
使用指定参数创建世界矩阵。Creates a world matrix with the specified parameters. |
Decompose(Matrix4x4, Vector3, Quaternion, Vector3) |
尝试从给定缩放、旋转或平移矩阵中提取缩放、平移和旋转分量。Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. 返回值指示操作是否成功。The return value indicates whether the operation succeeded. |
Equals(Matrix4x4) |
返回一个值,该值指示此实例是否与另一个 4x4 矩阵相等。Returns a value that indicates whether this instance and another 4x4 matrix are equal. |
Equals(Object) |
返回一个值,该值指示此实例是否与指定对象相等。Returns a value that indicates whether this instance and a specified object are equal. |
GetDeterminant() |
计算当前 4x4 矩阵的行列式。Calculates the determinant of the current 4x4 matrix. |
GetHashCode() |
返回此实例的哈希代码。Returns the hash code for this instance. |
Invert(Matrix4x4, Matrix4x4) |
对指定矩阵求逆。Inverts the specified matrix. 返回值指示操作是否成功。The return value indicates whether the operation succeeded. |
Lerp(Matrix4x4, Matrix4x4, Single) |
基于指定第二个矩阵的权重的值,从一个矩阵向第二个矩阵执行线性内插。Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. |
Multiply(Matrix4x4, Matrix4x4) |
返回将两个矩阵相乘得到的矩阵。Returns the matrix that results from multiplying two matrices together. |
Multiply(Matrix4x4, Single) |
返回按标量系数缩放指定矩阵的所有元素后得到的矩阵。Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. |
Negate(Matrix4x4) |
通过将其所有值乘以 -1,对指定矩阵求反。Negates the specified matrix by multiplying all its values by -1. |
Subtract(Matrix4x4, Matrix4x4) |
从第一个矩阵中的每个元素中减去第二个矩阵中的对应元素。Subtracts each element in a second matrix from its corresponding element in a first matrix. |
ToString() |
返回表示此矩阵的字符串。Returns a string that represents this matrix. |
Transform(Matrix4x4, Quaternion) |
通过应用指定四元数旋转来转换指定矩阵。Transforms the specified matrix by applying the specified Quaternion rotation. |
Transpose(Matrix4x4) |
转置矩阵的行和列。Transposes the rows and columns of a matrix. |
运算符
Addition(Matrix4x4, Matrix4x4) |
将一个矩阵中的每个元素与第二个矩阵中的对应元素相加。Adds each element in one matrix with its corresponding element in a second matrix. |
Equality(Matrix4x4, Matrix4x4) |
返回一个值,该值指示指定矩阵是否相等。Returns a value that indicates whether the specified matrices are equal. |
Inequality(Matrix4x4, Matrix4x4) |
返回一个值,该值指示指定矩阵是否不相等。Returns a value that indicates whether the specified matrices are not equal. |
Multiply(Matrix4x4, Matrix4x4) |
返回将两个矩阵相乘得到的矩阵。Returns the matrix that results from multiplying two matrices together. |
Multiply(Matrix4x4, Single) |
返回按标量系数缩放指定矩阵的所有元素后得到的矩阵。Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. |
Subtraction(Matrix4x4, Matrix4x4) |
从第一个矩阵中的每个元素中减去第二个矩阵中的对应元素。Subtracts each element in a second matrix from its corresponding element in a first matrix. |
UnaryNegation(Matrix4x4) |
通过将其所有值乘以 -1,对指定矩阵求反。Negates the specified matrix by multiplying all its values by -1. |