TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

Functions
Matrix Math
Function Categories

## Functions
String | MatrixCreate (posVec, rotVec)
String | MatrixCreateFromEuler (rotVec)
String | MatrixMulPoint (transform, point)
String | MatrixMultiply (transformA, transformB)
String | MatrixMulVector (transform, vector)

## Detailed Description

## Function Documentation

String MatrixCreate | ( | posVec | ,
|  | rotVec |
| ) |  |

Use the matrixCreate function to create a transform matrix from a three-element floating-point translation vector and a four-element floating-point rotation vector.

Parameters

  posVec | A three-element floating-point translation vector: PosY PosZ.
  rotVec | A four-element floating-point rotation vector: RotY RotZ.
  These | re rotations about the specified axes.

Returns
  Returns a transform matrix of the form PosY PosZ RotX RotY RotZ theta.

See also
  MatrixCreateFromEuler

String MatrixCreateFromEuler | ( | rotVec |  | ) |

Use the MatrixCreateFromEuler function to calculate a transform matrix from a three-element floating-point rotation vector.

Parameters

  rotVec | A three-element floating-point rotation vector: RotY RotZ. These are rotations about the specified axes.

Returns
  Returns a transform matrix of the form \0 0 0 X Y Z theta.

See also
  MatrixCreate

String MatrixMulPoint | ( | transform | ,
|  | point |
| ) |  |

Use the MatrixMulPoint function to multiply a seven element transform matrix by a three element point vector, producing a three element position vector.

Parameters

  transform | A seven-element transform matrix.
  point | A three-element point/position vector.

Returns
  Returns a three-element position vector.

See also
  MatrixMultiply, MatrixMulVector

String MatrixMultiply | ( | transformA | ,
|  | transformB |
| ) |  |

Use the MatrixMultiply function to multiply two seven-element transform matrices to produce a new seven element matrix.

Parameters

  transformA | A seven-element transform matrix of the form PosY PosZ RotX RotY RotZ theta.
  transformB | A seven-element transform matrix of the form PosY PosZ RotX RotY RotZ theta.

Returns
  Returns a seven-element matrix resulting from transiformA x transformB.

See also
  MatrixMulPoint, MatrixMulVector

String MatrixMulVector | ( | transform | ,
|  | vector |
| ) |  |

Use the MatrixMulVector function to multiply a seven-element transform matrix with a three-element matrix.

Parameters

  transform | A seven-element transform matrix of the form PosY PosZ RotX RotY RotZ theta.
  vector | A three-element vector.

Returns
  Returns three-element resulting from vector * transform.

See also
  MatrixMulPoint, MatrixMultiply