mat4.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright (c), Recep Aslantas.
  3. *
  4. * MIT License (MIT), http://opensource.org/licenses/MIT
  5. * Full license can be found in the LICENSE file
  6. */
  7. #ifndef cglmc_mat_h
  8. #define cglmc_mat_h
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #include "../cglm.h"
  13. /* DEPRECATED! use _copy, _ucopy versions */
  14. #define glmc_mat4_udup(mat, dest) glmc_mat4_ucopy(mat, dest)
  15. #define glmc_mat4_dup(mat, dest) glmc_mat4_copy(mat, dest)
  16. CGLM_EXPORT
  17. void
  18. glmc_mat4_ucopy(mat4 mat, mat4 dest);
  19. CGLM_EXPORT
  20. void
  21. glmc_mat4_copy(mat4 mat, mat4 dest);
  22. CGLM_EXPORT
  23. void
  24. glmc_mat4_identity(mat4 mat);
  25. CGLM_EXPORT
  26. void
  27. glmc_mat4_identity_array(mat4 * __restrict mat, size_t count);
  28. CGLM_EXPORT
  29. void
  30. glmc_mat4_zero(mat4 mat);
  31. CGLM_EXPORT
  32. void
  33. glmc_mat4_pick3(mat4 mat, mat3 dest);
  34. CGLM_EXPORT
  35. void
  36. glmc_mat4_pick3t(mat4 mat, mat3 dest);
  37. CGLM_EXPORT
  38. void
  39. glmc_mat4_ins3(mat3 mat, mat4 dest);
  40. CGLM_EXPORT
  41. void
  42. glmc_mat4_mul(mat4 m1, mat4 m2, mat4 dest);
  43. CGLM_EXPORT
  44. void
  45. glmc_mat4_mulN(mat4 * __restrict matrices[], uint32_t len, mat4 dest);
  46. CGLM_EXPORT
  47. void
  48. glmc_mat4_mulv(mat4 m, vec4 v, vec4 dest);
  49. CGLM_EXPORT
  50. void
  51. glmc_mat4_mulv3(mat4 m, vec3 v, float last, vec3 dest);
  52. CGLM_EXPORT
  53. float
  54. glmc_mat4_trace(mat4 m);
  55. CGLM_EXPORT
  56. float
  57. glmc_mat4_trace3(mat4 m);
  58. CGLM_EXPORT
  59. void
  60. glmc_mat4_quat(mat4 m, versor dest);
  61. CGLM_EXPORT
  62. void
  63. glmc_mat4_transpose_to(mat4 m, mat4 dest);
  64. CGLM_EXPORT
  65. void
  66. glmc_mat4_transpose(mat4 m);
  67. CGLM_EXPORT
  68. void
  69. glmc_mat4_scale_p(mat4 m, float s);
  70. CGLM_EXPORT
  71. void
  72. glmc_mat4_scale(mat4 m, float s);
  73. CGLM_EXPORT
  74. float
  75. glmc_mat4_det(mat4 mat);
  76. CGLM_EXPORT
  77. void
  78. glmc_mat4_inv(mat4 mat, mat4 dest);
  79. CGLM_EXPORT
  80. void
  81. glmc_mat4_inv_precise(mat4 mat, mat4 dest);
  82. CGLM_EXPORT
  83. void
  84. glmc_mat4_inv_fast(mat4 mat, mat4 dest);
  85. CGLM_EXPORT
  86. void
  87. glmc_mat4_swap_col(mat4 mat, int col1, int col2);
  88. CGLM_EXPORT
  89. void
  90. glmc_mat4_swap_row(mat4 mat, int row1, int row2);
  91. CGLM_EXPORT
  92. float
  93. glmc_mat4_rmc(vec4 r, mat4 m, vec4 c);
  94. CGLM_EXPORT
  95. void
  96. glmc_mat4_make(const float * __restrict src, mat4 dest);
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100. #endif /* cglmc_mat_h */