2
0

vec3-ext.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. .. default-domain:: C
  2. vec3 extra
  3. ==========
  4. Header: cglm/vec3-ext.h
  5. There are some functions are in called in extra header. These are called extra
  6. because they are not used like other functions in vec3.h in the future some of
  7. these functions ma be moved to vec3 header.
  8. Table of contents (click to go):
  9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. Functions:
  11. 1. :c:func:`glm_vec3_mulv`
  12. #. :c:func:`glm_vec3_broadcast`
  13. #. :c:func:`glm_vec3_eq`
  14. #. :c:func:`glm_vec3_eq_eps`
  15. #. :c:func:`glm_vec3_eq_all`
  16. #. :c:func:`glm_vec3_eqv`
  17. #. :c:func:`glm_vec3_eqv_eps`
  18. #. :c:func:`glm_vec3_max`
  19. #. :c:func:`glm_vec3_min`
  20. #. :c:func:`glm_vec3_isnan`
  21. #. :c:func:`glm_vec3_isinf`
  22. #. :c:func:`glm_vec3_isvalid`
  23. #. :c:func:`glm_vec3_sign`
  24. #. :c:func:`glm_vec3_abs`
  25. #. :c:func:`glm_vec3_fract`
  26. #. :c:func:`glm_vec3_floor`
  27. #. :c:func:`glm_vec3_sqrt`
  28. Functions documentation
  29. ~~~~~~~~~~~~~~~~~~~~~~~
  30. .. c:function:: void glm_vec3_mulv(vec3 a, vec3 b, vec3 d)
  31. multiplies individual items
  32. Parameters:
  33. | *[in]* **a** vec1
  34. | *[in]* **b** vec2
  35. | *[out]* **d** destination (v1[0] * v2[0], v1[1] * v2[1], v1[2] * v2[2])
  36. .. c:function:: void glm_vec3_broadcast(float val, vec3 d)
  37. fill a vector with specified value
  38. Parameters:
  39. | *[in]* **val** value
  40. | *[out]* **dest** destination
  41. .. c:function:: void glm_vec3_fill(vec3 v, float val)
  42. fill a vector with specified value
  43. Parameters:
  44. | *[out]* **v** vector
  45. | *[in]* **val** value
  46. .. c:function:: bool glm_vec3_eq(vec3 v, float val)
  47. check if vector is equal to value (without epsilon)
  48. Parameters:
  49. | *[in]* **v** vector
  50. | *[in]* **val** value
  51. .. c:function:: bool glm_vec3_eq_eps(vec3 v, float val)
  52. check if vector is equal to value (with epsilon)
  53. Parameters:
  54. | *[in]* **v** vector
  55. | *[in]* **val** value
  56. .. c:function:: bool glm_vec3_eq_all(vec3 v)
  57. check if vectors members are equal (without epsilon)
  58. Parameters:
  59. | *[in]* **v** vector
  60. .. c:function:: bool glm_vec3_eqv(vec3 v1, vec3 v2)
  61. check if vector is equal to another (without epsilon) vector
  62. Parameters:
  63. | *[in]* **vec** vector 1
  64. | *[in]* **vec** vector 2
  65. .. c:function:: bool glm_vec3_eqv_eps(vec3 v1, vec3 v2)
  66. check if vector is equal to another (with epsilon)
  67. Parameters:
  68. | *[in]* **v1** vector1
  69. | *[in]* **v2** vector2
  70. .. c:function:: float glm_vec3_max(vec3 v)
  71. max value of vector
  72. Parameters:
  73. | *[in]* **v** vector
  74. .. c:function:: float glm_vec3_min(vec3 v)
  75. min value of vector
  76. Parameters:
  77. | *[in]* **v** vector
  78. .. c:function:: bool glm_vec3_isnan(vec3 v)
  79. | check if one of items is NaN (not a number)
  80. | you should only use this in DEBUG mode or very critical asserts
  81. Parameters:
  82. | *[in]* **v** vector
  83. .. c:function:: bool glm_vec3_isinf(vec3 v)
  84. | check if one of items is INFINITY
  85. | you should only use this in DEBUG mode or very critical asserts
  86. Parameters:
  87. | *[in]* **v** vector
  88. .. c:function:: bool glm_vec3_isvalid(vec3 v)
  89. | check if all items are valid number
  90. | you should only use this in DEBUG mode or very critical asserts
  91. Parameters:
  92. | *[in]* **v** vector
  93. .. c:function:: void glm_vec3_sign(vec3 v, vec3 dest)
  94. get sign of 32 bit float as +1, -1, 0
  95. Parameters:
  96. | *[in]* **v** vector
  97. | *[out]* **dest** sign vector (only keeps signs as -1, 0, -1)
  98. .. c:function:: void glm_vec3_abs(vec3 v, vec3 dest)
  99. absolute value of each vector item
  100. Parameters:
  101. | *[in]* **v** vector
  102. | *[out]* **dest** destination vector
  103. .. c:function:: void glm_vec3_fract(vec3 v, vec3 dest)
  104. fractional part of each vector item
  105. Parameters:
  106. | *[in]* **v** vector
  107. | *[out]* **dest** destination vector
  108. .. c:function:: void glm_vec3_floor(vec3 v, vec3 dest)
  109. floor of each vector item
  110. Parameters:
  111. | *[in]* **v** vector
  112. | *[out]* **dest** destination vector
  113. .. c:function:: void glm_vec3_sqrt(vec3 v, vec3 dest)
  114. square root of each vector item
  115. Parameters:
  116. | *[in]* **v** vector
  117. | *[out]* **dest** destination vector (sqrt(v))