Mat4

Description

Represents a matrix for performing space/vector transformations.

Methods

inverse Returns a matrix that is the inverse of this matrix.
rotate Rotates the transformation matrix around a defined vector.
scale Scales the matrix by a defined x/y/z vector.
translate Translates the matrix by a defined x/y/z vector.

Constructor

Mat4 Constructs a matrix.

Operators

!= Compares two matrices.
* Multiplies a matrix by another vector or a scale factor.
== Compares two matrices.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.inverse()

Mat4 inverse( )

Returns

Mat4 The inverted matrix.

Description

Returns a matrix that is the inverse of this matrix.

This method creates new matrix that is the inverse of the matrix and returns it.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.rotate()

Mat4 rotate( double degrees , Vec3 vec )

Parameters

degrees The number of degrees to rotate.
vec The vector around which to rotate.

Returns

Mat4 The owning rotated matrix.

Description

Rotates the transformation matrix around a defined vector.

This method rotates the owning matrix and returns a reference to itself, instead of creating a copy of the matrix.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.scale()

Mat4 scale( Vec3 vec )

Parameters

vec The vector to scale by.

Returns

Mat4 The owning scaled matrix.

Description

Scales the matrix by a defined x/y/z vector.

This method scales the owning matrix and returns a reference to itself, instead of creating a copy of the matrix.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.translate()

Mat4 translate( Vec3 vec )

Parameters

vec The vector to translate by.

Returns

Mat4 The owning translated matrix.

Description

Translates the matrix by a defined x/y/z vector.

This method translates the owning matrix and returns a reference to itself, instead of creating a copy of the matrix.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4 Constructor

Mat4( Variant values )
Mat4( )

Parameters

values The array of 16 values to construct the matrix by. The array can either be 4x4 or flat 16.

Description

Constructs a matrix.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.operator !=

int operator !=( Mat4 mat )

Parameters

mat The matrix to compare to this matrix.

Returns

int True if the two matrices are different, false otherwise.

Description

Compares two matrices.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.operator *

Mat4 operator *( Mat4 mat )
Vec3 operator *( Vec3 vec )
Mat4 operator *( double scalar )

Parameters

mat The matrix to multiply this matrix by.
vec The vector to transform by the matrix.
scalar The scalar value to multiply each element of the matrix by.

Returns

Mat4 The resulting transformed vector/matrix.

Description

Multiplies a matrix by another vector or a scale factor.

When a Vec4 is passed, the operation will perform per-component multiplication.

Do no remove, this fixes the anchor on doc.flexsim.com

Mat4.operator ==

int operator ==( Mat4 mat )

Parameters

mat The matrix to compare to this matrix.

Returns

int True if both matrices are exactly the same, false otherwise.

Description

Compares two matrices.