-
Notifications
You must be signed in to change notification settings - Fork 125
VRageMath.Matrix
← Index ← Namespace Index
public struct Matrix: IEquatable<Matrix>
Defines a matrix.
Namespace: VRageMath
Assembly: VRage.Math.dll
Implements:
Value at row 1 column 1 of the matrix.
Value at row 1 column 2 of the matrix.
Value at row 1 column 3 of the matrix.
Value at row 1 column 4 of the matrix.
Value at row 2 column 1 of the matrix.
Value at row 2 column 2 of the matrix.
Value at row 2 column 3 of the matrix.
Value at row 2 column 4 of the matrix.
Value at row 3 column 1 of the matrix.
Value at row 3 column 2 of the matrix.
Value at row 3 column 3 of the matrix.
Value at row 3 column 4 of the matrix.
Value at row 4 column 1 of the matrix.
Value at row 4 column 2 of the matrix.
Value at row 4 column 3 of the matrix.
Value at row 4 column 4 of the matrix.
Vector3 Backward { get; set; }
Gets and sets the backward vector of the Matrix.
Gets and sets the down vector of the Matrix.
Gets and sets the forward vector of the Matrix.
Gets and sets the left vector of the Matrix.
Gets and sets the right vector of the Matrix.
Vector3 Translation { get; set; }
Gets and sets the translation vector of the Matrix.
Gets and sets the up vector of the Matrix.
static Matrix Add(Matrix matrix1, Matrix matrix2)
Adds a matrix to another matrix.
static void Add(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Adds a matrix to another matrix.
static Matrix AlignRotationToAxes(ref Matrix toAlign, ref Matrix axisDefinitionMatrix)
Creates a spherical billboard that rotates around a specified object position.
Creates a spherical billboard that rotates around a specified object position.
Creates a cylindrical billboard that rotates around a specified axis.
Creates a cylindrical billboard that rotates around a specified 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, out Matrix result)
Creates a new Matrix that rotates around an arbitrary vector.
static Matrix CreateFromDir(Vector3 dir)
static Matrix CreateFromDir(Vector3 dir, Vector3 suggestedUp)
static Matrix CreateFromQuaternion(Quaternion quaternion)
Creates a rotation Matrix from a Quaternion.
static void CreateFromQuaternion(ref Quaternion quaternion, out Matrix result)
Creates a rotation Matrix from a Quaternion.
static Matrix CreateFromTransformScale(Quaternion orientation, Vector3 position, Vector3 scale)
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, out Matrix result)
Fills in a rotation matrix from a specified yaw, pitch, and roll.
static Matrix CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)
Creates a view matrix.
Creates a view matrix.
static Matrix CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane)
Builds an orthogonal projection matrix.
Builds an orthogonal projection matrix.
Builds a customized, orthogonal projection matrix.
Builds a customized, orthogonal projection matrix.
Builds a perspective projection matrix and returns the result by value.
Builds a perspective projection matrix and returns the result by reference.
Builds a perspective projection matrix based on a field of view and returns by value.
Builds a perspective projection matrix based on a field of view and returns by reference.
Builds a customized, perspective projection matrix.
Builds a customized, perspective projection matrix.
static Matrix CreateReflection(Plane value)
Creates a Matrix that reflects the coordinate system about a specified Plane.
static void CreateReflection(ref Plane value, out Matrix result)
Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.
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, out 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, out 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, out 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 CreateScale(float xScale, float yScale, float zScale)
Creates a scaling Matrix.
static void CreateScale(float xScale, float yScale, float zScale, out Matrix result)
Creates a scaling Matrix.
static Matrix CreateScale(Vector3 scales)
Creates a scaling Matrix.
static void CreateScale(ref Vector3 scales, out Matrix result)
Creates a scaling Matrix.
static Matrix CreateScale(float scale)
Creates a scaling Matrix.
static void CreateScale(float scale, out Matrix result)
Creates a scaling Matrix.
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, out 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 CreateTranslation(Vector3 position)
Creates a translation Matrix.
static void CreateTranslation(ref Vector3 position, out 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, out Matrix result)
Creates a translation Matrix.
static Matrix CreateWorld(Vector3 position)
static Matrix CreateWorld(Vector3 position, Vector3 forward, Vector3 up)
Creates a world matrix with the specified parameters.
Creates a world matrix with the specified parameters.
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, out 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, out Matrix result)
Divides the components of a matrix by a scalar.
static bool GetEulerAnglesXYZ(ref Matrix mat, out Vector3 xyz)
static Matrix Invert(Matrix matrix)
Calculates the inverse of a matrix.
static Matrix Invert(ref Matrix matrix)
static void Invert(ref Matrix matrix, out 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, out Matrix result)
Linearly interpolates between the corresponding values of two matrices.
static Matrix Multiply(Matrix matrix1, Matrix matrix2)
Multiplies a matrix by another matrix.
static void Multiply(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Multiplies a matrix by another matrix.
static Matrix Multiply(Matrix matrix1, float scaleFactor)
Multiplies a matrix by a scalar value.
static void Multiply(ref Matrix matrix1, float scaleFactor, out Matrix result)
Multiplies a matrix by a scalar value.
static void MultiplyRotation(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Multiplies a matrix by another matrix, only rotation parts.
static Matrix Negate(Matrix matrix)
Negates individual elements of a matrix.
static void Negate(ref Matrix matrix, out Matrix result)
Negates individual elements of a matrix.
static Matrix Normalize(Matrix matrix)
static Matrix Orthogonalize(Matrix rotationMatrix)
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 Round(ref Matrix matrix)
static void Slerp(ref Matrix matrix1, ref Matrix matrix2, float amount, out Matrix result)
Performs spherical linear interpolation of position and rotation.
static void Slerp(Matrix matrix1, Matrix matrix2, float amount, out 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(ref Matrix matrix1, ref Matrix matrix2, float amount, out Matrix result)
Performs spherical linear interpolation of position and rotation and scale.
static void SlerpScale(Matrix matrix1, Matrix matrix2, float amount, out 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 void Subtract(ref Matrix matrix1, ref Matrix matrix2, out Matrix result)
Subtracts matrices.
static Matrix Subtract(Matrix matrix1, Matrix matrix2)
Subtracts matrices.
static Matrix SwapYZCoordinates(Matrix m)
static Matrix Transform(Matrix value, Quaternion rotation)
Transforms a Matrix by applying a Quaternion rotation.
static void Transform(ref Matrix value, ref Quaternion rotation, out Matrix result)
Transforms a Matrix by applying a Quaternion rotation.
static Matrix Transpose(Matrix matrix)
Transposes the rows and columns of a matrix.
static void Transpose(ref Matrix matrix, out Matrix result)
Transposes the rows and columns of a matrix.
Calculates the determinant of the matrix.
Determines whether the specified Object is equal to the Matrix.
Returns a value that indicates whether the current instance is equal to a specified object.
bool EqualsFast(ref Matrix other, float epsilon = 0.0001)
Compares just position, forward and up
Direction GetClosestDirection(Vector3 referenceVector)
Direction GetClosestDirection(ref Vector3 referenceVector)
Vector3 GetDirectionVector(Direction direction)
Gets the hash code of this object.
Gets the orientation.
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.
void SetDirectionVector(Direction direction, Vector3 newValue)
Set this ma
void SetRotationAndScale(ref MatrixD m)
void SetRow(int row, Vector4 value)
Retrieves a string representation of the current object.
void TransposeRotationInPlace()
Transposes the rows and columns of a matrix that is assumed to be rotation only in place.
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!