Mat44_d (struct)¶
The Mat44_d represents a 4 by 4 matrix. It uses Vec4_d types for each of the 4 rows.
/*
** Example: Mat44_d
*/
// create a matrix 4x4
Vec4_d v0(1.0, 0.0, 0.0, 0.0);
Vec4_d v1(0.0, 1.0, 0.0, 0.0);
Vec4_d v2(0.0, 0.0, 1.0, 0.0);
Vec4_d v3(0.0, 0.0, 0.0, 1.0);
Mat44_d mat(v0, v1, v2, v3);
Fabric Engine Matrices are column-major rather than row-major¶
Most DCCs follow a row-major convention for expressing their matrices which implies that multiplication of matrices occurs in the opposite order to those in Fabric Engine.
In Maya and Softimage, to transform a point (P) by a matrix (WM), you would post-multiply the vector by the matrix by placing it on the left side of the matrix.
(P’ = P x WM)
In Fabric Engine, to transform a point (P) by a matrix (WM), you would post-multiply it by placing it on the right hand side of the matrix.
(P’ = WM x P)
When multiplying matrices together, the order of the matrices is also swapped when compared to Maya/Softimage.
To Transform a Matrix (M) into the space of a another matrix (WM), you would place the L on the right hand side of WM
(M’ = WM x M)
In Maya, Softimage and 3dsmax, the order of the matrices in the multiplication would be swapped.
(M’ = M x WM)
Methods¶
Mat44_d ( in Float64 _00, in Float64 _01, in Float64 _02, in Float64 _03, in Float64 _10, in Float64 _11, in Float64 _12, in Float64 _13, in Float64 _20, in Float64 _21, in Float64 _22, in Float64 _23, in Float64 _30, in Float64 _31, in Float64 _32, in Float64 _33 ) | |
Mat44_d ( in Mat44_d other ) | |
Mat44_d ( in Vec4_d row0, in Vec4_d row1, in Vec4_d row2, in Vec4_d row3 ) | |
Mat44_d () | |
Mat44_d | add ? ( in Mat44_d other ) |
Mat44_d | adjoint ? () |
Boolean | almostEqual ? ( in Mat44_d other ) |
Boolean | almostEqual ? ( in Mat44_d other, in Float64 precision ) |
Mat44_d | clone ? () |
decompose ? ( out Vec3_d scaling, out Mat33_d rotation, out Vec3_d translation ) | |
Float64 | determinant ? () |
Mat44_d | divideFloat64 ? ( in Float64 other ) |
Boolean | equal ? ( in Mat44_d other ) |
get ? ( io Float32 v<> ) | |
get ? ( io Float32 v<>, in UInt32 o ) | |
get ? ( io Float32 v[] ) | |
get ? ( io Float32 v[], in UInt32 o ) | |
get ? ( io Float64 v<> ) | |
get ? ( io Float64 v<>, in UInt32 o ) | |
get ? ( io Float64 v[] ) | |
get ? ( io Float64 v[], in UInt32 o ) | |
getTr ? ( io Float64 v<> ) | |
UInt32 | hash ? () |
Mat44_d | inverse ? () |
Mat44_d | inverse_safe ? () |
Boolean | isNull ? () |
Mat44_d | multiply ? ( in Mat44_d other ) |
Mat44_d | multiplyFloat64 ? ( in Float64 other ) |
Vec3_d | multiplyVector3 ? ( in Vec3_d other ) |
Vec4_d | multiplyVector4 ? ( in Vec4_d other ) |
set ! ( in Float32 v<> ) | |
set ! ( in Float32 v<>, in UInt32 o ) | |
set ! ( in Float64 _00, in Float64 _01, in Float64 _02, in Float64 _03, in Float64 _10, in Float64 _11, in Float64 _12, in Float64 _13, in Float64 _20, in Float64 _21, in Float64 _22, in Float64 _23, in Float64 _30, in Float64 _31, in Float64 _32, in Float64 _33 ) | |
set ! ( in Float64 v<> ) | |
set ! ( in Float64 v<>, in UInt32 o ) | |
set ! ( in Vec3_d translation, in Mat33_d rotation, in Vec3_d scaling ) | |
set ! ( in Vec3_d translation, in Quat_d rotation, in Vec3_d scaling ) | |
setColumns ! ( in Vec4_d col0, in Vec4_d col1, in Vec4_d col2, in Vec4_d col3 ) | |
setDiagonal ! ( in Float64 v ) | |
setDiagonal ! ( in Vec3_d v ) | |
setDiagonal ! ( in Vec4_d v ) | |
setFromMat33_d ! ( in Mat33_d m ) | |
setIdentity ! () | |
setNull ! () | |
setRotation ! ( in Quat_d q ) | |
setRows ! ( in Vec4_d row0, in Vec4_d row1, in Vec4_d row2, in Vec4_d row3 ) | |
setScaling ! ( in Vec3_d v ) | |
setTr ! ( in Float64 v<> ) | |
setTranslation ! ( in Vec3_d tr ) | |
setUpperLeft ! ( in Mat33_d m ) | |
Mat44_d | subtract ? ( in Mat44_d other ) |
Vec3_d | translation ? () |
Mat44_d | transpose ? () |
Mat33_d | upperLeft ? () |
zeroTranslation ! () |
Methods in detail¶
Mat44_d ( in Float64 _00, in Float64 _01, in Float64 _02, in Float64 _03, in Float64 _10, in Float64 _11, in Float64 _12, in Float64 _13, in Float64 _20, in Float64 _21, in Float64 _22, in Float64 _23, in Float64 _30, in Float64 _31, in Float64 _32, in Float64 _33 )
Constructor from scalars
copy constructor
Mat44_d ( in Vec4_d row0, in Vec4_d row1, in Vec4_d row2, in Vec4_d row3 )
Constructor from vectors
Mat44_d ()
Mat44_d Mat44_d.add? ( in Mat44_d other )
Overload method for the add operator
Returns the adjoint matrix of this matrix
Boolean Mat44_d.almostEqual? ( in Mat44_d other )
Returns true if this matrix is almost the same as another one (using a default precision)
Boolean Mat44_d.almostEqual? ( in Mat44_d other, in Float64 precision )
Returns true if this matrix is almost the same as another one (given a precision)
clone method
Mat44_d.decompose? ( out Vec3_d scaling, out Mat33_d rotation, out Vec3_d translation )
Decompose the Mat44_d into the scaling, rotation and translation components and return them in the provided io args.
scaling | Returns the decomposed scaling value of the Mat44_d |
rotation | Returns the decomposed rotation value of the Mat44_d |
translation | Returns the decomposed translation value of the Mat44_d |
Float64 Mat44_d.determinant? ()
Returns the determinant of this matrix
Mat44_d Mat44_d.divideFloat64? ( in Float64 other )
Returns the division of this matrix and a scalar
Boolean Mat44_d.equal? ( in Mat44_d other )
Returns true if this matrix is the same as another one
Mat44_d.get? ( io Float32 v<> )
Getter as external float32 array
Mat44_d.get? ( io Float32 v<>, in UInt32 o )
Getter as external float32 array and an offset
Mat44_d.get? ( io Float32 v[] )
Getter as float32 array
Mat44_d.get? ( io Float32 v[], in UInt32 o )
Getter as float32 array and an offset
Mat44_d.get? ( io Float64 v<> )
Getter as external float64 array
Mat44_d.get? ( io Float64 v<>, in UInt32 o )
Getter as external float64 array and an offset
Mat44_d.get? ( io Float64 v[] )
Getter as float64 array
Mat44_d.get? ( io Float64 v[], in UInt32 o )
Getter as float64 array and an offset
Mat44_d.getTr? ( io Float64 v<> )
Get to an external array, transposing in the process
Hash for this value
Returns the inverse matrix of this matrix
Mat44_d Mat44_d.inverse_safe? ()
Returns the inverse matrix of this matrix, always checking the determinant value.
Boolean Mat44_d.isNull? ()
returns true if all components in this matrix are 0.0
Mat44_d Mat44_d.multiply? ( in Mat44_d other )
Overload method for the multiply operator
Mat44_d Mat44_d.multiplyFloat64? ( in Float64 other )
Returns the product of this matrix and a scalar
Vec3_d Mat44_d.multiplyVector3? ( in Vec3_d other )
Returns the product of this matrix and a Vec3_d
Vec4_d Mat44_d.multiplyVector4? ( in Vec4_d other )
Returns the product of this matrix and a Vec4_d
Mat44_d.set! ( in Float32 v<> )
Setter from (standard/external) float32 array
Mat44_d.set! ( in Float32 v<>, in UInt32 o )
Setter from (standard/external) float32 array and an offset
Mat44_d.set! ( in Float64 _00, in Float64 _01, in Float64 _02, in Float64 _03, in Float64 _10, in Float64 _11, in Float64 _12, in Float64 _13, in Float64 _20, in Float64 _21, in Float64 _22, in Float64 _23, in Float64 _30, in Float64 _31, in Float64 _32, in Float64 _33 )
Sets each component with a single scalar value.
Mat44_d.set! ( in Float64 v<> )
Setter from (standard/external) float64 array
Mat44_d.set! ( in Float64 v<>, in UInt32 o )
Setter from (standard/external) float64 array and an offset
Mat44_d.set! ( in Vec3_d translation, in Mat33_d rotation, in Vec3_d scaling )
Mat44_d.set! ( in Vec3_d translation, in Quat_d rotation, in Vec3_d scaling )
Mat44_d.setColumns! ( in Vec4_d col0, in Vec4_d col1, in Vec4_d col2, in Vec4_d col3 )
Setter from vectors, column-wise
Mat44_d.setDiagonal! ( in Float64 v )
setting the diagonal components of this matrix to a scalar
Mat44_d.setDiagonal! ( in Vec3_d v )
setting the diagonal components of this matrix to the components of a Vec3_d
Mat44_d.setDiagonal! ( in Vec4_d v )
matrix to the components of a Vec4_d
Mat44_d.setFromMat33_d! ( in Mat33_d m )
set the upper left 3 x 3 components from a Mat33_d. the remaining components are set to the identify matrix’s content.
Mat44_d.setIdentity! ()
setting this matrix to the identity matrix
Mat44_d.setNull! ()
setting all components of the matrix to 0.0
Mat44_d.setRotation! ( in Quat_d q )
set the upper left 3 x 3 components from a Quat_d.
注釈
This will replace all the upper left, including scaling components if there was
Mat44_d.setRows! ( in Vec4_d row0, in Vec4_d row1, in Vec4_d row2, in Vec4_d row3 )
Setter from vectors, row-wise
Mat44_d.setScaling! ( in Vec3_d v )
Sets the scaling of the matrix by scaling the rows of the matrix.
注釈
This will preserve the existing matrix content
Mat44_d.setTr! ( in Float64 v<> )
Set from an external array, transposing in the process
Mat44_d.setTranslation! ( in Vec3_d tr )
Sets the translation components of this matrix to a given Vec3_d
Mat44_d.setUpperLeft! ( in Mat33_d m )
replaces the upper left 3 x 3 components from a Mat33_d.
Mat44_d Mat44_d.subtract? ( in Mat44_d other )
Overload method for the subtract operator
Vec3_d Mat44_d.translation? ()
Returns the translation components of this matrix as a Vec3_d
Returns the transposed matrix of this matrix
Returns the upper left 3 x 3 components of this matrix as a Mat33_d
Mat44_d.zeroTranslation! ()
Sets the translation components of this matrix to 0.0