getTranslation function

List<double> getTranslation(
  1. List<double> out,
  2. List<double> mat
)

Returns the translation vector component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned vector will be the same as the translation vector originally supplied. @param {vec3} out Vector to receive translation component @param {ReadonlyMat4} mat Matrix to be decomposed (input) @return {vec3} out

Implementation

List<double> getTranslation(List<double> out, List<double> mat) {
  out[0] = mat[12];
  out[1] = mat[13];
  out[2] = mat[14];

  return out;
}