multiplyByTranslation

fun multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4(source)

Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) by an implicit translation matrix defined by a Cartesian3. This is an optimization for Matrix4.multiply(m, Matrix4.fromTranslation(position), m); with less allocations and arithmetic operations.

// Instead of Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
Matrix4.multiplyByTranslation(m, position, m);

Return

The modified result parameter.

Parameters

matrix

The matrix on the left-hand side.

translation

The translation on the right-hand side.

result

The object onto which to store the result.

See also