mat3.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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_trace`
  26. #. :c:func:`glm_mat3_swap_col`
  27. #. :c:func:`glm_mat3_swap_row`
  28. Functions documentation
  29. ~~~~~~~~~~~~~~~~~~~~~~~
  30. .. c:function:: void glm_mat3_copy(mat3 mat, mat3 dest)
  31. copy mat3 to another one (dest).
  32. Parameters:
  33. | *[in]* **mat** source
  34. | *[out]* **dest** destination
  35. .. c:function:: void glm_mat3_identity(mat3 mat)
  36. copy identity mat3 to mat, or makes mat to identiy
  37. Parameters:
  38. | *[out]* **mat** matrix
  39. .. c:function:: void glm_mat3_identity_array(mat3 * __restrict mat, size_t count)
  40. make given matrix array's each element identity matrix
  41. Parameters:
  42. | *[in,out]* **mat** matrix array (must be aligned (16/32) if alignment is not disabled)
  43. | *[in]* **count** count of matrices
  44. .. c:function:: void glm_mat3_mul(mat3 m1, mat3 m2, mat3 dest)
  45. multiply m1 and m2 to dest
  46. m1, m2 and dest matrices can be same matrix, it is possible to write this:
  47. .. code-block:: c
  48. mat3 m = GLM_MAT3_IDENTITY_INIT;
  49. glm_mat3_mul(m, m, m);
  50. Parameters:
  51. | *[in]* **m1** left matrix
  52. | *[in]* **m2** right matrix
  53. | *[out]* **dest** destination matrix
  54. .. c:function:: void glm_mat3_transpose_to(mat3 m, mat3 dest)
  55. transpose mat4 and store in dest
  56. source matrix will not be transposed unless dest is m
  57. Parameters:
  58. | *[in]* **mat** source
  59. | *[out]* **dest** destination
  60. .. c:function:: void glm_mat3_transpose(mat3 m)
  61. tranpose mat3 and store result in same matrix
  62. Parameters:
  63. | *[in]* **mat** source
  64. | *[out]* **dest** destination
  65. .. c:function:: void glm_mat3_mulv(mat3 m, vec3 v, vec3 dest)
  66. multiply mat4 with vec4 (column vector) and store in dest vector
  67. Parameters:
  68. | *[in]* **mat** mat3 (left)
  69. | *[in]* **v** vec3 (right, column vector)
  70. | *[out]* **dest** destination (result, column vector)
  71. .. c:function:: void glm_mat3_quat(mat3 m, versor dest)
  72. convert mat3 to quaternion
  73. Parameters:
  74. | *[in]* **m** rotation matrix
  75. | *[out]* **dest** destination quaternion
  76. .. c:function:: void glm_mat3_scale(mat3 m, float s)
  77. multiply matrix with scalar
  78. Parameters:
  79. | *[in, out]* **mat** matrix
  80. | *[in]* **dest** scalar
  81. .. c:function:: float glm_mat3_det(mat3 mat)
  82. returns mat3 determinant
  83. Parameters:
  84. | *[in]* **mat** matrix
  85. Returns:
  86. mat3 determinant
  87. .. c:function:: void glm_mat3_inv(mat3 mat, mat3 dest)
  88. inverse mat3 and store in dest
  89. Parameters:
  90. | *[in]* **mat** matrix
  91. | *[out]* **dest** destination (inverse matrix)
  92. .. c:function:: void glm_mat3_trace(mat3 m)
  93. | sum of the elements on the main diagonal from upper left to the lower right
  94. Parameters:
  95. | *[in]* **m** matrix
  96. Returns:
  97. trace of matrix
  98. .. c:function:: void glm_mat3_swap_col(mat3 mat, int col1, int col2)
  99. swap two matrix columns
  100. Parameters:
  101. | *[in, out]* **mat** matrix
  102. | *[in]* **col1** col1
  103. | *[in]* **col2** col2
  104. .. c:function:: void glm_mat3_swap_row(mat3 mat, int row1, int row2)
  105. swap two matrix rows
  106. Parameters:
  107. | *[in, out]* **mat** matrix
  108. | *[in]* **row1** row1
  109. | *[in]* **row2** row2