IC Python API:RLPy RMatrix4

From Reallusion Wiki!
Revision as of 00:20, 28 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class represent the 4x4 matrix. ==Operators== This class supports the following operat...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main article: Modules.

Detailed Description

This class represent the 4x4 matrix.

Operators

This class supports the following operators:

Member Operation Syntax Description Example
__add__ Addition a + b Adds values on either side of the operator. a + b = 30
__sub__ Subtraction a - b Subtracts right hand operand from left hand operand. a – b = -10
__mul__ Multiplication a * b Multiplies values on either side of the operator. a * b = 200
__truediv__ Division a / b Divides left hand operand by right hand operand. b / a = 2
__neg__ Negation -a Return the value negated. a = -b
__eq__ Equality a == b If the values of two operands are equal, then the condition becomes true. (a == b) is not true.
__ne__ Difference a != b If values of two operands are not equal, then condition becomes true. (a != b) is true.
__gt__ Greater Than a > b If the value of left operand is greater than the value of right operand, then condition becomes true. (a > b) is not true.
__lt__ Less Than a < b If the value of left operand is less than the value of right operand, then condition becomes true. (a < b) is true.
__ge__ Greater Than or Equal a >= b If the value of left operand is greater than or equal to the value of right operand, then condition becomes true. (a >= b) is not true.
__le__ Less or Equal a <= b If the value of left operand is less than or equal to the value of right operand, then condition becomes true. (a <= b) is true.
__iadd__ Addition (Inplace) a += b It adds right operand to the left operand and assign the result to left operand. c += a is equivalent to c = c + a
__isub__ Subtraction (Inplace) a -= b It subtracts right operand from the left operand and assign the result to left operand. c -= a is equivalent to c = c - a
__imul__ Multiply (Inplace) a *= b It multiplies right operand with the left operand and assign the result to left operand. c *= a is equivalent to c = c * a
__itruediv__ Divide (Inplace) a /= b It divides left operand with the right operand and assign the result to left operand. c /= a is equivalent to c = c / ac /= a is equivalent to c = c / a

Member Functions

AccuRotate

RLPy.RMatrix4.AccuRotate ( self, rkRotate )

Accumulate matrix with rotation matrix.

Parameters

rkRotate [IN] Rotation matrix - RLPy.RMatrix3

Returns

Return a new matrix (*this) *= Accumulate - RLPy.RMatrix4

AccuScale

RLPy.RMatrix4.AccuScale ( self, rkScale )

Accumulate matrix with scale vector.

Parameters

rkScale [IN] Scale vector - RLPy.RVector3

Returns

Return a new matrix (*this) *= Accumulate - RLPy.RMatrix4

AccuTranslate

RLPy.RMatrix4.AccuTranslate ( self, rkTranslate )

Accumulate matrix with translate vector.

Parameters

rkTranslate [IN] Translate vector - RLPy.RVector3

Returns

Return a new matrix (*this) *= Accumulate - RLPy.RMatrix4

Adjoint

RLPy.RMatrix4.Adjoint ( self )

Inverse times determinant.

Returns

A new matrix containing this matrix's adjoint - RLPy.RMatrix4

AdjointTranspose

RLPy.RMatrix4.AdjointTranspose ( self )

Transpose of inverse times determinant.

Returns

A new matrix - RLPy.RMatrix4

Determinant

RLPy.RMatrix4.Determinant ( self )

The matrix's determinant.

Returns

The determinant of the matrix - float

E

RLPy.RMatrix4.E ( self, args )

Get the matrix element for the specified index(0~15).

Parameters

nRow [IN] Index of the matrix.

Returns

The matrix element specified by index - float

FromEulerAngle

RLPy.RMatrix4.FromEulerAngle ( self, Oreder, rx, ry, rz )

Rotation matrix from Euler angle.

Parameters

Oreder [IN] Euler order - RLPy.Rotation_Order

rx [IN] Angle of x-axis in radians - float

ry [IN] Angle of y-axis in radians - float

rz [IN] Angle of z-axis in radians - float

Returns

Return a new matrix from specified axis angle - RLPy.RMatrix4

GetColumn

RLPy.RMatrix4.GetColumn ( self, nC )

Get the matrix element for the specified column.

Parameters

nRow [IN] Index of the column in the matrix.

Returns

The column vector of the matrix - RLPy.RVector4

GetRow

