Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

VRageMath.Matrix

Malware edited this page Dec 21, 2018 · 54 revisions

Index

Matrix Struct

Namespace: VRageMath
Assembly: VRage.Math.dll

Summary

Defines a matrix.

Fields

_float M11_ Value at row 1 column 1 of the matrix.
_float M12_ Value at row 1 column 2 of the matrix.
_float M13_ Value at row 1 column 3 of the matrix.
_float M14_ Value at row 1 column 4 of the matrix.
_float M21_ Value at row 2 column 1 of the matrix.
_float M22_ Value at row 2 column 2 of the matrix.
_float M23_ Value at row 2 column 3 of the matrix.
_float M24_ Value at row 2 column 4 of the matrix.
_float M31_ Value at row 3 column 1 of the matrix.
_float M32_ Value at row 3 column 2 of the matrix.
_float M33_ Value at row 3 column 3 of the matrix.
_float M34_ Value at row 3 column 4 of the matrix.
_float M41_ Value at row 4 column 1 of the matrix.
_float M42_ Value at row 4 column 2 of the matrix.
_float M43_ Value at row 4 column 3 of the matrix.
_float M44_ Value at row 4 column 4 of the matrix.
static _Matrix Identity_
static _Matrix Zero_
### Properties
_Vector3 Up_ Gets and sets the up vector of the Matrix.
_Vector3 Down_ Gets and sets the down vector of the Matrix.
_Vector3 Right_ Gets and sets the right vector of the Matrix.
_Vector3 Col0_
_Vector3 Col1_
_Vector3 Col2_
_Vector3 Left_ Gets and sets the left vector of the Matrix.
_Vector3 Forward_ Gets and sets the forward vector of the Matrix.
_Vector3 Backward_ Gets and sets the backward vector of the Matrix.
_Vector3 Scale_
_Vector3 Translation_ Gets and sets the translation vector of the Matrix.
_float Item_
### Methods
static _void Subtract(ref Matrix matrix1, ref Matrix matrix2, ref Matrix result)_ Subtracts matrices.
static _Matrix Multiply(Matrix matrix1, Matrix matrix2)_ Multiplies a matrix by another matrix.
static _void Multiply(ref Matrix matrix1, ref Matrix matrix2, ref Matrix result)_ Multiplies a matrix by another matrix.
static _void MultiplyRotation(ref Matrix matrix1, ref Matrix matrix2, ref Matrix result)_ Multiplies a matrix by another matrix, only rotation parts.
static _Matrix Multiply(Matrix matrix1, float scaleFactor)_ Multiplies a matrix by a scalar value.
static _void Multiply(ref Matrix matrix1, float scaleFactor, ref Matrix result)_ Multiplies a matrix by a scalar value.
static _Matrix Divide(Matrix matrix1, Matrix matrix2)_ Divides the components of a matrix by the corresponding components of another matrix.
static _void Divide(ref Matrix matrix1, ref Matrix matrix2, ref Matrix result)_ Divides the components of a matrix by the corresponding components of another matrix.
static _Matrix Divide(Matrix matrix1, float divider)_ Divides the components of a matrix by a scalar.
static _void Divide(ref Matrix matrix1, float divider, ref Matrix result)_ Divides the components of a matrix by a scalar.
_Matrix GetOrientation()_ Gets the orientation.
_void AssertIsValid()_
_bool IsValid()_
_bool IsNan()_
_bool IsRotation()_
_bool 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.
static _Matrix CreateFromDir(Vector3 dir)_
static _Matrix CreateFromDir(Vector3 dir, Vector3 suggestedUp)_
static _Matrix Normalize(Matrix matrix)_
static _Matrix Orthogonalize(Matrix rotationMatrix)_
static _Matrix Round(ref Matrix matrix)_
static _Matrix AlignRotationToAxes(ref Matrix toAlign, ref Matrix axisDefinitionMatrix)_
static _bool GetEulerAnglesXYZ(ref Matrix mat, ref Vector3 xyz)_
static _Matrix SwapYZCoordinates(Matrix m)_
_bool IsMirrored()_
_bool IsOrthogonal()_
_Vector3 GetDirectionVector(Direction direction)_
_void SetDirectionVector(Direction direction, Vector3 newValue)_
_Direction GetClosestDirection(Vector3 referenceVector)_
_Direction GetClosestDirection(ref Vector3 referenceVector)_
static _void Rescale(ref Matrix matrix, float scale)_ Same result as Matrix.CreateScale(scale) * matrix, but much faster
static _void Rescale(ref Matrix matrix, ref Vector3 scale)_ Same result as Matrix.CreateScale(scale) * matrix, but much faster
static _Matrix Rescale(Matrix matrix, float scale)_
static _Matrix Rescale(Matrix matrix, Vector3 scale)_
static _Matrix CreateBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 cameraUpVector, Nullable cameraForwardVector)_ Creates a spherical billboard that rotates around a specified object position.
static _void CreateBillboard(ref Vector3 objectPosition, ref Vector3 cameraPosition, ref Vector3 cameraUpVector, Nullable cameraForwardVector, ref Matrix result)_ Creates a spherical billboard that rotates around a specified object position.
static _Matrix CreateConstrainedBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 rotateAxis, Nullable cameraForwardVector, Nullable objectForwardVector)_ Creates a cylindrical billboard that rotates around a specified axis.
static _void CreateConstrainedBillboard(ref Vector3 objectPosition, ref Vector3 cameraPosition, ref Vector3 rotateAxis, Nullable cameraForwardVector, Nullable objectForwardVector, ref Matrix result)_ Creates a cylindrical billboard that rotates around a specified axis.
static _Matrix CreateTranslation(Vector3 position)_ Creates a translation Matrix.
static _void CreateTranslation(ref Vector3 position, ref Matrix result)_ Creates a translation Matrix.
static _Matrix CreateTranslation(float xPosition, float yPosition, float zPosition)_ Creates a translation Matrix.
static _void CreateTranslation(float xPosition, float yPosition, float zPosition, ref Matrix result)_ Creates a translation Matrix.
static _Matrix CreateScale(float xScale, float yScale, float zScale)_ Creates a scaling Matrix.
static _void CreateScale(float xScale, float yScale, float zScale, ref Matrix result)_ Creates a scaling Matrix.
static _Matrix CreateScale(Vector3 scales)_ Creates a scaling Matrix.
static _void CreateScale(ref Vector3 scales, ref Matrix result)_ Creates a scaling Matrix.
static _Matrix CreateScale(float scale)_ Creates a scaling Matrix.
static _void CreateScale(float scale, ref Matrix result)_ Creates a scaling Matrix.
static _Matrix CreateRotationX(float radians)_ Returns a matrix that can be used to rotate a set of vertices around the x-axis.
static _void CreateRotationX(float radians, ref Matrix result)_ Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.
static _Matrix CreateRotationY(float radians)_ Returns a matrix that can be used to rotate a set of vertices around the y-axis.
static _void CreateRotationY(float radians, ref Matrix result)_ Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.
static _Matrix CreateRotationZ(float radians)_ Returns a matrix that can be used to rotate a set of vertices around the z-axis.
static _void CreateRotationZ(float radians, ref Matrix result)_ Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.
static _Matrix CreateFromAxisAngle(Vector3 axis, float angle)_ Creates a new Matrix that rotates around an arbitrary vector.
static _void CreateFromAxisAngle(ref Vector3 axis, float angle, ref Matrix result)_ Creates a new Matrix that rotates around an arbitrary vector.
static _void CreateRotationFromTwoVectors(ref Vector3 fromVector, ref Vector3 toVector, ref Matrix resultMatrix)_
static _Matrix CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)_ Builds a perspective projection matrix based on a field of view and returns by value.
static _Matrix CreatePerspectiveFovRhComplementary(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)_
static _Matrix CreatePerspectiveFovRhInfinite(float fieldOfView, float aspectRatio, float nearPlaneDistance)_
static _Matrix CreatePerspectiveFovRhInfiniteComplementary(float fieldOfView, float aspectRatio, float nearPlaneDistance)_
static _Matrix CreatePerspectiveFovRhInverse(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)_
static _Matrix CreatePerspectiveFovRhInfiniteInverse(float fieldOfView, float aspectRatio, float nearPlaneDistance)_
static _Matrix CreatePerspectiveFovRhInfiniteComplementaryInverse(float fieldOfView, float aspectRatio, float nearPlaneDistance)_
static _Matrix CreateFromPerspectiveFieldOfView(ref Matrix proj, float nearPlaneDistance, float farPlaneDistance)_
static _void CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance, ref Matrix result)_ Builds a perspective projection matrix based on a field of view and returns by reference.
static _Matrix CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance)_ Builds a perspective projection matrix and returns the result by value.
static _void CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance, ref Matrix result)_ Builds a perspective projection matrix and returns the result by reference.
static _Matrix CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance)_ Builds a customized, perspective projection matrix.
static _void CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance, ref Matrix result)_ Builds a customized, perspective projection matrix.
static _Matrix CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane)_ Builds an orthogonal projection matrix.
static _void CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane, ref Matrix result)_ Builds an orthogonal projection matrix.
static _Matrix CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane)_ Builds a customized, orthogonal projection matrix.
static _void CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane, ref Matrix result)_ Builds a customized, orthogonal projection matrix.
static _Matrix CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)_ Creates a view matrix.
static _Matrix CreateLookAtInverse(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)_
static _void CreateLookAt(ref Vector3 cameraPosition, ref Vector3 cameraTarget, ref Vector3 cameraUpVector, ref Matrix result)_ Creates a view matrix.
static _Matrix CreateWorld(Vector3 position)_
static _Matrix CreateWorld(Vector3 position, Vector3 forward, Vector3 up)_ Creates a world matrix with the specified parameters.
static _void CreateWorld(ref Vector3 position, ref Vector3 forward, ref Vector3 up, ref Matrix result)_ Creates a world matrix with the specified parameters.
static _Matrix CreateFromQuaternion(Quaternion quaternion)_ Creates a rotation Matrix from a Quaternion.
static _void CreateFromQuaternion(ref Quaternion quaternion, ref Matrix result)_ Creates a rotation Matrix from a Quaternion.
static _Matrix CreateFromYawPitchRoll(float yaw, float pitch, float roll)_ Creates a new rotation matrix from a specified yaw, pitch, and roll.
static _void CreateFromYawPitchRoll(float yaw, float pitch, float roll, ref Matrix result)_ Fills in a rotation matrix from a specified yaw, pitch, and roll.
static _Matrix CreateFromTransformScale(Quaternion orientation, Vector3 position, Vector3 scale)_
static _Matrix CreateShadow(Vector3 lightDirection, Plane plane)_ Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
static _void CreateShadow(ref Vector3 lightDirection, ref Plane plane, ref Matrix result)_ Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source.
static _Matrix CreateReflection(Plane value)_ Creates a Matrix that reflects the coordinate system about a specified Plane.
static _void CreateReflection(ref Plane value, ref Matrix result)_ Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.
static _Matrix Transform(Matrix value, Quaternion rotation)_ Transforms a Matrix by applying a Quaternion rotation.
static _void Transform(ref Matrix value, ref Quaternion rotation, ref Matrix result)_ Transforms a Matrix by applying a Quaternion rotation.
_Vector4 GetRow(int row)_
_void SetRow(int row, Vector4 value)_
_string ToString()_ Retrieves a string representation of the current object.
_bool Equals(Matrix other)_ Determines whether the specified Object is equal to the Matrix.
_bool EqualsFast(ref Matrix other, float epsilon)_ Compares just position, forward and up
_bool Equals(Object obj)_ Returns a value that indicates whether the current instance is equal to a specified object.
_int GetHashCode()_ Gets the hash code of this object.
static _Matrix Transpose(Matrix matrix)_ Transposes the rows and columns of a matrix.
static _void Transpose(ref Matrix matrix, ref Matrix result)_ Transposes the rows and columns of a matrix.
_void TransposeRotationInPlace()_ Transposes the rows and columns of a matrix that is assumed to be rotation only in place.
_float Determinant()_ Calculates the determinant of the matrix.
static _Matrix Invert(Matrix matrix)_ Calculates the inverse of a matrix.
static _Matrix Invert(ref Matrix matrix)_
static _void Invert(ref Matrix matrix, ref Matrix result)_ Calculates the inverse of a matrix.
static _Matrix Lerp(Matrix matrix1, Matrix matrix2, float amount)_ Linearly interpolates between the corresponding values of two matrices.
static _void Lerp(ref Matrix matrix1, ref Matrix matrix2, float amount, ref Matrix result)_ Linearly interpolates between the corresponding values of two matrices.
static _void Slerp(ref Matrix matrix1, ref Matrix matrix2, float amount, ref Matrix result)_ Performs spherical linear interpolation of position and rotation.
static _void SlerpScale(ref Matrix matrix1, ref Matrix matrix2, float amount, ref Matrix result)_ Performs spherical linear interpolation of position and rotation and scale.
static _void Slerp(Matrix matrix1, Matrix matrix2, float amount, ref Matrix result)_ Performs spherical linear interpolation of position and rotation.
static _Matrix Slerp(Matrix matrix1, Matrix matrix2, float amount)_ Performs spherical linear interpolation of position and rotation.
static _void SlerpScale(Matrix matrix1, Matrix matrix2, float amount, ref Matrix result)_ Performs spherical linear interpolation of position and rotation and scale.
static _Matrix SlerpScale(Matrix matrix1, Matrix matrix2, float amount)_ Performs spherical linear interpolation of position and rotation and scale.
static _Matrix Negate(Matrix matrix)_ Negates individual elements of a matrix.
static _void Negate(ref Matrix matrix, ref Matrix result)_ Negates individual elements of a matrix.
static _Matrix Add(Matrix matrix1, Matrix matrix2)_ Adds a matrix to another matrix.
static _void Add(ref Matrix matrix1, ref Matrix matrix2, ref Matrix result)_ Adds a matrix to another matrix.
static _Matrix Subtract(Matrix matrix1, Matrix matrix2)_ Subtracts matrices.

Clone this wiki locally