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 CreateBillboard(Vector3D objectPosition, Vector3D cameraPosition, Vector3D cameraUpVector, Nullable<Vector3D> cameraForwardVector) Creates a spherical billboard that rotates around a specified object position.
static void CreateBillboard(ref Vector3D objectPosition, ref Vector3D cameraPosition, ref Vector3D cameraUpVector, Nullable<Vector3D> cameraForwardVector, ref MatrixD result) Creates a spherical billboard that rotates around a specified object position.
static MatrixD CreateConstrainedBillboard(Vector3D objectPosition, Vector3D cameraPosition, Vector3D rotateAxis, Nullable<Vector3D> cameraForwardVector, Nullable<Vector3D> objectForwardVector) Creates a cylindrical billboard that rotates around a specified axis.
static void CreateConstrainedBillboard(ref Vector3D objectPosition, ref Vector3D cameraPosition, ref Vector3D rotateAxis, Nullable<Vector3D> cameraForwardVector, Nullable<Vector3D> objectForwardVector, ref MatrixD result) Creates a cylindrical billboard that rotates around a specified axis.
static MatrixD CreateTranslation(Vector3D position) Creates a translation Matrix.
static MatrixD CreateTranslation(Vector3 position)
static void CreateTranslation(ref Vector3D position, ref MatrixD result) Creates a translation Matrix.
static MatrixD CreateTranslation(double xPosition, double yPosition, double zPosition) Creates a translation Matrix.
static void CreateTranslation(double xPosition, double yPosition, double zPosition, ref MatrixD result) Creates a translation Matrix.
static MatrixD CreateScale(double xScale, double yScale, double zScale) Creates a scaling Matrix.
static void CreateScale(double xScale, double yScale, double zScale, ref MatrixD result) Creates a scaling Matrix.
static MatrixD CreateScale(Vector3D scales) Creates a scaling Matrix.
static void CreateScale(ref Vector3D scales, ref MatrixD result) Creates a scaling Matrix.
static MatrixD CreateScale(double scale) Creates a scaling Matrix.
static void CreateScale(double scale, ref MatrixD result) Creates a scaling Matrix.
static MatrixD CreateRotationX(double radians) Returns a matrix that can be used to rotate a set of vertices around the x-axis.
static void CreateRotationX(double radians, ref MatrixD result) Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.
static MatrixD CreateRotationY(double radians) Returns a matrix that can be used to rotate a set of vertices around the y-axis.
static void CreateRotationY(double radians, ref MatrixD result) Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.
static MatrixD CreateRotationZ(double radians) Returns a matrix that can be used to rotate a set of vertices around the z-axis.
static void CreateRotationZ(double radians, ref MatrixD result) Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.
static MatrixD CreateFromAxisAngle(Vector3D axis, double angle) Creates a new Matrix that rotates around an arbitrary vector.
static void CreateFromAxisAngle(ref Vector3D axis, double angle, ref MatrixD result) Creates a new Matrix that rotates around an arbitrary vector.
static MatrixD CreatePerspectiveFieldOfView(double fieldOfView, double aspectRatio, double nearPlaneDistance, double farPlaneDistance) Builds a perspective projection matrix based on a field of view and returns by value.
static void CreatePerspectiveFieldOfView(double fieldOfView, double aspectRatio, double nearPlaneDistance, double farPlaneDistance, ref MatrixD result) Builds a perspective projection matrix based on a field of view and returns by reference.
static MatrixD CreatePerspective(double width, double height, double nearPlaneDistance, double farPlaneDistance) Builds a perspective projection matrix and returns the result by value.
static void CreatePerspective(double width, double height, double nearPlaneDistance, double farPlaneDistance, ref MatrixD result) Builds a perspective projection matrix and returns the result by reference.
static MatrixD CreatePerspectiveOffCenter(double left, double right, double bottom, double top, double nearPlaneDistance, double farPlaneDistance) Builds a customized, perspective projection matrix.
static void CreatePerspectiveOffCenter(double left, double right, double bottom, double top, double nearPlaneDistance, double farPlaneDistance, ref MatrixD result) Builds a customized, perspective projection matrix.
static MatrixD CreateOrthographic(double width, double height, double zNearPlane, double zFarPlane) Builds an orthogonal projection matrix.
static void CreateOrthographic(double width, double height, double zNearPlane, double zFarPlane, ref MatrixD result) Builds an orthogonal projection matrix.
static MatrixD CreateOrthographicOffCenter(double left, double right, double bottom, double top, double zNearPlane, double zFarPlane) Builds a customized, orthogonal projection matrix.
static void CreateOrthographicOffCenter(double left, double right, double bottom, double top, double zNearPlane, double zFarPlane, ref MatrixD result) Builds a customized, orthogonal projection matrix.
static MatrixD CreateLookAt(Vector3D cameraPosition, Vector3D cameraTarget, Vector3 cameraUpVector)
static MatrixD CreateLookAt(Vector3D cameraPosition, Vector3D cameraTarget, Vector3D cameraUpVector) Creates a view matrix.
static Matrix CreateLookAtInverse(Vector3D cameraPosition, Vector3D cameraTarget, Vector3D cameraUpVector)
static void CreateLookAt(ref Vector3D cameraPosition, ref Vector3D cameraTarget, ref Vector3D cameraUpVector, ref MatrixD result) Creates a view matrix.
static MatrixD CreateWorld(Vector3D position, Vector3 forward, Vector3 up)
static MatrixD CreateWorld(Vector3D position)
static MatrixD CreateWorld(Vector3D position, Vector3D forward, Vector3D up) Creates a world matrix with the specified parameters.
static void CreateWorld(ref Vector3D position, ref Vector3D forward, ref Vector3D up, ref MatrixD result) Creates a world matrix with the specified parameters.
static MatrixD CreateFromQuaternion(Quaternion quaternion) Creates a rotation Matrix from a Quaternion.
static MatrixD CreateFromQuaternion(QuaternionD quaternion)
static void CreateFromQuaternion(ref Quaternion quaternion, ref MatrixD result) Creates a rotation Matrix from a Quaternion.
static MatrixD CreateFromYawPitchRoll(double yaw, double pitch, double roll) Creates a new rotation matrix from a specified yaw, pitch, and roll.
static void CreateFromYawPitchRoll(double yaw, double pitch, double roll, ref MatrixD result) Fills in a rotation matrix from a specified yaw, pitch, and roll.
static MatrixD CreateFromTransformScale(Quaternion orientation, Vector3D position, Vector3D scale)
static MatrixD CreateShadow(Vector3D 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 Vector3D lightDirection, ref Plane plane, ref MatrixD result) Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source.
static MatrixD CreateReflection(Plane value) Creates a Matrix that reflects the coordinate system about a specified Plane.
static void CreateReflection(ref Plane value, ref MatrixD result) Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.
static MatrixD Transform(MatrixD value, Quaternion rotation) Transforms a Matrix by applying a Quaternion rotation.
static void Transform(ref MatrixD value, ref Quaternion rotation, ref MatrixD 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(MatrixD other) Determines whether the specified Object is equal to the Matrix.
bool EqualsFast(ref MatrixD other, double 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 MatrixD Transpose(MatrixD matrix) Transposes the rows and columns of a matrix.
static void Transpose(ref MatrixD matrix, ref MatrixD result) Transposes the rows and columns of a matrix.
double Determinant() Calculates the determinant of the matrix.
static MatrixD Invert(MatrixD matrix) Calculates the inverse of a matrix.
static MatrixD Invert(ref MatrixD matrix)
static void Invert(ref MatrixD matrix, ref MatrixD result) Calculates the inverse of a matrix.
static MatrixD Lerp(MatrixD matrix1, MatrixD matrix2, double amount) Linearly interpolates between the corresponding values of two matrices.
static void Lerp(ref MatrixD matrix1, ref MatrixD matrix2, double amount, ref MatrixD result) Linearly interpolates between the corresponding values of two matrices.
static void Slerp(ref MatrixD matrix1, ref MatrixD matrix2, float amount, ref MatrixD result) Performs spherical linear interpolation of position and rotation.
bool IsOrthogonal()
bool IsOrthogonal(double epsilon)
static void SlerpScale(ref MatrixD matrix1, ref MatrixD matrix2, float amount, ref MatrixD result) Performs spherical linear interpolation of position and rotation and scale.
static void Slerp(MatrixD matrix1, MatrixD matrix2, float amount, ref MatrixD result) Performs spherical linear interpolation of position and rotation.
static MatrixD Slerp(MatrixD matrix1, MatrixD matrix2, float amount) Performs spherical linear interpolation of position and rotation.
static void SlerpScale(MatrixD matrix1, MatrixD matrix2, float amount, ref MatrixD result) Performs spherical linear interpolation of position and rotation and scale.
static MatrixD SlerpScale(MatrixD matrix1, MatrixD matrix2, float amount) Performs spherical linear interpolation of position and rotation and scale.
static MatrixD Negate(MatrixD matrix) Negates individual elements of a matrix.
static void Negate(ref MatrixD matrix, ref MatrixD result) Negates individual elements of a matrix.
static MatrixD Add(MatrixD matrix1, MatrixD matrix2) Adds a matrix to another matrix.
static void Add(ref MatrixD matrix1, ref MatrixD matrix2, ref MatrixD result) Adds a matrix to another matrix.

Clone this wiki locally