RLPy.RMatrix4.GetRow ( self, nR )

Get the matrix element for the specified row.

Parameters

nRow [IN] Index of the row in the matrix.

Returns

The row vector of the matrix - RLPy.RVector4

GetSR

RLPy.RMatrix4.GetSR ( self )

Get scale and rotation part of the matrix.

Returns

Return a 3x3 matrix - RLPy.RMatrix3

GetTranslate

RLPy.RMatrix4.GetTranslate ( self )

Get translate of the matrix.

Returns

Return a translate vector - RLPy.RVector3

InfNorm

RLPy.RMatrix4.InfNorm ( self )

InfNorm of the matrix.

Returns

Return InfNorm - float

Inverse

RLPy.RMatrix4.Inverse ( self )

Inverse of the matrix.

Returns

A new matrix containing this matrix's inverse - RLPy.RMatrix4

InverseTranspose

RLPy.RMatrix4.InverseTranspose ( self )

Transpose of inverse.

Returns

A new matrix - RLPy.RMatrix4

M

RLPy.RMatrix4.M ( self, args )

Get the matrix element for the specified row and column.

Parameters

nRow [IN] Index of the row in the matrix - int

nCol [IN] Index of the column in the matrix - int

Returns

The matrix element specified by row and col - float

MakeIdentity

RLPy.RMatrix4.MakeIdentity ( self )

Sets the matrix to the identity.

Returns

This object - RLPy.RMatrix4

MaxColumn

RLPy.RMatrix4.MaxColumn ( self )

Get maximum value of the column index in the matrix.

Returns

Return index of column of M containing maximum abs entry, or -1 if M = 0 - int

MaxRow

RLPy.RMatrix4.MaxRow ( self )

Get maximum value of the row index in the matrix.

Returns

Return index of row of M containing maximum abs entry, or -1 if M = 0 - int

OneNorm

RLPy.RMatrix4.OneNorm ( self )

Norm of the matrix.

Returns

Return Norm - float

RotateAxisAngle

RLPy.RMatrix4.RotateAxisAngle ( self, rkAxis, fAngle )

Rotation matrix from axis angle.

Parameters

rkAxis [IN] axis vector - RLPy.RVector3

fAngle [IN] angle in radians - float

Returns

Return a new matrix from specified axis angle - RLPy.RMatrix4

RotationX

RLPy.RMatrix4.RotationX ( self, fAngle )

Rotation matrix for rotations around x-axis.

Parameters

fAngle [IN] angle in radians - float

Returns

Return a new matrix of for rotations around x-axis - RLPy.RMatrix4

RotationY

RLPy.RMatrix4.RotationY ( self, fAngle )

Rotation matrix for rotations around y-axis.

Parameters

fAngle [IN] angle in radians - float

Returns

Return a new matrix of for rotations around y-axis - RLPy.RMatrix4

RotationZ

RLPy.RMatrix4.RotationZ ( self, fAngle )

Rotation matrix for rotations around z-axis.

Parameters

fAngle [IN] angle in radians - float

Returns

Return a new matrix of for rotations around z-axis - RLPy.RMatrix4

SetSR

RLPy.RMatrix4.SetSR ( self, mSR )

Set scale and rotation part of the matrix.

Parameters

mSR [IN] 3x3 matrix - RLPy.RMatrix3

Returns

Return a new 4x4 matrix - RLPy.RMatrix4

SetTranslate

RLPy.RMatrix4.SetTranslate ( self, vTranslate )

Set translate of the matrix.

Parameters

vTranslate [IN] Translate vector - RLPy.RVector3

Returns

Return a new matrix with the specified translation - RLPy.RMatrix4

TimesTranspose

RLPy.RMatrix4.TimesTranspose ( self, mM )

Multiplies of the transpose of the matrix.

Parameters

mM [IN] the matrix - RLPy.RMatrix4

Returns

A new matrix. (this * M^T) - RLPy.RMatrix4

Transpose

RLPy.RMatrix4.Transpose ( self )

Transpose of the matrix.

Returns

A new matrix containing this matrix's transpose - RLPy.RMatrix4

TransposeTimes

RLPy.RMatrix4.TransposeTimes ( self, mM )

Multiplies of the transpose of the matrix.

Parameters

mM [IN] the matrix - RLPy.RMatrix4

Returns

A new matrix. (this^T * mM) - RLPy.RMatrix4