mat3.rst 3.3 KB

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