Mat44.kl

Types

Mat44 (struct)

The Mat44 represents a 4 by 4 matrix. It uses Vec4 types for each of the 4 rows.

参考

Xfo, Mat33

/*
** Example: Mat44
*/

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

Members

Vec4 row0  
Vec4 row1  
Vec4 row2  
Vec4 row3  

Methods

  Mat44 ( in Mat44 other )
  Mat44 ( in Scalar _00, in Scalar _01, in Scalar _02, in Scalar _03, in Scalar _10, in Scalar _11, in Scalar _12, in Scalar _13, in Scalar _20, in Scalar _21, in Scalar _22, in Scalar _23, in Scalar _30, in Scalar _31, in Scalar _32, in Scalar _33 )
  Mat44 ( in Vec4 row0, in Vec4 row1, in Vec4 row2, in Vec4 row3 )
  Mat44 ()
Mat44 add ? ( in Mat44 other )
Mat44 adjoint ? ()
Boolean almostEqual ? ( in Mat44 other )
Boolean almostEqual ? ( in Mat44 other, in Scalar precision )
Mat44 clone ? ()
  decompose ? ( out Vec3 scaling, out Mat33 rotation, out Vec3 translation )
Scalar determinant ? ()
Mat44 divideScalar ? ( in Scalar other )
Boolean equal ? ( in Mat44 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 inverse ? ()
Mat44 inverse_safe ? ()
Boolean isNull ? ()
Mat44 multiply ? ( in Mat44 other )
Mat44 multiplyScalar ? ( in Scalar other )
Vec3 multiplyVector3 ? ( in Vec3 other )
Vec4 multiplyVector4 ? ( in Vec4 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 Scalar _00, in Scalar _01, in Scalar _02, in Scalar _03, in Scalar _10, in Scalar _11, in Scalar _12, in Scalar _13, in Scalar _20, in Scalar _21, in Scalar _22, in Scalar _23, in Scalar _30, in Scalar _31, in Scalar _32, in Scalar _33 )
  set ! ( in Vec3 translation, in Mat33 rotation, in Vec3 scaling )
  set ! ( in Vec3 translation, in Quat rotation, in Vec3 scaling )
  setColumns ! ( in Vec4 col0, in Vec4 col1, in Vec4 col2, in Vec4 col3 )
  setDiagonal ! ( in Scalar v )
  setDiagonal ! ( in Vec3 v )
  setDiagonal ! ( in Vec4 v )
  setFromMat33 ! ( in Mat33 m )
  setIdentity ! ()
  setNull ! ()
  setRotation ! ( in Quat q )
  setRows ! ( in Vec4 row0, in Vec4 row1, in Vec4 row2, in Vec4 row3 )
  setScaling ! ( in Vec3 v )
  setTr ! ( in Float64 v<> )
  setTranslation ! ( in Vec3 tr )
  setUpperLeft ! ( in Mat33 m )
Mat44 sphericalLinearInterpolate ? ( in Mat44 m2, in Scalar t )
Mat44 subtract ? ( in Mat44 other )
Vec3 translation ? ()
Mat44 transpose ? ()
Mat33 upperLeft ? ()
  zeroTranslation ! ()

Operators

Mat44 = ( Param other )

Functions

mathRandomMat44

Mat44 mathRandomMat44 ( in Size seed, in Size index, in Float32 min, in Float32 max )