mat3.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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_mul`
  17. #. :c:func:`glm_mat3_transpose_to`
  18. #. :c:func:`glm_mat3_transpose`
  19. #. :c:func:`glm_mat3_mulv`
  20. #. :c:func:`glm_mat3_scale`
  21. #. :c:func:`glm_mat3_det`
  22. #. :c:func:`glm_mat3_inv`
  23. #. :c:func:`glm_mat3_swap_col`
  24. #. :c:func:`glm_mat3_swap_row`
  25. Functions documentation
  26. ~~~~~~~~~~~~~~~~~~~~~~~
  27. .. c:function:: void glm_mat3_copy(mat3 mat, mat3 dest)
  28. copy mat3 to another one (dest).
  29. Parameters:
  30. | *[in]* **mat** source
  31. | *[out]* **dest** destination
  32. .. c:function:: void glm_mat3_identity(mat3 mat)
  33. copy identity mat3 to mat, or makes mat to identiy
  34. Parameters:
  35. | *[out]* **mat** matrix
  36. .. c:function:: void glm_mat3_mul(mat3 m1, mat3 m2, mat3 dest)
  37. multiply m1 and m2 to dest
  38. m1, m2 and dest matrices can be same matrix, it is possible to write this:
  39. .. code-block:: c
  40. mat3 m = GLM_MAT3_IDENTITY_INIT;
  41. glm_mat3_mul(m, m, m);
  42. Parameters:
  43. | *[in]* **m1** left matrix
  44. | *[in]* **m2** right matrix
  45. | *[out]* **dest** destination matrix
  46. .. c:function:: void glm_mat3_transpose_to(mat3 m, mat3 dest)
  47. transpose mat4 and store in dest
  48. source matrix will not be transposed unless dest is m
  49. Parameters:
  50. | *[in]* **mat** source
  51. | *[out]* **dest** destination
  52. .. c:function:: void glm_mat3_transpose(mat3 m)
  53. tranpose mat3 and store result in same matrix
  54. Parameters:
  55. | *[in]* **mat** source
  56. | *[out]* **dest** destination
  57. .. c:function:: void glm_mat3_mulv(mat3 m, vec3 v, vec3 dest)
  58. multiply mat4 with vec4 (column vector) and store in dest vector
  59. Parameters:
  60. | *[in]* **mat** mat3 (left)
  61. | *[in]* **v** vec3 (right, column vector)
  62. | *[out]* **dest** destination (result, column vector)
  63. .. c:function:: void glm_mat3_scale(mat3 m, float s)
  64. multiply matrix with scalar
  65. Parameters:
  66. | *[in, out]* **mat** matrix
  67. | *[in]* **dest** scalar
  68. .. c:function:: float glm_mat3_det(mat3 mat)
  69. returns mat3 determinant
  70. Parameters:
  71. | *[in]* **mat** matrix
  72. Returns:
  73. mat3 determinant
  74. .. c:function:: void glm_mat3_inv(mat3 mat, mat3 dest)
  75. inverse mat3 and store in dest
  76. Parameters:
  77. | *[in]* **mat** matrix
  78. | *[out]* **dest** destination (inverse matrix)
  79. .. c:function:: void glm_mat3_swap_col(mat3 mat, int col1, int col2)
  80. swap two matrix columns
  81. Parameters:
  82. | *[in, out]* **mat** matrix
  83. | *[in]* **col1** col1
  84. | *[in]* **col2** col2
  85. .. c:function:: void glm_mat3_swap_row(mat3 mat, int row1, int row2)
  86. swap two matrix rows
  87. Parameters:
  88. | *[in, out]* **mat** matrix
  89. | *[in]* **row1** row1
  90. | *[in]* **row2** row2