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

VRageMath.MatrixD

Malware edited this page Dec 21, 2018 · 60 revisions

Index

MatrixD Struct

Namespace: VRageMath
Assembly: VRage.Math.dll

Summary

Defines a matrix.

Fields

Member Description
double M11 Value at row 1 column 1 of the matrix.
double M12 Value at row 1 column 2 of the matrix.
double M13 Value at row 1 column 3 of the matrix.
double M14 Value at row 1 column 4 of the matrix.
double M21 Value at row 2 column 1 of the matrix.
double M22 Value at row 2 column 2 of the matrix.
double M23 Value at row 2 column 3 of the matrix.
double M24 Value at row 2 column 4 of the matrix.
double M31 Value at row 3 column 1 of the matrix.
double M32 Value at row 3 column 2 of the matrix.
double M33 Value at row 3 column 3 of the matrix.
double M34 Value at row 3 column 4 of the matrix.
double M41 Value at row 4 column 1 of the matrix.
double M42 Value at row 4 column 2 of the matrix.
double M43 Value at row 4 column 3 of the matrix.
double M44 Value at row 4 column 4 of the matrix.
static MatrixD Identity
static MatrixD Zero

Properties

Member Description
Vector3D Col0
Vector3D Col1
Vector3D Col2
Vector3D Up Gets and sets the up vector of the Matrix.
Vector3D Down Gets and sets the down vector of the Matrix.
Vector3D Right Gets and sets the right vector of the Matrix.
Vector3D Left Gets and sets the left vector of the Matrix.
Vector3D Forward Gets and sets the forward vector of the Matrix.
Vector3D Backward Gets and sets the backward vector of the Matrix.
Vector3D Scale
Vector3D Translation Gets and sets the translation vector of the Matrix.
Matrix3x3 Rotation
double Item

Methods

