modeling/src/maths/mat4/identity.js

  1. /**
  2. * Set a matrix to the identity transform.
  3. *
  4. * @param {mat4} out - receiving matrix
  5. * @returns {mat4} out
  6. * @alias module:modeling/maths/mat4.identity
  7. */
  8. const identity = (out) => {
  9. out[0] = 1
  10. out[1] = 0
  11. out[2] = 0
  12. out[3] = 0
  13. out[4] = 0
  14. out[5] = 1
  15. out[6] = 0
  16. out[7] = 0
  17. out[8] = 0
  18. out[9] = 0
  19. out[10] = 1
  20. out[11] = 0
  21. out[12] = 0
  22. out[13] = 0
  23. out[14] = 0
  24. out[15] = 1
  25. return out
  26. }
  27. module.exports = identity