This repository was archived by the owner on Dec 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
VRageMath.Matrix
Morten Aune Lyrstad edited this page Feb 17, 2020
·
54 revisions
← Index ← Namespace Index
public struct Matrix: IEquatable<VRageMath.Matrix>Defines a matrix.
Namespace: VRageMath
Assembly: VRage.Math.dll
Implements:
| Member | Description |
|---|---|
| M11 | Value at row 1 column 1 of the matrix. |
| M12 | Value at row 1 column 2 of the matrix. |
| M13 | Value at row 1 column 3 of the matrix. |
| M14 | Value at row 1 column 4 of the matrix. |
| M21 | Value at row 2 column 1 of the matrix. |
| M22 | Value at row 2 column 2 of the matrix. |
| M23 | Value at row 2 column 3 of the matrix. |
| M24 | Value at row 2 column 4 of the matrix. |
| M31 | Value at row 3 column 1 of the matrix. |
| M32 | Value at row 3 column 2 of the matrix. |
| M33 | Value at row 3 column 3 of the matrix. |
| M34 | Value at row 3 column 4 of the matrix. |
| M41 | Value at row 4 column 1 of the matrix. |
| M42 | Value at row 4 column 2 of the matrix. |
| M43 | Value at row 4 column 3 of the matrix. |
| M44 | Value at row 4 column 4 of the matrix. |
| Identity | |
| Zero |
| Member | Description |
|---|---|
| Up { get; set; } | Gets and sets the up vector of the Matrix. |
| Down { get; set; } | Gets and sets the down vector of the Matrix. |
| Right { get; set; } | Gets and sets the right vector of the Matrix. |
| Col0 { get; } | |
| Col1 { get; } | |
| Col2 { get; } | |
| Left { get; set; } | Gets and sets the left vector of the Matrix. |
| Forward { get; set; } | Gets and sets the forward vector of the Matrix. |
| Backward { get; set; } | Gets and sets the backward vector of the Matrix. |
| Scale { get; } | |
| Translation { get; set; } | Gets and sets the translation vector of the Matrix. |
| Item { get; set; } |
| Member | Description |
|---|---|
| Subtract(ref Matrix, ref Matrix, out Matrix) | Subtracts matrices. |
| Multiply(Matrix, Matrix) | Multiplies a matrix by another matrix. |
| Multiply(ref Matrix, ref Matrix, out Matrix) | Multiplies a matrix by another matrix. |
| MultiplyRotation(ref Matrix, ref Matrix, out Matrix) | Multiplies a matrix by another matrix, only rotation parts. |
| Multiply(Matrix, float) | Multiplies a matrix by a scalar value. |
| Multiply(ref Matrix, float, out Matrix) | Multiplies a matrix by a scalar value. |
| Divide(Matrix, Matrix) | Divides the components of a matrix by the corresponding components of another matrix. |
| Divide(ref Matrix, ref Matrix, out Matrix) | Divides the components of a matrix by the corresponding components of another matrix. |
| Divide(Matrix, float) | Divides the components of a matrix by a scalar. |
| Divide(ref Matrix, float, out Matrix) | Divides the components of a matrix by a scalar. |
| GetOrientation() | Gets the orientation. |
| AssertIsValid() | |
| IsValid() | |
| IsNan() | |
| IsRotation() | |
| HasNoTranslationOrPerspective() | Returns true if this matrix represents invertible (you can call Invert on it) linear (it does not contain translation or perspective transformation) transformation. Such matrix consist solely of rotations, shearing, mirroring and scaling. It can be orthogonalized to create an orthogonal rotation matrix. |
| CreateFromDir(Vector3) | |
| CreateFromDir(Vector3, Vector3) | |
| Normalize(Matrix) | |
| Orthogonalize(Matrix) | |
| Round(ref Matrix) | |
| AlignRotationToAxes(ref Matrix, ref Matrix) | |
| GetEulerAnglesXYZ(ref Matrix, out Vector3) | |
| SwapYZCoordinates(Matrix) | |
| IsMirrored() | |
| IsOrthogonal() | |
| GetDirectionVector(Direction) | |
| SetDirectionVector(Direction, Vector3) | |
| GetClosestDirection(Vector3) | |
| GetClosestDirection(ref Vector3) | |
| Rescale(ref Matrix, float) | Same result as Matrix.CreateScale(scale) * matrix, but much faster |
| Rescale(ref Matrix, ref Vector3) | Same result as Matrix.CreateScale(scale) * matrix, but much faster |
| Rescale(Matrix, float) | |
| Rescale(Matrix, Vector3) | |
| CreateBillboard(Vector3, Vector3, Vector3, Vector3?) | Creates a spherical billboard that rotates around a specified object position. |
| CreateBillboard(ref Vector3, ref Vector3, ref Vector3, Vector3?, out Matrix) | 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. |
| CreateConstrainedBillboard(ref Vector3, ref Vector3, ref Vector3, Vector3?, Vector3?, out Matrix) | Creates a cylindrical billboard that rotates around a specified axis. |
| CreateTranslation(Vector3) | Creates a translation Matrix. |
| CreateTranslation(ref Vector3, out Matrix) | Creates a translation Matrix. |
| CreateTranslation(float, float, float) | Creates a translation Matrix. |
| CreateTranslation(float, float, float, out Matrix) | Creates a translation Matrix. |
| CreateScale(float, float, float) | Creates a scaling Matrix. |
| CreateScale(float, float, float, out Matrix) | Creates a scaling Matrix. |
| CreateScale(Vector3) | Creates a scaling Matrix. |
| CreateScale(ref Vector3, out Matrix) | Creates a scaling Matrix. |
| CreateScale(float) | Creates a scaling Matrix. |
| CreateScale(float, out Matrix) | Creates a scaling Matrix. |
| CreateRotationX(float) | Returns a matrix that can be used to rotate a set of vertices around the x-axis. |
| CreateRotationX(float, out Matrix) | Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis. |
| CreateRotationY(float) | Returns a matrix that can be used to rotate a set of vertices around the y-axis. |
| CreateRotationY(float, out Matrix) | Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis. |
| CreateRotationZ(float) | Returns a matrix that can be used to rotate a set of vertices around the z-axis. |
| CreateRotationZ(float, out Matrix) | Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis. |
| CreateFromAxisAngle(Vector3, float) | Creates a new Matrix that rotates around an arbitrary vector. |
| CreateFromAxisAngle(ref Vector3, float, out Matrix) | Creates a new Matrix that rotates around an arbitrary vector. |
| CreateRotationFromTwoVectors(ref Vector3, ref Vector3, out Matrix) | |
| CreatePerspectiveFieldOfView(float, float, float, float) | Builds a perspective projection matrix based on a field of view and returns by value. |
| CreatePerspectiveFovRhComplementary(float, float, float, float) | |
| CreatePerspectiveFovRhInfinite(float, float, float) | |
| CreatePerspectiveFovRhInfiniteComplementary(float, float, float) | |
| CreatePerspectiveFovRhInverse(float, float, float, float) | |
| CreatePerspectiveFovRhInfiniteInverse(float, float, float) | |
| CreatePerspectiveFovRhInfiniteComplementaryInverse(float, float, float) | |
| CreateFromPerspectiveFieldOfView(ref Matrix, float, float) | |
| CreatePerspectiveFieldOfView(float, float, float, float, out Matrix) | Builds a perspective projection matrix based on a field of view and returns by reference. |
| CreatePerspective(float, float, float, float) | Builds a perspective projection matrix and returns the result by value. |
| CreatePerspective(float, float, float, float, out Matrix) | Builds a perspective projection matrix and returns the result by reference. |
| CreatePerspectiveOffCenter(float, float, float, float, float, float) | Builds a customized, perspective projection matrix. |
| CreatePerspectiveOffCenter(float, float, float, float, float, float, out Matrix) | Builds a customized, perspective projection matrix. |
| CreateOrthographic(float, float, float, float) | Builds an orthogonal projection matrix. |
| CreateOrthographic(float, float, float, float, out Matrix) | Builds an orthogonal projection matrix. |
| CreateOrthographicOffCenter(float, float, float, float, float, float) | Builds a customized, orthogonal projection matrix. |
| CreateOrthographicOffCenter(float, float, float, float, float, float, out Matrix) | Builds a customized, orthogonal projection matrix. |
| CreateLookAt(Vector3, Vector3, Vector3) | Creates a view matrix. |
| CreateLookAtInverse(Vector3, Vector3, Vector3) | |
| CreateLookAt(ref Vector3, ref Vector3, ref Vector3, out Matrix) | Creates a view matrix. |
| CreateWorld(Vector3) | |
| CreateWorld(Vector3, Vector3, Vector3) | Creates a world matrix with the specified parameters. |
| CreateWorld(ref Vector3, ref Vector3, ref Vector3, out Matrix) | Creates a world matrix with the specified parameters. |
| CreateFromQuaternion(Quaternion) | Creates a rotation Matrix from a Quaternion. |
| CreateFromQuaternion(ref Quaternion, out Matrix) | Creates a rotation Matrix from a Quaternion. |
| CreateFromYawPitchRoll(float, float, float) | Creates a new rotation matrix from a specified yaw, pitch, and roll. |
| CreateFromYawPitchRoll(float, float, float, out Matrix) | Fills in a rotation matrix from a specified yaw, pitch, and roll. |
| CreateFromTransformScale(Quaternion, Vector3, Vector3) | |
| CreateShadow(Vector3, Plane) | Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source. |
| CreateShadow(ref Vector3, ref Plane, out Matrix) | Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source. |
| CreateReflection(Plane) | Creates a Matrix that reflects the coordinate system about a specified Plane. |
| CreateReflection(ref Plane, out Matrix) | Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane. |
| Transform(Matrix, Quaternion) | Transforms a Matrix by applying a Quaternion rotation. |
| Transform(ref Matrix, ref Quaternion, out Matrix) | Transforms a Matrix by applying a Quaternion rotation. |
| GetRow(int) | |
| SetRow(int, Vector4) | |
| ToString() | Retrieves a string representation of the current object. |
| Equals(Matrix) | Determines whether the specified Object is equal to the Matrix. |
| EqualsFast(ref Matrix, float) | Compares just position, forward and up |
| Equals(object) | Returns a value that indicates whether the current instance is equal to a specified object. |
| GetHashCode() | Gets the hash code of this object. |
| Transpose(Matrix) | Transposes the rows and columns of a matrix. |
| Transpose(ref Matrix, out Matrix) | Transposes the rows and columns of a matrix. |
| TransposeRotationInPlace() | Transposes the rows and columns of a matrix that is assumed to be rotation only in place. |
| Determinant() | Calculates the determinant of the matrix. |
| Invert(Matrix) | Calculates the inverse of a matrix. |
| Invert(ref Matrix) | |
| Invert(ref Matrix, out Matrix) | Calculates the inverse of a matrix. |
| Lerp(Matrix, Matrix, float) | Linearly interpolates between the corresponding values of two matrices. |
| Lerp(ref Matrix, ref Matrix, float, out Matrix) | Linearly interpolates between the corresponding values of two matrices. |
| Slerp(ref Matrix, ref Matrix, float, out Matrix) | Performs spherical linear interpolation of position and rotation. |
| SlerpScale(ref Matrix, ref Matrix, float, out Matrix) | Performs spherical linear interpolation of position and rotation and scale. |
| Slerp(Matrix, Matrix, float, out Matrix) | Performs spherical linear interpolation of position and rotation. |
| Slerp(Matrix, Matrix, float) | Performs spherical linear interpolation of position and rotation. |
| SlerpScale(Matrix, Matrix, float, out Matrix) | Performs spherical linear interpolation of position and rotation and scale. |
| SlerpScale(Matrix, Matrix, float) | Performs spherical linear interpolation of position and rotation and scale. |
| Negate(Matrix) | Negates individual elements of a matrix. |
| Negate(ref Matrix, out Matrix) | Negates individual elements of a matrix. |
| Add(Matrix, Matrix) | Adds a matrix to another matrix. |
| Add(ref Matrix, ref Matrix, out Matrix) | Adds a matrix to another matrix. |
| Subtract(Matrix, Matrix) | Subtracts matrices. |
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!