Click or drag to resize

double4x4 Structure

Represents a 4x4 Matrix typically used in ComputerGraphics algorithms.

Namespace:  Fusee.Math.Core
Assembly:  Fusee.Math.Core (in Fusee.Math.Core.dll) Version: 0.7.0.0 (0.1.0.0)
Syntax
C#
public struct double4x4 : IEquatable<double4x4>

The double4x4 type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyColumn0
The first column of this matrix
Public propertyColumn1
The second column of this matrix
Public propertyColumn2
The third column of this matrix
Public propertyColumn3
The fourth column of this matrix
Public propertyDeterminant
The determinant of this matrix
Public propertyIsAffine
Indicates whether the current matrix represents an affine transformation.
Public propertyM11
Gets or sets the value at row 1, column 1 of this instance.
Public propertyM12
Gets or sets the value at row 1, column 2 of this instance.
Public propertyM13
Gets or sets the value at row 1, column 3 of this instance.
Public propertyM14
Gets or sets the value at row 1, column 4 of this instance.
Public propertyM21
Gets or sets the value at row 2, column 1 of this instance.
Public propertyM22
Gets or sets the value at row 2, column 2 of this instance.
Public propertyM23
Gets or sets the value at row 2, column 3 of this instance.
Public propertyM24
Gets or sets the value at row 2, column 4 of this instance.
Public propertyM31
Gets or sets the value at row 3, column 1 of this instance.
Public propertyM32
Gets or sets the value at row 3, column 2 of this instance.
Public propertyM33
Gets or sets the value at row 3, column 3 of this instance.
Public propertyM34
Gets or sets the value at row 3, column 4 of this instance.
Public propertyM41
Gets or sets the value at row 4, column 1 of this instance.
Public propertyM42
Gets or sets the value at row 4, column 2 of this instance.
Public propertyM43
Gets or sets the value at row 4, column 3 of this instance.
Public propertyM44
Gets or sets the value at row 4, column 4 of this instance.
Public propertyOffset
Gets the offset part of the matrix as a double3 instance.
Public propertyStatic memberParse
Gets or sets the Converter object. Has the ability to convert a string to a double4x4.
Top
Methods
  NameDescription
