Mat44_cd (struct)

The Mat44_cd represents a 4 by 4 matrix. It uses Vec4_cd types for each of the 4 rows.

参考

Xfo, Mat33_cd

/*
** Example: Mat44_cd
*/

// create a matrix 4x4
Vec4_cd v0(1.0, 0.0, 0.0, 0.0);
Vec4_cd v1(0.0, 1.0, 0.0, 0.0);
Vec4_cd v2(0.0, 0.0, 1.0, 0.0);
Vec4_cd v3(0.0, 0.0, 0.0, 1.0);
Mat44_cd 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)

Mat44_cd Mat44_cd Mat44_cd

Members

Vec4_cd row0  
Vec4_cd row1  
Vec4_cd row2  
Vec4_cd row3  

Methods

  Mat44_cd ( in Complex_d _00, in Complex_d _01, in Complex_d _02, in Complex_d _03, in Complex_d _10, in Complex_d _11, in Complex_d _12, in Complex_d _13, in Complex_d _20, in Complex_d _21, in Complex_d _22, in Complex_d _23, in Complex_d _30, in Complex_d _31, in Complex_d _32, in Complex_d _33 )
  Mat44_cd ( in Mat44_cd other )
  Mat44_cd ( in Vec4_cd row0, in Vec4_cd row1, in Vec4_cd row2, in Vec4_cd row3 )
  Mat44_cd ()
Mat44_cd add ? ( in Mat44_cd other )
Mat44_cd adjoint ? ()
Boolean almostEqual ? ( in Mat44_cd other )
Boolean almostEqual ? ( in Mat44_cd other, in Float32 precision )
Mat44_cd clone ? ()
Complex_d determinant ? ()
Mat44_cd divideComplex_d ? ( in Complex_d other )
Boolean equal ? ( in Mat44_cd other )
UInt32 hash ? ()
Mat44_cd inverse ? ()
Mat44_cd inverse_safe ? ()
Boolean isNull ? ()
Mat44_cd multiply ? ( in Mat44_cd other )
Mat44_cd multiplyComplex_d ? ( in Complex_d other )
Vec3_cd multiplyVector3 ? ( in Vec3_cd other )
Vec4_cd multiplyVector4 ? ( in Vec4_cd other )
  set ! ( in Complex_d _00, in Complex_d _01, in Complex_d _02, in Complex_d _03, in Complex_d _10, in Complex_d _11, in Complex_d _12, in Complex_d _13, in Complex_d _20, in Complex_d _21, in Complex_d _22, in Complex_d _23, in Complex_d _30, in Complex_d _31, in Complex_d _32, in Complex_d _33 )
  set ! ( in Vec3_cd translation, in Mat33_cd rotation, in Vec3_cd scaling )
  setColumns ! ( in Vec4_cd col0, in Vec4_cd col1, in Vec4_cd col2, in Vec4_cd col3 )
  setDiagonal ! ( in Complex_d v )
  setDiagonal ! ( in Vec3_cd v )
  setDiagonal ! ( in Vec4_cd v )
  setFromMat33_cd ! ( in Mat33_cd m )
  setIdentity ! ()
  setNull ! ()
  setRows ! ( in Vec4_cd row0, in Vec4_cd row1, in Vec4_cd row2, in Vec4_cd row3 )
  setScaling ! ( in Vec3_cd v )
  setTranslation ! ( in Vec3_cd tr )
  setUpperLeft ! ( in Mat33_cd m )
Mat44_cd subtract ? ( in Mat44_cd other )
Vec3_cd translation ? ()
Mat44_cd transpose ? ()
Mat33_cd upperLeft ? ()
  zeroTranslation ! ()

Operators

Mat44_cd = ( Param other )

Methods in detail

Mat44_cd ( in Complex_d _00, in Complex_d _01, in Complex_d _02, in Complex_d _03, in Complex_d _10, in Complex_d _11, in Complex_d _12, in Complex_d _13, in Complex_d _20, in Complex_d _21, in Complex_d _22, in Complex_d _23, in Complex_d _30, in Complex_d _31, in Complex_d _32, in Complex_d _33 )

Constructor from scalars


Mat44_cd ( in Mat44_cd other )

copy constructor


Mat44_cd ( in Vec4_cd row0, in Vec4_cd row1, in Vec4_cd row2, in Vec4_cd row3 )

Constructor from vectors


Mat44_cd ()


Mat44_cd Mat44_cd.add? ( in Mat44_cd other )

