mat3.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. .. default-domain:: C
  2. mat3
  3. ====
  4. Header: cglm/mat3.h
  5. Table of contents (click to go):
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. Macros:
  8. 1. GLM_MAT3_IDENTITY_INIT
  9. #. GLM_MAT3_ZERO_INIT
  10. #. GLM_MAT3_IDENTITY
  11. #. GLM_MAT3_ZERO
  12. #. glm_mat3_dup(mat, dest)
  13. Functions:
  14. 1. :c:func:`glm_mat3_copy`
  15. #. :c:func:`glm_mat3_identity`
  16. #. :c:func:`glm_mat3_identity_array`
  17. #. :c:func:`glm_mat3_mul`
  18. #. :c:func:`glm_mat3_transpose_to`
  19. #. :c:func:`glm_mat3_transpose`
  20. #. :c:func:`glm_mat3_mulv`
  21. #. :c:func:`glm_mat3_quat`
  22. #. :c:func:`glm_mat3_scale`
  23. #. :c:func:`glm_mat3_det`
  24. #. :c:func:`glm_mat3_inv`
  25. #. :c:func:`glm_mat3_swap_col`
  26. #. :c:func:`glm_mat3_swap_row`
  27. Functions documentation
  28. ~~~~~~~~~~~~~~~~~~~~~~~
  29. .. c:function:: void glm_mat3_copy(mat3 mat, mat3 dest)
  30. copy mat3 to another one (dest).
  31. Parameters:
  32. | *[in]* **mat** source
  33. | *[out]* **dest** destination
  34. .. c:function:: void glm_mat3_identity(mat3 mat)
  35. copy identity mat3 to mat, or makes mat to identiy
  36. Parameters:
  37. | *[out]* **mat** matrix
  38. .. c:function:: void glm_mat3_identity_array(mat3 * __restrict mat, size_t count)
  39. make given matrix array's each element identity matrix
  40. Parameters:
  41. | *[in,out]* **mat** matrix array (must be aligned (16/32) if alignment is not disabled)
  42. | *[in]* **count** count of matrices
  43. .. c:function:: void glm_mat3_mul(mat3 m1, mat3 m2, mat3 dest)
  44. multiply m1 and m2 to dest
  45. m1, m2 and dest matrices can be same matrix, it is possible to write this:
  46. .. code-block:: c
  47. mat3 m = GLM_MAT3_IDENTITY_INIT;
  48. glm_mat3_mul(m, m, m);
  49. Parameters:
  50. | *[in]* **m1** left matrix
  51. | *[in]* **m2** right matrix
  52. | *[out]* **dest** destination matrix
  53. .. c:function:: void glm_mat3_transpose_to(mat3 m, mat3 dest)
  54. transpose mat4 and store in dest
  55. source matrix will not be transposed unless dest is m
  56. Parameters:
  57. | *[in]* **mat** source
  58. | *[out]* **dest** destination
  59. .. c:function:: void glm_mat3_transpose(mat3 m)
  60. tranpose mat3 and store result in same matrix
  61. Parameters:
  62. | *[in]* **mat** source
  63. | *[out]* **dest** destination
  64. .. c:function:: void glm_mat3_mulv(mat3 m, vec3 v, vec3 dest)
  65. multiply mat4 with vec4 (column vector) and store in dest vector
  66. Parameters:
  67. | *[in]* **mat** mat3 (left)
  68. | *[in]* **v** vec3 (right, column vector)
  69. | *[out]* **dest** destination (result, column vector)
  70. .. c:function:: void glm_mat3_quat(mat3 m, versor dest)
  71. convert mat3 to quaternion
  72. Parameters:
  73. | *[in]* **m** rotation matrix
  74. | *[out]* **dest** destination quaternion
  75. .. c:function:: void glm_mat3_scale(mat3 m, float s)
  76. multiply matrix with scalar
  77. Parameters:
  78. | *[in, out]* **mat** matrix
  79. | *[in]* **dest** scalar
  80. .. c:function:: float glm_mat3_det(mat3 mat)
  81. returns mat3 determinant
  82. Parameters:
  83. | *[in]* **mat** matrix
  84. Returns:
  85. mat3 determinant
  86. .. c:function:: void glm_mat3_inv(mat3 mat, mat3 dest)
  87. inverse mat3 and store in dest
  88. Parameters:
  89. | *[in]* **mat** matrix
  90. | *[out]* **dest** destination (inverse matrix)
  91. .. c:function:: void glm_mat3_swap_col(mat3 mat, int col1, int col2)
  92. swap two matrix columns
  93. Parameters:
  94. | *[in, out]* **mat** matrix
  95. | *[in]* **col1** col1
  96. | *[in]* **col2** col2
  97. .. c:function:: void glm_mat3_swap_row(mat3 mat, int row1, int row2)
  98. swap two matrix rows
  99. Parameters:
  100. | *[in, out]* **mat** matrix
  101. | *[in]* **row1** row1
  102. | *[in]* **row2** row2