Class Matrix
Defines a matrix.
Inheritance
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public sealed class Matrix : ValueType, IEquatable<Matrix>
Constructors
Matrix(Single, Single, Single, Single, Single, Single, Single, Single, Single)
Initializes a new instance of Matrix with rotation data
Declaration
public Matrix(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)
Parameters
Type | Name | Description |
---|---|---|
System.Single | m11 | Value to initialize m11 to. |
System.Single | m12 | Value to initialize m12 to. |
System.Single | m13 | Value to initialize m13 to. |
System.Single | m21 | Value to initialize m21 to. |
System.Single | m22 | Value to initialize m22 to. |
System.Single | m23 | Value to initialize m23 to. |
System.Single | m31 | Value to initialize m31 to. |
System.Single | m32 | Value to initialize m32 to. |
System.Single | m33 | Value to initialize m33 to. |
Matrix(Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single, Single)
Initializes a new instance of Matrix.
Declaration
public Matrix(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)
Parameters
Type | Name | Description |
---|---|---|
System.Single | m11 | Value to initialize m11 to. |
System.Single | m12 | Value to initialize m12 to. |
System.Single | m13 | Value to initialize m13 to. |
System.Single | m14 | Value to initialize m14 to. |
System.Single | m21 | Value to initialize m21 to. |
System.Single | m22 | Value to initialize m22 to. |
System.Single | m23 | Value to initialize m23 to. |
System.Single | m24 | Value to initialize m24 to. |
System.Single | m31 | Value to initialize m31 to. |
System.Single | m32 | Value to initialize m32 to. |
System.Single | m33 | Value to initialize m33 to. |
System.Single | m34 | Value to initialize m34 to. |
System.Single | m41 | Value to initialize m41 to. |
System.Single | m42 | Value to initialize m42 to. |
System.Single | m43 | Value to initialize m43 to. |
System.Single | m44 | Value to initialize m44 to. |
Matrix(MatrixD)
Declaration
public Matrix(MatrixD other)
Parameters
Type | Name | Description |
---|---|---|
MatrixD | other |
Fields
Identity
Declaration
public static Matrix Identity
Field Value
Type | Description |
---|---|
Matrix |
M11
Value at row 1 column 1 of the matrix.
Declaration
public float M11
Field Value
Type | Description |
---|---|
System.Single |
M12
Value at row 1 column 2 of the matrix.
Declaration
public float M12
Field Value
Type | Description |
---|---|
System.Single |
M13
Value at row 1 column 3 of the matrix.
Declaration
public float M13
Field Value
Type | Description |
---|---|
System.Single |
M14
Value at row 1 column 4 of the matrix.
Declaration
public float M14
Field Value
Type | Description |
---|---|
System.Single |
M21
Value at row 2 column 1 of the matrix.
Declaration
public float M21
Field Value
Type | Description |
---|---|
System.Single |
M22
Value at row 2 column 2 of the matrix.
Declaration
public float M22
Field Value
Type | Description |
---|---|
System.Single |
M23
Value at row 2 column 3 of the matrix.
Declaration
public float M23
Field Value
Type | Description |
---|---|
System.Single |
M24
Value at row 2 column 4 of the matrix.
Declaration
public float M24
Field Value
Type | Description |
---|---|
System.Single |
M31
Value at row 3 column 1 of the matrix.
Declaration
public float M31
Field Value
Type | Description |
---|---|
System.Single |
M32
Value at row 3 column 2 of the matrix.
Declaration
public float M32
Field Value
Type | Description |
---|---|
System.Single |
M33
Value at row 3 column 3 of the matrix.
Declaration
public float M33
Field Value
Type | Description |
---|---|
System.Single |
M34
Value at row 3 column 4 of the matrix.
Declaration
public float M34
Field Value
Type | Description |
---|---|
System.Single |
M41
Value at row 4 column 1 of the matrix.
Declaration
public float M41
Field Value
Type | Description |
---|---|
System.Single |
M42
Value at row 4 column 2 of the matrix.
Declaration
public float M42
Field Value
Type | Description |
---|---|
System.Single |
M43
Value at row 4 column 3 of the matrix.
Declaration
public float M43
Field Value
Type | Description |
---|---|
System.Single |
M44
Value at row 4 column 4 of the matrix.
Declaration
public float M44
Field Value
Type | Description |
---|---|
System.Single |
Zero
Declaration
public static Matrix Zero
Field Value
Type | Description |
---|---|
Matrix |
Properties
Backward
Gets and sets the backward vector of the Matrix.
Declaration
public Vector3 Backward { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Col0
Declaration
public Vector3 Col0 { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Col1
Declaration
public Vector3 Col1 { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Col2
Declaration
public Vector3 Col2 { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Down
Gets and sets the down vector of the Matrix.
Declaration
public Vector3 Down { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Forward
Gets and sets the forward vector of the Matrix.
Declaration
public Vector3 Forward { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Item[Int32, Int32]
Declaration
public float this[int row, int column] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | |
System.Int32 | column |
Property Value
Type | Description |
---|---|
System.Single |
Left
Gets and sets the left vector of the Matrix.
Declaration
public Vector3 Left { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Right
Gets and sets the right vector of the Matrix.
Declaration
public Vector3 Right { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Scale
Declaration
public Vector3 Scale { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Translation
Gets and sets the translation vector of the Matrix.
Declaration
public Vector3 Translation { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Up
Gets and sets the up vector of the Matrix.
Declaration
public Vector3 Up { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Methods
Add(Matrix, Matrix)
Adds a matrix to another matrix.
Declaration
public static Matrix Add(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Add(ref Matrix, ref Matrix, out Matrix)
Adds a matrix to another matrix.
Declaration
public static void Add(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Matrix | result | [OutAttribute] Resulting matrix. |
AlignRotationToAxes(ref Matrix, ref Matrix)
Declaration
public static Matrix AlignRotationToAxes(ref Matrix toAlign, ref Matrix axisDefinitionMatrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | toAlign | |
Matrix | axisDefinitionMatrix |
Returns
Type | Description |
---|---|
Matrix |
AssertIsValid()
Declaration
public void AssertIsValid()
CreateBillboard(Vector3, Vector3, Vector3, Nullable<Vector3>)
Creates a spherical billboard that rotates around a specified object position.
Declaration
public static Matrix CreateBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 cameraUpVector, Nullable<Vector3> cameraForwardVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | objectPosition | Position of the object the billboard will rotate around. |
Vector3 | cameraPosition | Position of the camera. |
Vector3 | cameraUpVector | The up vector of the camera. |
System.Nullable<Vector3> | cameraForwardVector | Optional forward vector of the camera. |
Returns
Type | Description |
---|---|
Matrix |
CreateBillboard(ref Vector3, ref Vector3, ref Vector3, Nullable<Vector3>, out Matrix)
Creates a spherical billboard that rotates around a specified object position.
Declaration
public static void CreateBillboard(ref Vector3 objectPosition, ref Vector3 cameraPosition, ref Vector3 cameraUpVector, Nullable<Vector3> cameraForwardVector, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | objectPosition | Position of the object the billboard will rotate around. |
Vector3 | cameraPosition | Position of the camera. |
Vector3 | cameraUpVector | The up vector of the camera. |
System.Nullable<Vector3> | cameraForwardVector | Optional forward vector of the camera. |
Matrix | result | [OutAttribute] The created billboard matrix. |
CreateConstrainedBillboard(Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>)
Creates a cylindrical billboard that rotates around a specified axis.
Declaration
public static Matrix CreateConstrainedBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 rotateAxis, Nullable<Vector3> cameraForwardVector, Nullable<Vector3> objectForwardVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | objectPosition | Position of the object the billboard will rotate around. |
Vector3 | cameraPosition | Position of the camera. |
Vector3 | rotateAxis | Axis to rotate the billboard around. |
System.Nullable<Vector3> | cameraForwardVector | Optional forward vector of the camera. |
System.Nullable<Vector3> | objectForwardVector | Optional forward vector of the object. |
Returns
Type | Description |
---|---|
Matrix |
CreateConstrainedBillboard(ref Vector3, ref Vector3, ref Vector3, Nullable<Vector3>, Nullable<Vector3>, out Matrix)
Creates a cylindrical billboard that rotates around a specified axis.
Declaration
public static void CreateConstrainedBillboard(ref Vector3 objectPosition, ref Vector3 cameraPosition, ref Vector3 rotateAxis, Nullable<Vector3> cameraForwardVector, Nullable<Vector3> objectForwardVector, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | objectPosition | Position of the object the billboard will rotate around. |
Vector3 | cameraPosition | Position of the camera. |
Vector3 | rotateAxis | Axis to rotate the billboard around. |
System.Nullable<Vector3> | cameraForwardVector | Optional forward vector of the camera. |
System.Nullable<Vector3> | objectForwardVector | Optional forward vector of the object. |
Matrix | result | [OutAttribute] The created billboard matrix. |
CreateFromAxisAngle(Vector3, Single)
Creates a new Matrix that rotates around an arbitrary vector.
Declaration
public static Matrix CreateFromAxisAngle(Vector3 axis, float angle)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | axis | The axis to rotate around. |
System.Single | angle | The angle to rotate around the vector. |
Returns
Type | Description |
---|---|
Matrix |
CreateFromAxisAngle(ref Vector3, Single, out Matrix)
Creates a new Matrix that rotates around an arbitrary vector.
Declaration
public static void CreateFromAxisAngle(ref Vector3 axis, float angle, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | axis | The axis to rotate around. |
System.Single | angle | The angle to rotate around the vector. |
Matrix | result | [OutAttribute] The created Matrix. |
CreateFromDir(Vector3)
Declaration
public static Matrix CreateFromDir(Vector3 dir)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | dir |
Returns
Type | Description |
---|---|
Matrix |
CreateFromDir(Vector3, Vector3)
Declaration
public static Matrix CreateFromDir(Vector3 dir, Vector3 suggestedUp)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | dir | |
Vector3 | suggestedUp |
Returns
Type | Description |
---|---|
Matrix |
CreateFromPerspectiveFieldOfView(ref Matrix, Single, Single)
Declaration
public static Matrix CreateFromPerspectiveFieldOfView(ref Matrix proj, float nearPlaneDistance, float farPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
Matrix | proj | |
System.Single | nearPlaneDistance | |
System.Single | farPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreateFromQuaternion(Quaternion)
Creates a rotation Matrix from a Quaternion.
Declaration
public static Matrix CreateFromQuaternion(Quaternion quaternion)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | Quaternion to create the Matrix from. |
Returns
Type | Description |
---|---|
Matrix |
CreateFromQuaternion(ref Quaternion, out Matrix)
Creates a rotation Matrix from a Quaternion.
Declaration
public static void CreateFromQuaternion(ref Quaternion quaternion, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | Quaternion to create the Matrix from. |
Matrix | result | [OutAttribute] The created Matrix. |
CreateFromTransformScale(Quaternion, Vector3, Vector3)
Declaration
public static Matrix CreateFromTransformScale(Quaternion orientation, Vector3 position, Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | orientation | |
Vector3 | position | |
Vector3 | scale |
Returns
Type | Description |
---|---|
Matrix |
CreateFromYawPitchRoll(Single, Single, Single)
Creates a new rotation matrix from a specified yaw, pitch, and roll.
Declaration
public static Matrix CreateFromYawPitchRoll(float yaw, float pitch, float roll)
Parameters
Type | Name | Description |
---|---|---|
System.Single | yaw | Angle of rotation, in radians, around the y-axis. |
System.Single | pitch | Angle of rotation, in radians, around the x-axis. |
System.Single | roll | Angle of rotation, in radians, around the z-axis. |
Returns
Type | Description |
---|---|
Matrix |
CreateFromYawPitchRoll(Single, Single, Single, out Matrix)
Fills in a rotation matrix from a specified yaw, pitch, and roll.
Declaration
public static void CreateFromYawPitchRoll(float yaw, float pitch, float roll, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | yaw | Angle of rotation, in radians, around the y-axis. |
System.Single | pitch | Angle of rotation, in radians, around the x-axis. |
System.Single | roll | Angle of rotation, in radians, around the z-axis. |
Matrix | result | [OutAttribute] An existing matrix filled in to represent the specified yaw, pitch, and roll. |
CreateLookAt(Vector3, Vector3, Vector3)
Creates a view matrix.
Declaration
public static Matrix CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | cameraPosition | The position of the camera. |
Vector3 | cameraTarget | The target towards which the camera is pointing. |
Vector3 | cameraUpVector | The direction that is "up" from the camera's point of view. |
Returns
Type | Description |
---|---|
Matrix |
CreateLookAt(ref Vector3, ref Vector3, ref Vector3, out Matrix)
Creates a view matrix.
Declaration
public static void CreateLookAt(ref Vector3 cameraPosition, ref Vector3 cameraTarget, ref Vector3 cameraUpVector, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | cameraPosition | The position of the camera. |
Vector3 | cameraTarget | The target towards which the camera is pointing. |
Vector3 | cameraUpVector | The direction that is "up" from the camera's point of view. |
Matrix | result | [OutAttribute] The created view matrix. |
CreateLookAtInverse(Vector3, Vector3, Vector3)
Declaration
public static Matrix CreateLookAtInverse(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | cameraPosition | |
Vector3 | cameraTarget | |
Vector3 | cameraUpVector |
Returns
Type | Description |
---|---|
Matrix |
CreateOrthographic(Single, Single, Single, Single)
Builds an orthogonal projection matrix.
Declaration
public static Matrix CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | Width of the view volume. |
System.Single | height | Height of the view volume. |
System.Single | zNearPlane | Minimum z-value of the view volume. |
System.Single | zFarPlane | Maximum z-value of the view volume. |
Returns
Type | Description |
---|---|
Matrix |
CreateOrthographic(Single, Single, Single, Single, out Matrix)
Builds an orthogonal projection matrix.
Declaration
public static void CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | Width of the view volume. |
System.Single | height | Height of the view volume. |
System.Single | zNearPlane | Minimum z-value of the view volume. |
System.Single | zFarPlane | Maximum z-value of the view volume. |
Matrix | result | [OutAttribute] The projection matrix. |
CreateOrthographicOffCenter(Single, Single, Single, Single, Single, Single)
Builds a customized, orthogonal projection matrix.
Declaration
public static Matrix CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane)
Parameters
Type | Name | Description |
---|---|---|
System.Single | left | Minimum x-value of the view volume. |
System.Single | right | Maximum x-value of the view volume. |
System.Single | bottom | Minimum y-value of the view volume. |
System.Single | top | Maximum y-value of the view volume. |
System.Single | zNearPlane | Minimum z-value of the view volume. |
System.Single | zFarPlane | Maximum z-value of the view volume. |
Returns
Type | Description |
---|---|
Matrix |
CreateOrthographicOffCenter(Single, Single, Single, Single, Single, Single, out Matrix)
Builds a customized, orthogonal projection matrix.
Declaration
public static void CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | left | Minimum x-value of the view volume. |
System.Single | right | Maximum x-value of the view volume. |
System.Single | bottom | Minimum y-value of the view volume. |
System.Single | top | Maximum y-value of the view volume. |
System.Single | zNearPlane | Minimum z-value of the view volume. |
System.Single | zFarPlane | Maximum z-value of the view volume. |
Matrix | result | [OutAttribute] The projection matrix. |
CreatePerspective(Single, Single, Single, Single)
Builds a perspective projection matrix and returns the result by value.
Declaration
public static Matrix CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | Width of the view volume at the near view plane. |
System.Single | height | Height of the view volume at the near view plane. |
System.Single | nearPlaneDistance | Distance to the near view plane. |
System.Single | farPlaneDistance | Distance to the far view plane. |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspective(Single, Single, Single, Single, out Matrix)
Builds a perspective projection matrix and returns the result by reference.
Declaration
public static void CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | Width of the view volume at the near view plane. |
System.Single | height | Height of the view volume at the near view plane. |
System.Single | nearPlaneDistance | Distance to the near view plane. |
System.Single | farPlaneDistance | Distance to the far view plane. |
Matrix | result | [OutAttribute] The projection matrix. |
CreatePerspectiveFieldOfView(Single, Single, Single, Single)
Builds a perspective projection matrix based on a field of view and returns by value.
Declaration
public static Matrix CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | Field of view in the y direction, in radians. |
System.Single | aspectRatio | Aspect ratio, defined as view space width divided by height. To match the aspect ratio of the viewport, the property AspectRatio. |
System.Single | nearPlaneDistance | Distance to the near view plane. |
System.Single | farPlaneDistance | Distance to the far view plane. |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveFieldOfView(Single, Single, Single, Single, out Matrix)
Builds a perspective projection matrix based on a field of view and returns by reference.
Declaration
public static void CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | Field of view in the y direction, in radians. |
System.Single | aspectRatio | Aspect ratio, defined as view space width divided by height. To match the aspect ratio of the viewport, the property AspectRatio. |
System.Single | nearPlaneDistance | Distance to the near view plane. |
System.Single | farPlaneDistance | Distance to the far view plane. |
Matrix | result | [OutAttribute] The perspective projection matrix. |
CreatePerspectiveFovRhComplementary(Single, Single, Single, Single)
Declaration
public static Matrix CreatePerspectiveFovRhComplementary(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | |
System.Single | aspectRatio | |
System.Single | nearPlaneDistance | |
System.Single | farPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveFovRhInfinite(Single, Single, Single)
Declaration
public static Matrix CreatePerspectiveFovRhInfinite(float fieldOfView, float aspectRatio, float nearPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | |
System.Single | aspectRatio | |
System.Single | nearPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveFovRhInfiniteComplementary(Single, Single, Single)
Declaration
public static Matrix CreatePerspectiveFovRhInfiniteComplementary(float fieldOfView, float aspectRatio, float nearPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | |
System.Single | aspectRatio | |
System.Single | nearPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveFovRhInfiniteComplementaryInverse(Single, Single, Single)
Declaration
public static Matrix CreatePerspectiveFovRhInfiniteComplementaryInverse(float fieldOfView, float aspectRatio, float nearPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | |
System.Single | aspectRatio | |
System.Single | nearPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveFovRhInfiniteInverse(Single, Single, Single)
Declaration
public static Matrix CreatePerspectiveFovRhInfiniteInverse(float fieldOfView, float aspectRatio, float nearPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | |
System.Single | aspectRatio | |
System.Single | nearPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveFovRhInverse(Single, Single, Single, Single)
Declaration
public static Matrix CreatePerspectiveFovRhInverse(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fieldOfView | |
System.Single | aspectRatio | |
System.Single | nearPlaneDistance | |
System.Single | farPlaneDistance |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveOffCenter(Single, Single, Single, Single, Single, Single)
Builds a customized, perspective projection matrix.
Declaration
public static Matrix CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | left | Minimum x-value of the view volume at the near view plane. |
System.Single | right | Maximum x-value of the view volume at the near view plane. |
System.Single | bottom | Minimum y-value of the view volume at the near view plane. |
System.Single | top | Maximum y-value of the view volume at the near view plane. |
System.Single | nearPlaneDistance | Distance to the near view plane. |
System.Single | farPlaneDistance | Distance to of the far view plane. |
Returns
Type | Description |
---|---|
Matrix |
CreatePerspectiveOffCenter(Single, Single, Single, Single, Single, Single, out Matrix)
Builds a customized, perspective projection matrix.
Declaration
public static void CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | left | Minimum x-value of the view volume at the near view plane. |
System.Single | right | Maximum x-value of the view volume at the near view plane. |
System.Single | bottom | Minimum y-value of the view volume at the near view plane. |
System.Single | top | Maximum y-value of the view volume at the near view plane. |
System.Single | nearPlaneDistance | Distance to the near view plane. |
System.Single | farPlaneDistance | Distance to of the far view plane. |
Matrix | result | [OutAttribute] The created projection matrix. |
CreateReflection(Plane)
Creates a Matrix that reflects the coordinate system about a specified Plane.
Declaration
public static Matrix CreateReflection(Plane value)
Parameters
Type | Name | Description |
---|---|---|
Plane | value | The Plane about which to create a reflection. |
Returns
Type | Description |
---|---|
Matrix |
CreateReflection(ref Plane, out Matrix)
Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.
Declaration
public static void CreateReflection(ref Plane value, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Plane | value | The Plane about which to create a reflection. |
Matrix | result | [OutAttribute] A Matrix that creates the reflection. |
CreateRotationFromTwoVectors(ref Vector3, ref Vector3, out Matrix)
Declaration
public static void CreateRotationFromTwoVectors(ref Vector3 fromVector, ref Vector3 toVector, out Matrix resultMatrix)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | fromVector | |
Vector3 | toVector | |
Matrix | resultMatrix |
CreateRotationX(Single)
Returns a matrix that can be used to rotate a set of vertices around the x-axis.
Declaration
public static Matrix CreateRotationX(float radians)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The amount, in radians, in which to rotate around the x-axis. Note that you can use ToRadians to convert degrees to radians. |
Returns
Type | Description |
---|---|
Matrix |
CreateRotationX(Single, out Matrix)
Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.
Declaration
public static void CreateRotationX(float radians, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The amount, in radians, in which to rotate around the x-axis. Note that you can use ToRadians to convert degrees to radians. |
Matrix | result | [OutAttribute] The matrix in which to place the calculated data. |
CreateRotationY(Single)
Returns a matrix that can be used to rotate a set of vertices around the y-axis.
Declaration
public static Matrix CreateRotationY(float radians)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The amount, in radians, in which to rotate around the y-axis. Note that you can use ToRadians to convert degrees to radians. |
Returns
Type | Description |
---|---|
Matrix |
CreateRotationY(Single, out Matrix)
Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.
Declaration
public static void CreateRotationY(float radians, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The amount, in radians, in which to rotate around the y-axis. Note that you can use ToRadians to convert degrees to radians. |
Matrix | result | [OutAttribute] The matrix in which to place the calculated data. |
CreateRotationZ(Single)
Returns a matrix that can be used to rotate a set of vertices around the z-axis.
Declaration
public static Matrix CreateRotationZ(float radians)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The amount, in radians, in which to rotate around the z-axis. Note that you can use ToRadians to convert degrees to radians. |
Returns
Type | Description |
---|---|
Matrix |
CreateRotationZ(Single, out Matrix)
Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.
Declaration
public static void CreateRotationZ(float radians, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The amount, in radians, in which to rotate around the z-axis. Note that you can use ToRadians to convert degrees to radians. |
Matrix | result | [OutAttribute] The rotation matrix. |
CreateScale(Single)
Creates a scaling Matrix.
Declaration
public static Matrix CreateScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scale | Amount to scale by. |
Returns
Type | Description |
---|---|
Matrix |
CreateScale(Single, Single, Single)
Creates a scaling Matrix.
Declaration
public static Matrix CreateScale(float xScale, float yScale, float zScale)
Parameters
Type | Name | Description |
---|---|---|
System.Single | xScale | Value to scale by on the x-axis. |
System.Single | yScale | Value to scale by on the y-axis. |
System.Single | zScale | Value to scale by on the z-axis. |
Returns
Type | Description |
---|---|
Matrix |
CreateScale(Single, Single, Single, out Matrix)
Creates a scaling Matrix.
Declaration
public static void CreateScale(float xScale, float yScale, float zScale, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | xScale | Value to scale by on the x-axis. |
System.Single | yScale | Value to scale by on the y-axis. |
System.Single | zScale | Value to scale by on the z-axis. |
Matrix | result | [OutAttribute] The created scaling Matrix. |
CreateScale(Single, out Matrix)
Creates a scaling Matrix.
Declaration
public static void CreateScale(float scale, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scale | Value to scale by. |
Matrix | result | [OutAttribute] The created scaling Matrix. |
CreateScale(Vector3)
Creates a scaling Matrix.
Declaration
public static Matrix CreateScale(Vector3 scales)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | scales | Amounts to scale by on the x, y, and z axes. |
Returns
Type | Description |
---|---|
Matrix |
CreateScale(ref Vector3, out Matrix)
Creates a scaling Matrix.
Declaration
public static void CreateScale(ref Vector3 scales, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | scales | Amounts to scale by on the x, y, and z axes. |
Matrix | result | [OutAttribute] The created scaling Matrix. |
CreateShadow(Vector3, Plane)
Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
Declaration
public static Matrix CreateShadow(Vector3 lightDirection, Plane plane)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lightDirection | A Vector3 specifying the direction from which the light that will cast the shadow is coming. |
Plane | plane | The Plane onto which the new matrix should flatten geometry so as to cast a shadow. |
Returns
Type | Description |
---|---|
Matrix |
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.
Declaration
public static void CreateShadow(ref Vector3 lightDirection, ref Plane plane, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lightDirection | A Vector3 specifying the direction from which the light that will cast the shadow is coming. |
Plane | plane | The Plane onto which the new matrix should flatten geometry so as to cast a shadow. |
Matrix | result | [OutAttribute] A Matrix that can be used to flatten geometry onto the specified plane from the specified direction. |
CreateTranslation(Single, Single, Single)
Creates a translation Matrix.
Declaration
public static Matrix CreateTranslation(float xPosition, float yPosition, float zPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Single | xPosition | Value to translate by on the x-axis. |
System.Single | yPosition | Value to translate by on the y-axis. |
System.Single | zPosition | Value to translate by on the z-axis. |
Returns
Type | Description |
---|---|
Matrix |
CreateTranslation(Single, Single, Single, out Matrix)
Creates a translation Matrix.
Declaration
public static void CreateTranslation(float xPosition, float yPosition, float zPosition, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
System.Single | xPosition | Value to translate by on the x-axis. |
System.Single | yPosition | Value to translate by on the y-axis. |
System.Single | zPosition | Value to translate by on the z-axis. |
Matrix | result | [OutAttribute] The created translation Matrix. |
CreateTranslation(Vector3)
Creates a translation Matrix.
Declaration
public static Matrix CreateTranslation(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Amounts to translate by on the x, y, and z axes. |
Returns
Type | Description |
---|---|
Matrix |
CreateTranslation(ref Vector3, out Matrix)
Creates a translation Matrix.
Declaration
public static void CreateTranslation(ref Vector3 position, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Amounts to translate by on the x, y, and z axes. |
Matrix | result | [OutAttribute] The created translation Matrix. |
CreateWorld(Vector3)
Declaration
public static Matrix CreateWorld(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position |
Returns
Type | Description |
---|---|
Matrix |
CreateWorld(Vector3, Vector3, Vector3)
Creates a world matrix with the specified parameters.
Declaration
public static Matrix CreateWorld(Vector3 position, Vector3 forward, Vector3 up)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object. This value is used in translation operations. |
Vector3 | forward | Forward direction of the object. |
Vector3 | up | Upward direction of the object; usually [0, 1, 0]. |
Returns
Type | Description |
---|---|
Matrix |
CreateWorld(ref Vector3, ref Vector3, ref Vector3, out Matrix)
Creates a world matrix with the specified parameters.
Declaration
public static void CreateWorld(ref Vector3 position, ref Vector3 forward, ref Vector3 up, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object. This value is used in translation operations. |
Vector3 | forward | Forward direction of the object. |
Vector3 | up | Upward direction of the object; usually [0, 1, 0]. |
Matrix | result | [OutAttribute] The created world matrix. |
Determinant()
Calculates the determinant of the matrix.
Declaration
public float Determinant()
Returns
Type | Description |
---|---|
System.Single |
Divide(Matrix, Single)
Divides the components of a matrix by a scalar.
Declaration
public static Matrix Divide(Matrix matrix1, float divider)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
System.Single | divider | The divisor. |
Returns
Type | Description |
---|---|
Matrix |
Divide(Matrix, Matrix)
Divides the components of a matrix by the corresponding components of another matrix.
Declaration
public static Matrix Divide(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | The divisor. |
Returns
Type | Description |
---|---|
Matrix |
Divide(ref Matrix, Single, out Matrix)
Divides the components of a matrix by a scalar.
Declaration
public static void Divide(ref Matrix matrix1, float divider, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
System.Single | divider | The divisor. |
Matrix | result | [OutAttribute] Result of the division. |
Divide(ref Matrix, ref Matrix, out Matrix)
Divides the components of a matrix by the corresponding components of another matrix.
Declaration
public static void Divide(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | The divisor. |
Matrix | result | [OutAttribute] Result of the division. |
Equals(Object)
Returns a value that indicates whether the current instance is equal to a specified object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object with which to make the comparison. |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Matrix)
Determines whether the specified Object is equal to the Matrix.
Declaration
public bool Equals(Matrix other)
Parameters
Type | Name | Description |
---|---|---|
Matrix | other | The Object to compare with the current Matrix. |
Returns
Type | Description |
---|---|
System.Boolean |
EqualsFast(ref Matrix, Single)
Compares just position, forward and up
Declaration
public bool EqualsFast(ref Matrix other, float epsilon = 0.0001F)
Parameters
Type | Name | Description |
---|---|---|
Matrix | other | |
System.Single | epsilon |
Returns
Type | Description |
---|---|
System.Boolean |
GetClosestDirection(Vector3)
Declaration
public Base6Directions.Direction GetClosestDirection(Vector3 referenceVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | referenceVector |
Returns
Type | Description |
---|---|
Base6Directions.Direction |
GetClosestDirection(ref Vector3)
Declaration
public Base6Directions.Direction GetClosestDirection(ref Vector3 referenceVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | referenceVector |
Returns
Type | Description |
---|---|
Base6Directions.Direction |
GetDirectionVector(Base6Directions.Direction)
Gets the base vector of the matrix, corresponding to the given direction
Declaration
public Vector3 GetDirectionVector(Base6Directions.Direction direction)
Parameters
Type | Name | Description |
---|---|---|
Base6Directions.Direction | direction |
Returns
Type | Description |
---|---|
Vector3 |
GetEulerAnglesXYZ(ref Matrix, out Vector3)
Declaration
public static bool GetEulerAnglesXYZ(ref Matrix mat, out Vector3 xyz)
Parameters
Type | Name | Description |
---|---|---|
Matrix | mat | |
Vector3 | xyz |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Gets the hash code of this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
GetOrientation()
Gets the orientation.
Declaration
public Matrix GetOrientation()
Returns
Type | Description |
---|---|
Matrix |
GetRow(Int32)
Declaration
public Vector4 GetRow(int row)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row |
Returns
Type | Description |
---|---|
Vector4 |
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.
Declaration
public bool HasNoTranslationOrPerspective()
Returns
Type | Description |
---|---|
System.Boolean |
Invert(Matrix)
Calculates the inverse of a matrix.
Declaration
public static Matrix Invert(Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Invert(ref Matrix)
Declaration
public static Matrix Invert(ref Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix |
Returns
Type | Description |
---|---|
Matrix |
Invert(ref Matrix, out Matrix)
Calculates the inverse of a matrix.
Declaration
public static void Invert(ref Matrix matrix, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | The source matrix. |
Matrix | result | [OutAttribute] The inverse of matrix. The same matrix can be used for both arguments. |
IsMirrored()
Declaration
public bool IsMirrored()
Returns
Type | Description |
---|---|
System.Boolean |
IsNan()
Declaration
public bool IsNan()
Returns
Type | Description |
---|---|
System.Boolean |
IsOrthogonal()
Declaration
public bool IsOrthogonal()
Returns
Type | Description |
---|---|
System.Boolean |
IsRotation()
Declaration
public bool IsRotation()
Returns
Type | Description |
---|---|
System.Boolean |
IsValid()
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
System.Boolean |
Lerp(Matrix, Matrix, Single)
Linearly interpolates between the corresponding values of two matrices.
Declaration
public static Matrix Lerp(Matrix matrix1, Matrix matrix2, float amount)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
System.Single | amount | Interpolation value. |
Returns
Type | Description |
---|---|
Matrix |
Lerp(ref Matrix, ref Matrix, Single, out Matrix)
Linearly interpolates between the corresponding values of two matrices.
Declaration
public static void Lerp(ref Matrix matrix1, ref Matrix matrix2, float amount, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
System.Single | amount | Interpolation value. |
Matrix | result | [OutAttribute] Resulting matrix. |
Multiply(Matrix, Single)
Multiplies a matrix by a scalar value.
Declaration
public static Matrix Multiply(Matrix matrix1, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
System.Single | scaleFactor | Scalar value. |
Returns
Type | Description |
---|---|
Matrix |
Multiply(Matrix, Matrix)
Multiplies a matrix by another matrix.
Declaration
public static Matrix Multiply(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Multiply(ref Matrix, Single, out Matrix)
Multiplies a matrix by a scalar value.
Declaration
public static void Multiply(ref Matrix matrix1, float scaleFactor, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
System.Single | scaleFactor | Scalar value. |
Matrix | result | [OutAttribute] The result of the multiplication. |
Multiply(ref Matrix, ref Matrix, out Matrix)
Multiplies a matrix by another matrix.
Declaration
public static void Multiply(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Matrix | result | [OutAttribute] Result of the multiplication. |
MultiplyRotation(ref Matrix, ref Matrix, out Matrix)
Multiplies a matrix by another matrix, only rotation parts.
Declaration
public static void MultiplyRotation(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Matrix | result | [OutAttribute] Result of the multiplication. |
Negate(Matrix)
Negates individual elements of a matrix.
Declaration
public static Matrix Negate(Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Negate(ref Matrix, out Matrix)
Negates individual elements of a matrix.
Declaration
public static void Negate(ref Matrix matrix, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Source matrix. |
Matrix | result | [OutAttribute] Negated matrix. |
Normalize(Matrix)
Declaration
public static Matrix Normalize(Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix |
Returns
Type | Description |
---|---|
Matrix |
Orthogonalize(Matrix)
Declaration
public static Matrix Orthogonalize(Matrix rotationMatrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | rotationMatrix |
Returns
Type | Description |
---|---|
Matrix |
Rescale(Matrix, Single)
Declaration
public static Matrix Rescale(Matrix matrix, float scale)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | |
System.Single | scale |
Returns
Type | Description |
---|---|
Matrix |
Rescale(Matrix, Vector3)
Declaration
public static Matrix Rescale(Matrix matrix, Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | |
Vector3 | scale |
Returns
Type | Description |
---|---|
Matrix |
Rescale(ref Matrix, Single)
Same result as Matrix.CreateScale(scale) * matrix, but much faster
Declaration
public static void Rescale(ref Matrix matrix, float scale)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | |
System.Single | scale |
Rescale(ref Matrix, ref Vector3)
Same result as Matrix.CreateScale(scale) * matrix, but much faster
Declaration
public static void Rescale(ref Matrix matrix, ref Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | |
Vector3 | scale |
Round(ref Matrix)
Declaration
public static Matrix Round(ref Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix |
Returns
Type | Description |
---|---|
Matrix |
SetDirectionVector(Base6Directions.Direction, Vector3)
Sets the base vector of the matrix, corresponding to the given direction
Declaration
public void SetDirectionVector(Base6Directions.Direction direction, Vector3 newValue)
Parameters
Type | Name | Description |
---|---|---|
Base6Directions.Direction | direction | |
Vector3 | newValue |
SetFrom(in MatrixD)
Set this ma
Declaration
public void SetFrom(in MatrixD m)
Parameters
Type | Name | Description |
---|---|---|
MatrixD | m |
SetRotationAndScale(in MatrixD)
Declaration
public void SetRotationAndScale(in MatrixD m)
Parameters
Type | Name | Description |
---|---|---|
MatrixD | m |
SetRow(Int32, Vector4)
Declaration
public void SetRow(int row, Vector4 value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | |
Vector4 | value |
Slerp(Matrix, Matrix, Single)
Performs spherical linear interpolation of position and rotation.
Declaration
public static Matrix Slerp(Matrix matrix1, Matrix matrix2, float amount)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 | |
System.Single | amount |
Returns
Type | Description |
---|---|
Matrix |
Slerp(Matrix, Matrix, Single, out Matrix)
Performs spherical linear interpolation of position and rotation.
Declaration
public static void Slerp(Matrix matrix1, Matrix matrix2, float amount, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 | |
System.Single | amount | |
Matrix | result |
Slerp(ref Matrix, ref Matrix, Single, out Matrix)
Performs spherical linear interpolation of position and rotation.
Declaration
public static void Slerp(ref Matrix matrix1, ref Matrix matrix2, float amount, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 | |
System.Single | amount | |
Matrix | result |
SlerpScale(Matrix, Matrix, Single)
Performs spherical linear interpolation of position and rotation and scale.
Declaration
public static Matrix SlerpScale(Matrix matrix1, Matrix matrix2, float amount)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 | |
System.Single | amount |
Returns
Type | Description |
---|---|
Matrix |
SlerpScale(Matrix, Matrix, Single, out Matrix)
Performs spherical linear interpolation of position and rotation and scale.
Declaration
public static void SlerpScale(Matrix matrix1, Matrix matrix2, float amount, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 | |
System.Single | amount | |
Matrix | result |
SlerpScale(ref Matrix, ref Matrix, Single, out Matrix)
Performs spherical linear interpolation of position and rotation and scale.
Declaration
public static void SlerpScale(ref Matrix matrix1, ref Matrix matrix2, float amount, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 | |
System.Single | amount | |
Matrix | result |
Subtract(Matrix, Matrix)
Subtracts matrices.
Declaration
public static Matrix Subtract(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Subtract(ref Matrix, ref Matrix, out Matrix)
Subtracts matrices.
Declaration
public static void Subtract(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Matrix | result | [OutAttribute] Result of the subtraction. |
SwapYZCoordinates(Matrix)
Declaration
public static Matrix SwapYZCoordinates(Matrix m)
Parameters
Type | Name | Description |
---|---|---|
Matrix | m |
Returns
Type | Description |
---|---|
Matrix |
ToString()
Retrieves a string representation of the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Transform(Matrix, Quaternion)
Transforms a Matrix by applying a Quaternion rotation.
Declaration
public static Matrix Transform(Matrix value, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
Matrix | value | The Matrix to transform. |
Quaternion | rotation | The rotation to apply, expressed as a Quaternion. |
Returns
Type | Description |
---|---|
Matrix |
Transform(ref Matrix, ref Quaternion, out Matrix)
Transforms a Matrix by applying a Quaternion rotation.
Declaration
public static void Transform(ref Matrix value, ref Quaternion rotation, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | value | The Matrix to transform. |
Quaternion | rotation | The rotation to apply, expressed as a Quaternion. |
Matrix | result | [OutAttribute] An existing Matrix filled in with the result of the transform. |
Transpose(Matrix)
Transposes the rows and columns of a matrix.
Declaration
public static Matrix Transpose(Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Transpose(ref Matrix, out Matrix)
Transposes the rows and columns of a matrix.
Declaration
public static void Transpose(ref Matrix matrix, out Matrix result)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Source matrix. |
Matrix | result | [OutAttribute] Transposed matrix. |
TransposeRotationInPlace()
Transposes the rows and columns of a matrix that is assumed to be rotation only in place.
Declaration
public void TransposeRotationInPlace()
Operators
Addition(Matrix, Matrix)
Adds a matrix to another matrix.
Declaration
public static Matrix operator +(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Division(Matrix, Single)
Divides the components of a matrix by a scalar.
Declaration
public static Matrix operator /(Matrix matrix1, float divider)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
System.Single | divider | The divisor. |
Returns
Type | Description |
---|---|
Matrix |
Division(Matrix, Matrix)
Divides the components of a matrix by the corresponding components of another matrix.
Declaration
public static Matrix operator /(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | The divisor. |
Returns
Type | Description |
---|---|
Matrix |
Equality(Matrix, Matrix)
Compares a matrix for equality with another matrix.
Declaration
public static bool operator ==(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(Matrix, Matrix)
Tests a matrix for inequality with another matrix.
Declaration
public static bool operator !=(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | The matrix on the left of the equal sign. |
Matrix | matrix2 | The matrix on the right of the equal sign. |
Returns
Type | Description |
---|---|
System.Boolean |
Multiply(Single, Matrix)
Multiplies a matrix by a scalar value.
Declaration
public static Matrix operator *(float scaleFactor, Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | Scalar value. |
Matrix | matrix | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Multiply(Matrix, Single)
Multiplies a matrix by a scalar value.
Declaration
public static Matrix operator *(Matrix matrix, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Source matrix. |
System.Single | scaleFactor | Scalar value. |
Returns
Type | Description |
---|---|
Matrix |
Multiply(Matrix, Matrix)
Multiplies a matrix by another matrix.
Declaration
public static Matrix operator *(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
Subtraction(Matrix, Matrix)
Subtracts matrices.
Declaration
public static Matrix operator -(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Matrix | matrix2 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |
UnaryNegation(Matrix)
Negates individual elements of a matrix.
Declaration
public static Matrix operator -(Matrix matrix1)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | Source matrix. |
Returns
Type | Description |
---|---|
Matrix |