Public methodStatic memberAdd
Adds two instances.
Public methodStatic memberCreateFromAxisAngle(double3, Double)
Build a rotation matrix from the specified axis/angle rotation.
Public methodStatic memberCreateFromAxisAngle(double3, Double, double4x4)
Build a rotation matrix from the specified axis/angle rotation.
Public methodStatic memberCreateOrthographic(Double, Double, Double, Double)
Creates a left handed orthographic projection matrix.
Public methodStatic memberCreateOrthographic(Double, Double, Double, Double, double4x4)
Creates a left handed orthographic projection matrix.
Public methodStatic memberCreateOrthographicOffCenter(Double, Double, Double, Double, Double, Double)
Creates a left handed orthographic projection matrix.
Public methodStatic memberCreateOrthographicOffCenter(Double, Double, Double, Double, Double, Double, double4x4)
Creates a left handed orthographic projection matrix.
Public methodStatic memberCreateOrthographicOffCenterRH
Creates a right handed orthographic projection matrix.
Public methodStatic memberCreatePerspectiveFieldOfView(Double, Double, Double, Double)
Creates a left handed perspective projection matrix.
Public methodStatic memberCreatePerspectiveFieldOfView(Double, Double, Double, Double, double4x4)
Creates a left handed perspective projection matrix.
Public methodStatic memberCreatePerspectiveFieldOfView_ROW(Double, Double, Double, Double) Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodStatic memberCreatePerspectiveFieldOfView_ROW(Double, Double, Double, Double, double4x4) Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodStatic memberCreatePerspectiveOffCenter(Double, Double, Double, Double, Double, Double)
Creates an left handed perspective projection matrix.
Public methodStatic memberCreatePerspectiveOffCenter(Double, Double, Double, Double, Double, Double, double4x4)
Creates a left handed perspective projection matrix.
Public methodStatic memberCreatePerspectiveOffCenter_ROW Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodStatic memberCreatePerspectiveOffCenterRH
Creates a right handed perspective projection matrix.
Public methodStatic memberCreateRotationX(Double)
Builds a rotation matrix for a rotation around the x-axis.
Public methodStatic memberCreateRotationX(Double, double4x4)
Builds a rotation matrix for a rotation around the x-axis.
Public methodStatic memberCreateRotationX_ROW(Double) Obsolete.
Builds a rotation matrix for a rotation around the x-axis. Only for testing and debugging purposes during the row notation -> column notation code transition of the math library.
Public methodStatic memberCreateRotationX_ROW(Double, double4x4) Obsolete.
Builds a rotation matrix for a rotation around the x-axis. Only for testing and debugging purposes during the row notation -> column notation code transition of the math library.
Public methodStatic memberCreateRotationY(Double)
Builds a rotation matrix for a rotation around the y-axis.
Public methodStatic memberCreateRotationY(Double, double4x4)
Builds a rotation matrix for a rotation around the y-axis.
Public methodStatic memberCreateRotationY_ROW(Double) Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodStatic memberCreateRotationY_ROW(Double, double4x4) Obsolete.
Builds a rotation matrix for a rotation around the y-axis. Only for testing and debugging purposes during the row notation -> column notation code transition of the math library.
Public methodStatic memberCreateRotationZ(Double)
Builds a rotation matrix for a rotation around the z-axis.
Public methodStatic memberCreateRotationZ(Double, double4x4)
Builds a rotation matrix for a rotation around the z-axis.
Public methodStatic memberCreateTranslation(double3)
Creates a translation matrix.
Public methodStatic memberCreateTranslation(double3, double4x4)
Creates a translation matrix.
Public methodStatic memberCreateTranslation(Double, Double, Double)
Creates a translation matrix.
Public methodStatic memberCreateTranslation(Double, Double, Double, double4x4)
Creates a translation matrix.
Public methodStatic memberCreateTranslation_ROW(Double, Double, Double) Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodStatic memberCreateTranslation_ROW(Double, Double, Double, double4x4) Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(double4x4)
Indicates whether the current matrix is equal to another matrix.
Public methodGetHashCode
Returns the hashcode for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInvert
Converts this instance into its inverse.
Public methodStatic memberInvert(double4x4)
Calculate the inverse of the given matrix.
Public methodStatic memberInvertAffine
Calculate the inverse of a given matrix which represents an affine transformation.
Public methodStatic memberLookAt(double3, double3, double3)
Build a left handed world space to camera space matrix
Public methodStatic memberLookAt(Double, Double, Double, Double, Double, Double, Double, Double, Double)
Build a world space to camera space matrix
Public methodStatic memberLookAt_ROW(double3, double3, double3) Obsolete.
Only for testing and debugging purposes during the row notation -> column notation code transition of the math library
Public methodStatic memberLookAt_ROW(Double, Double, Double, Double, Double, Double, Double, Double, Double) Obsolete.
Build a row notation world space to camera space matrix. Only for testing and debugging purposes during the row notation -> column notation code transition of the math library.
Public methodStatic memberLookAtRH
Build a right handed world space to camera space matrix
Public methodStatic memberMult(double4x4, double4x4)
Multiplies two instances.
Public methodStatic memberMult(double4x4, double4x4, double4x4)
Multiplies two instances.
Public methodStatic memberMultAffine
Multiplies two instances if both matrices represents affine transformations.
Public methodStatic memberScale(Double)
Build a scaling matrix
Public methodStatic memberScale(double3)
Build a scaling matrix
Public methodStatic memberScale(Double, Double, Double)
Build a scaling matrix
Public methodStatic memberSubstract
Substracts the right instance from the left instance.
Public methodToString
Returns a System.String that represents the current Matrix44.
(Overrides ValueTypeToString.)
Public methodStatic memberTransform
Transforms a given vector by a matrix via matrix*vector (Postmultiplication of the vector).
Public methodStatic memberTransformPD
Transforms a given 3D vector by a matrix using perspective division via matrix*vector (Postmultiplication of the vector).
Public methodStatic memberTransformPremult
Transforms a given vector by a matrix via vector*matrix (Premultiplication of the vector).
Public methodStatic memberTransformPremultPD
Transforms a given 3D vector by a matrix using perspective division via vector*matrix (Premultiplication of the vector).
Public methodTranspose
Converts this instance into its transpose.
Public methodStatic memberTranspose(double4x4)
Calculate the transpose of the given matrix
Public methodStatic memberTranspose(double4x4, double4x4)
Calculate the transpose of the given matrix
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Matrix addition
Public operatorStatic memberEquality
Compares two instances for equality.
Public operatorStatic memberInequality
Compares two instances for inequality.
Public operatorStatic memberMultiply(double3, double4x4)
Transforms a given threedimensional vector by a matrix via vector*matrix (Premultiplication of the vector).
Public operatorStatic memberMultiply(double4, double4x4)
Transforms a given vector by a matrix via vector*matrix (Premultiplication of the vector).
Public operatorStatic memberMultiply(double4x4, double3)
Transforms a given threedimensional vector by a matrix via matrix*vector (Postmultiplication of the vector).
Public operatorStatic memberMultiply(double4x4, double4)
Transforms a given vector by a matrix via matrix*vector (Postmultiplication of the vector).
Public operatorStatic memberMultiply(double4x4, double4x4)
Matrix multiplication
Public operatorStatic memberSubtraction
Matrix substraction
Top
Fields
  NameDescription