Overload method for the add operator


Mat44_cd Mat44_cd.adjoint? ()

Returns the adjoint matrix of this matrix


Boolean Mat44_cd.almostEqual? ( in Mat44_cd other )

Returns true if this matrix is almost the same as another one (using a default precision)


Boolean Mat44_cd.almostEqual? ( in Mat44_cd other, in Float32 precision )

Returns true if this matrix is almost the same as another one (given a precision)


Mat44_cd Mat44_cd.clone? ()

clone method


Complex_d Mat44_cd.determinant? ()

Returns the determinant of this matrix


Mat44_cd Mat44_cd.divideComplex_d? ( in Complex_d other )

Returns the division of this matrix and a scalar


Boolean Mat44_cd.equal? ( in Mat44_cd other )

Returns true if this matrix is the same as another one


UInt32 Mat44_cd.hash? ()

Hash for this value


Mat44_cd Mat44_cd.inverse? ()

Returns the inverse matrix of this matrix


Mat44_cd Mat44_cd.inverse_safe? ()

Returns the inverse matrix of this matrix, always checking the determinant value.


Boolean Mat44_cd.isNull? ()

returns true if all components in this matrix are 0.0


Mat44_cd Mat44_cd.multiply? ( in Mat44_cd other )

Overload method for the multiply operator


Mat44_cd Mat44_cd.multiplyComplex_d? ( in Complex_d other )

Returns the product of this matrix and a scalar


Vec3_cd Mat44_cd.multiplyVector3? ( in Vec3_cd other )

Returns the product of this matrix and a Vec3_cd


Vec4_cd Mat44_cd.multiplyVector4? ( in Vec4_cd other )

Returns the product of this matrix and a Vec4_cd


Mat44_cd.set! ( in Complex_d _00, in Complex_d _01, in Complex_d _02, in Complex_d _03, in Complex_d _10, in Complex_d _11, in Complex_d _12, in Complex_d _13, in Complex_d _20, in Complex_d _21, in Complex_d _22, in Complex_d _23, in Complex_d _30, in Complex_d _31, in Complex_d _32, in Complex_d _33 )

Sets each component with a single scalar value.


Mat44_cd.set! ( in Vec3_cd translation, in Mat33_cd rotation, in Vec3_cd scaling )


Mat44_cd.setColumns! ( in Vec4_cd col0, in Vec4_cd col1, in Vec4_cd col2, in Vec4_cd col3 )

Setter from vectors, column-wise


Mat44_cd.setDiagonal! ( in Complex_d v )

setting the diagonal components of this matrix to a scalar


Mat44_cd.setDiagonal! ( in Vec3_cd v )

setting the diagonal components of this matrix to the components of a Vec3_cd


Mat44_cd.setDiagonal! ( in Vec4_cd v )

matrix to the components of a Vec4_cd


Mat44_cd.setFromMat33_cd! ( in Mat33_cd m )

set the upper left 3 x 3 components from a Mat33_cd. the remaining components are set to the identify matrix’s content.


Mat44_cd.setIdentity! ()

setting this matrix to the identity matrix


Mat44_cd.setNull! ()

setting all components of the matrix to 0.0


Mat44_cd.setRows! ( in Vec4_cd row0, in Vec4_cd row1, in Vec4_cd row2, in Vec4_cd row3 )

Setter from vectors, row-wise


Mat44_cd.setScaling! ( in Vec3_cd v )

Sets the scaling of the matrix by scaling the rows of the matrix.

注釈

This will preserve the existing matrix content


Mat44_cd.setTranslation! ( in Vec3_cd tr )

Sets the translation components of this matrix to a given Vec3_cd


Mat44_cd.setUpperLeft! ( in Mat33_cd m )

replaces the upper left 3 x 3 components from a Mat33_cd.


Mat44_cd Mat44_cd.subtract? ( in Mat44_cd other )

Overload method for the subtract operator


Vec3_cd Mat44_cd.translation? ()

Returns the translation components of this matrix as a Vec3_cd


Mat44_cd Mat44_cd.transpose? ()

Returns the transposed matrix of this matrix


Mat33_cd Mat44_cd.upperLeft? ()

Returns the upper left 3 x 3 components of this matrix as a Mat33_cd


Mat44_cd.zeroTranslation! ()

Sets the translation components of this matrix to 0.0

Operators in detail

Mat44_cd = ( Param other )

Adds another matrix to this one