translated method

Matrix4 translated(
  1. Vector3 translation
)
inherited

Returns this multiplied by a translation matrix of translation. Note the order.

Implementation

Matrix4 translated(Vector3 translation) {
  final tx = translation.x, ty = translation.y, tz = translation.z;

  return .new(
    // dart format off
    this[0], this[1], this[2],  this[3],
    this[4], this[5], this[6],  this[7],
    this[8], this[9], this[10], this[11],
    (this[0] * tx) + (this[4] * ty) + (this[8] * tz) + this[12],
    (this[1] * tx) + (this[5] * ty) + (this[9] * tz) + this[13],
    (this[2] * tx) + (this[6] * ty) + (this[10] * tz) + this[14],
    (this[3] * tx) + (this[7] * ty) + (this[11] * tz) + this[15],
    // dart format on
  );
}