Mat44_c (struct)

The Mat44_c represents a 4 by 4 matrix. It uses Vec4_c types for each of the 4 rows.

参考

Xfo, Mat33_c

/*
** Example: Mat44_c
*/

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

Members

Vec4_c row0  
Vec4_c row1  
Vec4_c row2  
Vec4_c row3  

Methods

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

Operators

Mat44_c = ( Param other )

Methods in detail

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

Constructor from scalars


Mat44_c ( in Mat44_c other )

copy constructor


Mat44_c ( in Vec4_c row0, in Vec4_c row1, in Vec4_c row2, in Vec4_c row3 )

Constructor from vectors


Mat44_c ()


Mat44_c Mat44_c.add? ( in Mat44_c other )

Overload method for the add operator


Mat44_c Mat44_c.adjoint? ()

Returns the adjoint matrix of this matrix


Boolean Mat44_c.almostEqual? ( in Mat44_c other )

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


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

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


Mat44_c Mat44_c.clone? ()

clone method


Complex Mat44_c.determinant? ()

Returns the determinant of this matrix


Mat44_c Mat44_c.divideComplex? ( in Complex other )

Returns the division of this matrix and a scalar


Boolean Mat44_c.equal? ( in Mat44_c other )

Returns true if this matrix is the same as another one


UInt32 Mat44_c.hash? ()

Hash for this value


Mat44_c Mat44_c.inverse? ()

Returns the inverse matrix of this matrix


Mat44_c Mat44_c.inverse_safe? ()

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


Boolean Mat44_c.isNull? ()

returns true if all components in this matrix are 0.0


Mat44_c Mat44_c.multiply? ( in Mat44_c other )

Overload method for the multiply operator


Mat44_c Mat44_c.multiplyComplex? ( in Complex other )

Returns the product of this matrix and a scalar


Vec3_c Mat44_c.multiplyVector3? ( in Vec3_c other )

Returns the product of this matrix and a Vec3_c


Vec4_c Mat44_c.multiplyVector4? ( in Vec4_c other )

Returns the product of this matrix and a Vec4_c


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

Sets each component with a single scalar value.


Mat44_c.set! ( in Vec3_c translation, in Mat33_c rotation, in Vec3_c scaling )


Mat44_c.setColumns! ( in Vec4_c col0, in Vec4_c col1, in Vec4_c col2, in Vec4_c col3 )

Setter from vectors, column-wise


Mat44_c.setDiagonal! ( in Complex v )

setting the diagonal components of this matrix to a scalar


Mat44_c.setDiagonal! ( in Vec3_c v )

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


Mat44_c.setDiagonal! ( in Vec4_c v )

matrix to the components of a Vec4_c


Mat44_c.setFromMat33_c! ( in Mat33_c m )

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


Mat44_c.setIdentity! ()

setting this matrix to the identity matrix


Mat44_c.setNull! ()

setting all components of the matrix to 0.0


Mat44_c.setRows! ( in Vec4_c row0, in Vec4_c row1, in Vec4_c row2, in Vec4_c row3 )

Setter from vectors, row-wise


Mat44_c.setScaling! ( in Vec3_c v )

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

注釈

This will preserve the existing matrix content


Mat44_c.setTranslation! ( in Vec3_c tr )

Sets the translation components of this matrix to a given Vec3_c


Mat44_c.setUpperLeft! ( in Mat33_c m )

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


Mat44_c Mat44_c.subtract? ( in Mat44_c other )

Overload method for the subtract operator


Vec3_c Mat44_c.translation? ()

Returns the translation components of this matrix as a Vec3_c


Mat44_c Mat44_c.transpose? ()

Returns the transposed matrix of this matrix


Mat33_c Mat44_c.upperLeft? ()

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


Mat44_c.zeroTranslation! ()

Sets the translation components of this matrix to 0.0

Operators in detail

Mat44_c = ( Param other )

Adds another matrix to this one