Mat44_i (struct)

The Mat44_i represents a 4 by 4 matrix. It uses Vec4_i types for each of the 4 rows.

参考

Xfo, Mat33_i

/*
** Example: Mat44_i
*/

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

Members

Vec4_i row0  
Vec4_i row1  
Vec4_i row2  
Vec4_i row3  

Methods

  Mat44_i ( in Mat44_i other )
  Mat44_i ( in SInt32 _00, in SInt32 _01, in SInt32 _02, in SInt32 _03, in SInt32 _10, in SInt32 _11, in SInt32 _12, in SInt32 _13, in SInt32 _20, in SInt32 _21, in SInt32 _22, in SInt32 _23, in SInt32 _30, in SInt32 _31, in SInt32 _32, in SInt32 _33 )
  Mat44_i ( in Vec4_i row0, in Vec4_i row1, in Vec4_i row2, in Vec4_i row3 )
  Mat44_i ()
Mat44_i add ? ( in Mat44_i other )
Mat44_i adjoint ? ()
Boolean almostEqual ? ( in Mat44_i other )
Boolean almostEqual ? ( in Mat44_i other, in SInt32 precision )
Mat44_i clone ? ()
  decompose ? ( out Vec3_i scaling, out Mat33_i rotation, out Vec3_i translation )