Public fieldStatic memberIdentity
The identity matrix
Public fieldRow0
Top row of the matrix
Public fieldRow1
2nd row of the matrix
Public fieldRow2
3rd row of the matrix
Public fieldRow3
Bottom row of the matrix
Public fieldStatic memberZero
The zero matrix
Top
Remarks

double4x4 objects represent matrices used in column-vector-notation, that means when used in common matrix-vector-multiplication scenarios, the vector should be multiplied from the right to the matrix (M * v). Concatenations of matrices from left to right represent a transformation where the rightmost matrix is applied first and the leftmost matrix is applied last, for example in (M3 * M2 * M1) * v the vector v is first transformed by M1, then by M2 and finally by M3. The translation part of a 4x4 matrix used in homogeneus coordinate calculations can be found in the the leftmost column (M14 - x-translation, M24 - y-translation, M34 - z-translation).

Note that although double4x4 objects represent matrices in COLUMN-vector-NOTATION as found in math books, the objects' contents is physically stored in ROW-major-ORDER, meaning that in physical memory, a double4x4's components are stored contiguously in the following order: first row (M11, M12, M13, M14), then second row (M21, M22, M21, M24), and so on. When exchanging matrix contents with libraries like graphics engines (OpenGL, Direct3D), physics engines, file formats, etc. make sure to convert to and from the given Matrix layout of the API you are exchanging data with.

double4x4 contains convenience construction methods to create matrices commonly used in Computer Graphics. Most of these application matrices are handedness-agnostic, meaning that the resulting matrices can be used in both, left-handed and right-handed coordinate systems. This does not hold for LookAt and Projection matrices where the viewing direction plays a role. In left-handed coordinate systems the viewing direction is positive, meaning positions further away have bigger positive z-coordinates wheras in right-handed coordinate systems positions further away have smaller negative z-coordinates. By default, double4x4 will assume a left-handed coordinate system, but contains convenience construction methods to also create right-handed matrices if necessary. The right-handed versions of methods are postfixed with "RH".

See Also