Logo Euclid

AutoOpenRigidMatrix Module

When Euclid is opened this module will be auto-opened. It only contains extension members for type RigidMatrix.

Type extensions

Type extension Description

this.Decompose

Full Usage: this.Decompose

Parameters:
    () : unit

Returns: Quaternion * Vec A tuple of the rotation quaternion and the translation vector. RigidMatrix.createFromTranslationAndQuaternion recomposes the matrix.

Decomposes this RigidMatrix into its rotation and translation. The rotation is applied first and the translation second.

Extended Type: RigidMatrix

() : unit
Returns: Quaternion * Vec

A tuple of the rotation quaternion and the translation vector. RigidMatrix.createFromTranslationAndQuaternion recomposes the matrix.

this.Interpolate

Full Usage: this.Interpolate

Parameters:
    finish : RigidMatrix - The matrix at factor 1.
    factor : float - The finite interpolation factor.

Returns: RigidMatrix A new interpolated RigidMatrix.

Interpolates from this matrix to finish for animations. The translation is interpolated linearly, so the origin moves on a straight line. The rotation is interpolated with Quaternion.slerp along the shortest rotation, at a constant angular speed. Factor 0 returns this matrix and factor 1 returns finish. The factor is not clamped: negative factors and factors above one extrapolate. Fails if the factor is not finite.

Extended Type: RigidMatrix

finish : RigidMatrix

The matrix at factor 1.

factor : float

The finite interpolation factor.

Returns: RigidMatrix

A new interpolated RigidMatrix.

RigidMatrix.createFromTranslationAndQuaternion rotation translation

Full Usage: RigidMatrix.createFromTranslationAndQuaternion rotation translation

Parameters:
    rotation : Quaternion - The rotation, applied first.
    translation : Vec - The translation, applied second.

Returns: RigidMatrix A new RigidMatrix.

Creates a RigidMatrix that first rotates and then translates.

Extended Type: RigidMatrix

rotation : Quaternion

The rotation, applied first.

translation : Vec

The translation, applied second.

Returns: RigidMatrix

A new RigidMatrix.

RigidMatrix.decompose m

Full Usage: RigidMatrix.decompose m

Parameters:
Returns: Quaternion * Vec A tuple of the rotation quaternion and the translation vector. RigidMatrix.createFromTranslationAndQuaternion recomposes the matrix.

Decomposes a RigidMatrix into its rotation and translation. The rotation is applied first and the translation second.

Extended Type: RigidMatrix

m : RigidMatrix

The matrix to decompose.

Returns: Quaternion * Vec

A tuple of the rotation quaternion and the translation vector. RigidMatrix.createFromTranslationAndQuaternion recomposes the matrix.

RigidMatrix.interpolate start finish factor

Full Usage: RigidMatrix.interpolate start finish factor

Parameters:
    start : RigidMatrix - The matrix at factor 0.
    finish : RigidMatrix - The matrix at factor 1.
    factor : float - The finite interpolation factor.

Returns: RigidMatrix A new interpolated RigidMatrix.

Interpolates from start to finish for animations. The translation is interpolated linearly, so the origin moves on a straight line. The rotation is interpolated with Quaternion.slerp along the shortest rotation, at a constant angular speed. Unlike an interpolation of the 12 matrix elements, the result is always a valid RigidMatrix. Factor 0 returns start and factor 1 returns finish. The factor is not clamped: negative factors and factors above one extrapolate. Fails if the factor is not finite.

Extended Type: RigidMatrix

start : RigidMatrix

The matrix at factor 0.

finish : RigidMatrix

The matrix at factor 1.

factor : float

The finite interpolation factor.

Returns: RigidMatrix

A new interpolated RigidMatrix.

Type something to start searching.