SInt32 determinant ? ()
Mat44_i divideSInt32 ? ( in SInt32 other )
Boolean equal ? ( in Mat44_i 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_i inverse ? ()
Mat44_i inverse_safe ? ()
Boolean isNull ? ()
Mat44_i multiply ? ( in Mat44_i other )
Mat44_i multiplySInt32 ? ( in SInt32 other )
Vec3_i multiplyVector3 ? ( in Vec3_i other )
Vec4_i multiplyVector4 ? ( in Vec4_i other )
  set ! ( in Float32 v<> )
  set ! ( in Float32 v<>, in UInt32 o )
  set ! ( in Float64 v<> )
  set ! ( in Float64 v<>, in UInt32 o )
  set ! ( in SInt32 _00, in SInt32 _01, in SInt32 _02, in SInt32 _03, in SInt32 _10, in SInt32 _11, in SInt32 _12, in SInt32 _13, in SInt32 _20, in SInt32 _21, in SInt32 _22, in SInt32 _23, in SInt32 _30, in SInt32 _31, in SInt32 _32, in SInt32 _33 )
  set ! ( in Vec3_i translation, in Mat33_i rotation, in Vec3_i scaling )
  set ! ( in Vec3_i translation, in Quat_i rotation, in Vec3_i scaling )
  setColumns ! ( in Vec4_i col0, in Vec4_i col1, in Vec4_i col2, in Vec4_i col3 )
  setDiagonal ! ( in SInt32 v )
  setDiagonal ! ( in Vec3_i v )
  setDiagonal ! ( in Vec4_i v )
  setFromMat33_i ! ( in Mat33_i m )
  setIdentity ! ()
  setNull ! ()
  setRotation ! ( in Quat_i q )
  setRows ! ( in Vec4_i row0, in Vec4_i row1, in Vec4_i row2, in Vec4_i row3 )
  setScaling ! ( in Vec3_i v )
  setTr ! ( in Float64 v<> )
  setTranslation ! ( in Vec3_i tr )
  setUpperLeft ! ( in Mat33_i m )
Mat44_i subtract ? ( in Mat44_i other )
Vec3_i translation ? ()
Mat44_i transpose ? ()
Mat33_i upperLeft ? ()
  zeroTranslation ! ()

Operators

Mat44_i = ( Param other )

Methods in detail

Mat44_i ( in Mat44_i other )

copy constructor


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

Constructor from scalars


Mat44_i ( in Vec4_i row0, in Vec4_i row1, in Vec4_i row2, in Vec4_i row3 )

Constructor from vectors


Mat44_i ()


Mat44_i Mat44_i.add? ( in Mat44_i other )

Overload method for the add operator


Mat44_i Mat44_i.adjoint? ()

Returns the adjoint matrix of this matrix


Boolean Mat44_i.almostEqual? ( in Mat44_i other )

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


Boolean Mat44_i.almostEqual? ( in Mat44_i other, in SInt32 precision )

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


Mat44_i Mat44_i.clone? ()

clone method


Mat44_i.decompose? ( out Vec3_i scaling, out Mat33_i rotation, out Vec3_i translation )

Decompose the Mat44_i into the scaling, rotation and translation components and return them in the provided io args.

scaling Returns the decomposed scaling value of the Mat44_i
rotation Returns the decomposed rotation value of the Mat44_i
translation Returns the decomposed translation value of the Mat44_i


SInt32 Mat44_i.determinant? ()

Returns the determinant of this matrix


Mat44_i Mat44_i.divideSInt32? ( in SInt32 other )

Returns the division of this matrix and a scalar


Boolean Mat44_i.equal? ( in Mat44_i other )

Returns true if this matrix is the same as another one


Mat44_i.get? ( io Float32 v<> )

Getter as external float32 array


Mat44_i.get? ( io Float32 v<>, in UInt32 o )

Getter as external float32 array and an offset


Mat44_i.get? ( io Float32 v[] )

Getter as float32 array


Mat44_i.get? ( io Float32 v[], in UInt32 o )

Getter as float32 array and an offset


Mat44_i.get? ( io Float64 v<> )

Getter as external float64 array


Mat44_i.get? ( io Float64 v<>, in UInt32 o )

Getter as external float64 array and an offset


Mat44_i.get? ( io Float64 v[] )

Getter as float64 array


Mat44_i.get? ( io Float64 v[], in UInt32 o )

Getter as float64 array and an offset


Mat44_i.getTr? ( io Float64 v<> )

Get to an external array, transposing in the process


UInt32 Mat44_i.hash? ()

Hash for this value


Mat44_i Mat44_i.inverse? ()

Returns the inverse matrix of this matrix


Mat44_i Mat44_i.inverse_safe? ()

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


Boolean Mat44_i.isNull? ()

returns true if all components in this matrix are 0.0


Mat44_i Mat44_i.multiply? ( in Mat44_i other )

Overload method for the multiply operator


Mat44_i Mat44_i.multiplySInt32? ( in SInt32 other )

Returns the product of this matrix and a scalar


Vec3_i Mat44_i.multiplyVector3? ( in Vec3_i other )

Returns the product of this matrix and a Vec3_i


Vec4_i Mat44_i.multiplyVector4? ( in Vec4_i other )

Returns the product of this matrix and a Vec4_i


Mat44_i.set! ( in Float32 v<> )

Setter from (standard/external) float32 array


Mat44_i.set! ( in Float32 v<>, in UInt32 o )

Setter from (standard/external) float32 array and an offset


Mat44_i.set! ( in Float64 v<> )

Setter from (standard/external) float64 array


Mat44_i.set! ( in Float64 v<>, in UInt32 o )

Setter from (standard/external) float64 array and an offset


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

Sets each component with a single scalar value.


Mat44_i.set! ( in Vec3_i translation, in Mat33_i rotation, in Vec3_i scaling )


Mat44_i.set! ( in Vec3_i translation, in Quat_i rotation, in Vec3_i scaling )


Mat44_i.setColumns! ( in Vec4_i col0, in Vec4_i col1, in Vec4_i col2, in Vec4_i col3 )

Setter from vectors, column-wise


Mat44_i.setDiagonal! ( in SInt32 v )

setting the diagonal components of this matrix to a scalar


Mat44_i.setDiagonal! ( in Vec3_i v )

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


Mat44_i.setDiagonal! ( in Vec4_i v )

matrix to the components of a Vec4_i


Mat44_i.setFromMat33_i! ( in Mat33_i m )

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


Mat44_i.setIdentity! ()

setting this matrix to the identity matrix


Mat44_i.setNull! ()

setting all components of the matrix to 0.0


Mat44_i.setRotation! ( in Quat_i q )

set the upper left 3 x 3 components from a Quat_i.

注釈

This will replace all the upper left, including scaling components if there was


Mat44_i.setRows! ( in Vec4_i row0, in Vec4_i row1, in Vec4_i row2, in Vec4_i row3 )

Setter from vectors, row-wise


Mat44_i.setScaling! ( in Vec3_i v )

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

注釈

This will preserve the existing matrix content


Mat44_i.setTr! ( in Float64 v<> )

Set from an external array, transposing in the process


Mat44_i.setTranslation! ( in Vec3_i tr )

Sets the translation components of this matrix to a given Vec3_i


Mat44_i.setUpperLeft! ( in Mat33_i m )

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


Mat44_i Mat44_i.subtract? ( in Mat44_i other )

Overload method for the subtract operator


Vec3_i Mat44_i.translation? ()

Returns the translation components of this matrix as a Vec3_i


Mat44_i Mat44_i.transpose? ()

Returns the transposed matrix of this matrix


Mat33_i Mat44_i.upperLeft? ()

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


Mat44_i.zeroTranslation! ()

Sets the translation components of this matrix to 0.0

Operators in detail

Mat44_i = ( Param other )

Adds another matrix to this one