Member Description
static Matrix Subtract(Matrix matrix1, Matrix matrix2) Subtracts matrices.
static void Subtract(ref MatrixD matrix1, ref MatrixD matrix2, ref MatrixD result) Subtracts matrices.
static MatrixD Multiply(MatrixD matrix1, MatrixD matrix2) Multiplies a matrix by another matrix.
static MatrixD Multiply(MatrixD matrix1, Matrix matrix2) Multiplies a matrix by another matrix.
static void Multiply(ref MatrixD matrix1, ref Matrix matrix2, ref MatrixD result) Multiplies a matrix by another matrix.
static void Multiply(ref Matrix matrix1, ref MatrixD matrix2, ref MatrixD result)
static void Multiply(ref MatrixD matrix1, ref MatrixD matrix2, ref MatrixD result) Multiplies a matrix by another matrix.
static MatrixD Multiply(MatrixD matrix1, double scaleFactor) Multiplies a matrix by a scalar value.
static void Multiply(ref MatrixD matrix1, double scaleFactor, ref MatrixD result) Multiplies a matrix by a scalar value.
static MatrixD Divide(MatrixD matrix1, MatrixD matrix2) Divides the components of a matrix by the corresponding components of another matrix.
static void Divide(ref MatrixD matrix1, ref MatrixD matrix2, ref MatrixD result) Divides the components of a matrix by the corresponding components of another matrix.
static MatrixD Divide(MatrixD matrix1, double divider) Divides the components of a matrix by a scalar.
static void Divide(ref MatrixD matrix1, double divider, ref MatrixD result) Divides the components of a matrix by a scalar.
MatrixD 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 MatrixD CreateFromDir(Vector3D dir)
static MatrixD CreateFromDir(Vector3D dir, Vector3D suggestedUp)
static MatrixD Normalize(MatrixD matrix)
void Orthogonalize()
static MatrixD Orthogonalize(MatrixD rotationMatrix)
static MatrixD AlignRotationToAxes(ref MatrixD toAlign, ref MatrixD axisDefinitionMatrix)
static bool GetEulerAnglesXYZ(ref MatrixD mat, ref Vector3D xyz)
static MatrixD SwapYZCoordinates(MatrixD m)
bool IsMirrored()
Vector3D GetDirectionVector(Direction direction)
void SetDirectionVector(Direction direction, Vector3D newValue)
Direction GetClosestDirection(Vector3D referenceVector)
Direction GetClosestDirection(ref Vector3D referenceVector)
static void Rescale(ref MatrixD matrix, double scale) Same result as Matrix.CreateScale(scale) * matrix, but much faster
static void Rescale(ref MatrixD matrix, float scale) Same result as Matrix.CreateScale(scale) * matrix, but much faster
static void Rescale(ref MatrixD matrix, ref Vector3D scale) Same result as Matrix.CreateScale(scale) * matrix, but much faster
static MatrixD Rescale(MatrixD matrix, double scale)
static MatrixD Rescale(MatrixD matrix, Vector3D scale)
static MatrixD&nbsp;CreateBillboard(Vector3D&nbsp;objectPosition,&nbsp;Vector3D&nbsp;cameraPosition,&nbsp;Vector3D&nbsp;cameraUpVector,&nbsp;Nullable<Vector3D>&nbsp;cameraForwardVector) Creates a spherical billboard that rotates around a specified object position.
static void&nbsp;CreateBillboard(ref&nbsp;Vector3D&nbsp;objectPosition,&nbsp;ref&nbsp;Vector3D&nbsp;cameraPosition,&nbsp;ref&nbsp;Vector3D&nbsp;cameraUpVector,&nbsp;Nullable<Vector3D>&nbsp;cameraForwardVector,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a spherical billboard that rotates around a specified object position.
static MatrixD&nbsp;CreateConstrainedBillboard(Vector3D&nbsp;objectPosition,&nbsp;Vector3D&nbsp;cameraPosition,&nbsp;Vector3D&nbsp;rotateAxis,&nbsp;Nullable<Vector3D>&nbsp;cameraForwardVector,&nbsp;Nullable<Vector3D>&nbsp;objectForwardVector) Creates a cylindrical billboard that rotates around a specified axis.
static void&nbsp;CreateConstrainedBillboard(ref&nbsp;Vector3D&nbsp;objectPosition,&nbsp;ref&nbsp;Vector3D&nbsp;cameraPosition,&nbsp;ref&nbsp;Vector3D&nbsp;rotateAxis,&nbsp;Nullable<Vector3D>&nbsp;cameraForwardVector,&nbsp;Nullable<Vector3D>&nbsp;objectForwardVector,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a cylindrical billboard that rotates around a specified axis.
static MatrixD&nbsp;CreateTranslation(Vector3D&nbsp;position) Creates a translation Matrix.
static MatrixD&nbsp;CreateTranslation(Vector3&nbsp;position)
static void&nbsp;CreateTranslation(ref&nbsp;Vector3D&nbsp;position,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a translation Matrix.
static MatrixD&nbsp;CreateTranslation(double&nbsp;xPosition,&nbsp;double&nbsp;yPosition,&nbsp;double&nbsp;zPosition) Creates a translation Matrix.
static void&nbsp;CreateTranslation(double&nbsp;xPosition,&nbsp;double&nbsp;yPosition,&nbsp;double&nbsp;zPosition,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a translation Matrix.
static MatrixD&nbsp;CreateScale(double&nbsp;xScale,&nbsp;double&nbsp;yScale,&nbsp;double&nbsp;zScale) Creates a scaling Matrix.
static void&nbsp;CreateScale(double&nbsp;xScale,&nbsp;double&nbsp;yScale,&nbsp;double&nbsp;zScale,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a scaling Matrix.
static MatrixD&nbsp;CreateScale(Vector3D&nbsp;scales) Creates a scaling Matrix.
static void&nbsp;CreateScale(ref&nbsp;Vector3D&nbsp;scales,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a scaling Matrix.
static MatrixD&nbsp;CreateScale(double&nbsp;scale) Creates a scaling Matrix.
static void&nbsp;CreateScale(double&nbsp;scale,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a scaling Matrix.
static MatrixD&nbsp;CreateRotationX(double&nbsp;radians) Returns a matrix that can be used to rotate a set of vertices around the x-axis.
static void&nbsp;CreateRotationX(double&nbsp;radians,&nbsp;ref&nbsp;MatrixD&nbsp;result) Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.
static MatrixD&nbsp;CreateRotationY(double&nbsp;radians) Returns a matrix that can be used to rotate a set of vertices around the y-axis.
static void&nbsp;CreateRotationY(double&nbsp;radians,&nbsp;ref&nbsp;MatrixD&nbsp;result) Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.
static MatrixD&nbsp;CreateRotationZ(double&nbsp;radians) Returns a matrix that can be used to rotate a set of vertices around the z-axis.
static void&nbsp;CreateRotationZ(double&nbsp;radians,&nbsp;ref&nbsp;MatrixD&nbsp;result) Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.
static MatrixD&nbsp;CreateFromAxisAngle(Vector3D&nbsp;axis,&nbsp;double&nbsp;angle) Creates a new Matrix that rotates around an arbitrary vector.
static void&nbsp;CreateFromAxisAngle(ref&nbsp;Vector3D&nbsp;axis,&nbsp;double&nbsp;angle,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a new Matrix that rotates around an arbitrary vector.
static MatrixD&nbsp;CreatePerspectiveFieldOfView(double&nbsp;fieldOfView,&nbsp;double&nbsp;aspectRatio,&nbsp;double&nbsp;nearPlaneDistance,&nbsp;double&nbsp;farPlaneDistance) Builds a perspective projection matrix based on a field of view and returns by value.
static void&nbsp;CreatePerspectiveFieldOfView(double&nbsp;fieldOfView,&nbsp;double&nbsp;aspectRatio,&nbsp;double&nbsp;nearPlaneDistance,&nbsp;double&nbsp;farPlaneDistance,&nbsp;ref&nbsp;MatrixD&nbsp;result) Builds a perspective projection matrix based on a field of view and returns by reference.
static MatrixD&nbsp;CreatePerspective(double&nbsp;width,&nbsp;double&nbsp;height,&nbsp;double&nbsp;nearPlaneDistance,&nbsp;double&nbsp;farPlaneDistance) Builds a perspective projection matrix and returns the result by value.
static void&nbsp;CreatePerspective(double&nbsp;width,&nbsp;double&nbsp;height,&nbsp;double&nbsp;nearPlaneDistance,&nbsp;double&nbsp;farPlaneDistance,&nbsp;ref&nbsp;MatrixD&nbsp;result) Builds a perspective projection matrix and returns the result by reference.
static MatrixD&nbsp;CreatePerspectiveOffCenter(double&nbsp;left,&nbsp;double&nbsp;right,&nbsp;double&nbsp;bottom,&nbsp;double&nbsp;top,&nbsp;double&nbsp;nearPlaneDistance,&nbsp;double&nbsp;farPlaneDistance) Builds a customized, perspective projection matrix.
static void&nbsp;CreatePerspectiveOffCenter(double&nbsp;left,&nbsp;double&nbsp;right,&nbsp;double&nbsp;bottom,&nbsp;double&nbsp;top,&nbsp;double&nbsp;nearPlaneDistance,&nbsp;double&nbsp;farPlaneDistance,&nbsp;ref&nbsp;MatrixD&nbsp;result) Builds a customized, perspective projection matrix.
static MatrixD&nbsp;CreateOrthographic(double&nbsp;width,&nbsp;double&nbsp;height,&nbsp;double&nbsp;zNearPlane,&nbsp;double&nbsp;zFarPlane) Builds an orthogonal projection matrix.
static void&nbsp;CreateOrthographic(double&nbsp;width,&nbsp;double&nbsp;height,&nbsp;double&nbsp;zNearPlane,&nbsp;double&nbsp;zFarPlane,&nbsp;ref&nbsp;MatrixD&nbsp;result) Builds an orthogonal projection matrix.
static MatrixD&nbsp;CreateOrthographicOffCenter(double&nbsp;left,&nbsp;double&nbsp;right,&nbsp;double&nbsp;bottom,&nbsp;double&nbsp;top,&nbsp;double&nbsp;zNearPlane,&nbsp;double&nbsp;zFarPlane) Builds a customized, orthogonal projection matrix.
static void&nbsp;CreateOrthographicOffCenter(double&nbsp;left,&nbsp;double&nbsp;right,&nbsp;double&nbsp;bottom,&nbsp;double&nbsp;top,&nbsp;double&nbsp;zNearPlane,&nbsp;double&nbsp;zFarPlane,&nbsp;ref&nbsp;MatrixD&nbsp;result) Builds a customized, orthogonal projection matrix.
static MatrixD&nbsp;CreateLookAt(Vector3D&nbsp;cameraPosition,&nbsp;Vector3D&nbsp;cameraTarget,&nbsp;Vector3&nbsp;cameraUpVector)
static MatrixD&nbsp;CreateLookAt(Vector3D&nbsp;cameraPosition,&nbsp;Vector3D&nbsp;cameraTarget,&nbsp;Vector3D&nbsp;cameraUpVector) Creates a view matrix.
static Matrix&nbsp;CreateLookAtInverse(Vector3D&nbsp;cameraPosition,&nbsp;Vector3D&nbsp;cameraTarget,&nbsp;Vector3D&nbsp;cameraUpVector)
static void&nbsp;CreateLookAt(ref&nbsp;Vector3D&nbsp;cameraPosition,&nbsp;ref&nbsp;Vector3D&nbsp;cameraTarget,&nbsp;ref&nbsp;Vector3D&nbsp;cameraUpVector,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a view matrix.
static MatrixD&nbsp;CreateWorld(Vector3D&nbsp;position,&nbsp;Vector3&nbsp;forward,&nbsp;Vector3&nbsp;up)
static MatrixD&nbsp;CreateWorld(Vector3D&nbsp;position)
static MatrixD&nbsp;CreateWorld(Vector3D&nbsp;position,&nbsp;Vector3D&nbsp;forward,&nbsp;Vector3D&nbsp;up) Creates a world matrix with the specified parameters.
static void&nbsp;CreateWorld(ref&nbsp;Vector3D&nbsp;position,&nbsp;ref&nbsp;Vector3D&nbsp;forward,&nbsp;ref&nbsp;Vector3D&nbsp;up,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a world matrix with the specified parameters.
static MatrixD&nbsp;CreateFromQuaternion(Quaternion&nbsp;quaternion) Creates a rotation Matrix from a Quaternion.
static MatrixD&nbsp;CreateFromQuaternion(QuaternionD&nbsp;quaternion)
static void&nbsp;CreateFromQuaternion(ref&nbsp;Quaternion&nbsp;quaternion,&nbsp;ref&nbsp;MatrixD&nbsp;result) Creates a rotation Matrix from a Quaternion.
static MatrixD&nbsp;CreateFromYawPitchRoll(double&nbsp;yaw,&nbsp;double&nbsp;pitch,&nbsp;double&nbsp;roll) Creates a new rotation matrix from a specified yaw, pitch, and roll.
static void&nbsp;CreateFromYawPitchRoll(double&nbsp;yaw,&nbsp;double&nbsp;pitch,&nbsp;double&nbsp;roll,&nbsp;ref&nbsp;MatrixD&nbsp;result) Fills in a rotation matrix from a specified yaw, pitch, and roll.
static MatrixD&nbsp;CreateFromTransformScale(Quaternion&nbsp;orientation,&nbsp;Vector3D&nbsp;position,&nbsp;Vector3D&nbsp;scale)
static MatrixD&nbsp;CreateShadow(Vector3D&nbsp;lightDirection,&nbsp;Plane&nbsp;plane) Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
static void&nbsp;CreateShadow(ref&nbsp;Vector3D&nbsp;lightDirection,&nbsp;ref&nbsp;Plane&nbsp;plane,&nbsp;ref&nbsp;MatrixD&nbsp;result) Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source.
static MatrixD&nbsp;CreateReflection(Plane&nbsp;value) Creates a Matrix that reflects the coordinate system about a specified Plane.
static void&nbsp;CreateReflection(ref&nbsp;Plane&nbsp;value,&nbsp;ref&nbsp;MatrixD&nbsp;result) Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.
static MatrixD&nbsp;Transform(MatrixD&nbsp;value,&nbsp;Quaternion&nbsp;rotation) Transforms a Matrix by applying a Quaternion rotation.
static void&nbsp;Transform(ref&nbsp;MatrixD&nbsp;value,&nbsp;ref&nbsp;Quaternion&nbsp;rotation,&nbsp;ref&nbsp;MatrixD&nbsp;result) Transforms a Matrix by applying a Quaternion rotation.
Vector4&nbsp;GetRow(int&nbsp;row)
void&nbsp;SetRow(int&nbsp;row,&nbsp;Vector4&nbsp;value)
string&nbsp;ToString() Retrieves a string representation of the current object.
bool&nbsp;Equals(MatrixD&nbsp;other) Determines whether the specified Object is equal to the Matrix.
bool&nbsp;EqualsFast(ref&nbsp;MatrixD&nbsp;other,&nbsp;double&nbsp;epsilon) Compares just position, forward and up
bool&nbsp;Equals(Object&nbsp;obj) Returns a value that indicates whether the current instance is equal to a specified object.
int&nbsp;GetHashCode() Gets the hash code of this object.
static MatrixD&nbsp;Transpose(MatrixD&nbsp;matrix) Transposes the rows and columns of a matrix.
static void&nbsp;Transpose(ref&nbsp;MatrixD&nbsp;matrix,&nbsp;ref&nbsp;MatrixD&nbsp;result) Transposes the rows and columns of a matrix.
double&nbsp;Determinant() Calculates the determinant of the matrix.
static MatrixD&nbsp;Invert(MatrixD&nbsp;matrix) Calculates the inverse of a matrix.
static MatrixD&nbsp;Invert(ref&nbsp;MatrixD&nbsp;matrix)
static void&nbsp;Invert(ref&nbsp;MatrixD&nbsp;matrix,&nbsp;ref&nbsp;MatrixD&nbsp;result) Calculates the inverse of a matrix.
static MatrixD&nbsp;Lerp(MatrixD&nbsp;matrix1,&nbsp;MatrixD&nbsp;matrix2,&nbsp;double&nbsp;amount) Linearly interpolates between the corresponding values of two matrices.
static void&nbsp;Lerp(ref&nbsp;MatrixD&nbsp;matrix1,&nbsp;ref&nbsp;MatrixD&nbsp;matrix2,&nbsp;double&nbsp;amount,&nbsp;ref&nbsp;MatrixD&nbsp;result) Linearly interpolates between the corresponding values of two matrices.
static void&nbsp;Slerp(ref&nbsp;MatrixD&nbsp;matrix1,&nbsp;ref&nbsp;MatrixD&nbsp;matrix2,&nbsp;float&nbsp;amount,&nbsp;ref&nbsp;MatrixD&nbsp;result) Performs spherical linear interpolation of position and rotation.
bool&nbsp;IsOrthogonal()
bool&nbsp;IsOrthogonal(double&nbsp;epsilon)
static void&nbsp;SlerpScale(ref&nbsp;MatrixD&nbsp;matrix1,&nbsp;ref&nbsp;MatrixD&nbsp;matrix2,&nbsp;float&nbsp;amount,&nbsp;ref&nbsp;MatrixD&nbsp;result) Performs spherical linear interpolation of position and rotation and scale.
static void&nbsp;Slerp(MatrixD&nbsp;matrix1,&nbsp;MatrixD&nbsp;matrix2,&nbsp;float&nbsp;amount,&nbsp;ref&nbsp;MatrixD&nbsp;result) Performs spherical linear interpolation of position and rotation.
static MatrixD&nbsp;Slerp(MatrixD&nbsp;matrix1,&nbsp;MatrixD&nbsp;matrix2,&nbsp;float&nbsp;amount) Performs spherical linear interpolation of position and rotation.
static void&nbsp;SlerpScale(MatrixD&nbsp;matrix1,&nbsp;MatrixD&nbsp;matrix2,&nbsp;float&nbsp;amount,&nbsp;ref&nbsp;MatrixD&nbsp;result) Performs spherical linear interpolation of position and rotation and scale.
static MatrixD&nbsp;SlerpScale(MatrixD&nbsp;matrix1,&nbsp;MatrixD&nbsp;matrix2,&nbsp;float&nbsp;amount) Performs spherical linear interpolation of position and rotation and scale.
static MatrixD&nbsp;Negate(MatrixD&nbsp;matrix) Negates individual elements of a matrix.
static void&nbsp;Negate(ref&nbsp;MatrixD&nbsp;matrix,&nbsp;ref&nbsp;MatrixD&nbsp;result) Negates individual elements of a matrix.
static MatrixD&nbsp;Add(MatrixD&nbsp;matrix1,&nbsp;MatrixD&nbsp;matrix2) Adds a matrix to another matrix.
static void&nbsp;Add(ref&nbsp;MatrixD&nbsp;matrix1,&nbsp;ref&nbsp;MatrixD&nbsp;matrix2,&nbsp;ref&nbsp;MatrixD&nbsp;result) Adds a matrix to another matrix.

Clone this wiki locally