## SFMatrix4f

The SFMatrix4f object provides many useful functions for performing manipulations on 4x4 matrices.

Each of element of the matrix can be accessed using C-style array dereferencing (i.e., `m[0][1]`

is the element in row 0, column 1). The results of dereferencing a SFMatrix4f object using a single index (i.e., `m[0]`

) are undefined. The translation elements are in the third row. For example, `m[2][0]`

is the X offset.Additionally the individual rows of the matrix may be addressed using array-style indexing returning a SFMatrix4Row instance. The values of the SFMatrix4Row instance can be accessed using C-Style array dereferencing (e.g., m[0] is f11, [2] is f12, [3] is f13 and [4] is f14.

### Properties

Type | Property | Description | Standard |
---|

### Functions

Return type | Function | Description | Standard |
---|---|---|---|

void | setTransform(SFVec3f translation, SFRotation rotation, SFVec3f scale, SFRotation scaleOrientation, SFVec3f center) | Sets the Matrix to the passed values. Any of the rightmost parameters may be omitted. The function has zero to five parameters. For example, specifying zero parameters results in an identity matrix while specifying one parameter results in a translation and specifying two parameters results in a translation and a rotation. Any unspecified parameter is set to its default as specified for the Transform node. Values are applied to the matrix in the same order as the matrix field calculations for the Transform node. | Avalon |

void | getTransform(SFVec3f translation, SFRotation rotation, SFVec3f scale) | Decomposes the Matrix and returns the components in the passed translation, rotation, and scale objects. The types of these passed objects is the same as the first three arguments to setTransform. If any passed object is not sent, or if the null object is sent for any value, that value is not returned. Any projection or shear information in the matrix is ignored. | Avalon |

SFMatrix4f | inverse() | Returns a new SFMatrix4f whose value is the inverse of this object.
| Avalon |

SFMatrix4f | transpose() | Returns a new SFMatrix4f whose value is the transpose of this object.
| Avalon |

SFMatrix4f | multLeft(SFMatrix4f n) | Returns a new SFMatrix4f whose value is the object multiplied by the passed matrix on the left.
| Avalon |

SFMatrix4f | multRight(SFMatrix4f m) | Returns a new SFMatrix4f whose value is the object multiplied by the passed matrix on the right.
| Avalon |

SFVec3f | multVecMatrix(SFVec3f vec) | Returns a new SFVec3f whose value is the object multiplied by the passed row vector.
| Avalon |

SFVec3f | multMatrixVec(SFVec3f vec) | Returns a new SFVec3f whose value is the object multiplied by the passed column vector.
| Avalon |

String | toString() | Returns a String containing the matrix contents encoded using the X3D Classic VRML encoding.
| Avalon |