modeling/src/maths/vec3/copy.js

  1. /**
  2. * Create a copy of the given vector.
  3. *
  4. * @param {vec3} out - receiving vector
  5. * @param {vec3} vector - vector to copy
  6. * @returns {vec3} out
  7. * @alias module:modeling/maths/vec3.copy
  8. */
  9. const copy = (out, vector) => {
  10. out[0] = vector[0]
  11. out[1] = vector[1]
  12. out[2] = vector[2]
  13. return out
  14. }
  15. module.exports = copy