vec3-ext.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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_sqrt`
  26. Functions documentation
  27. ~~~~~~~~~~~~~~~~~~~~~~~
  28. .. c:function:: void glm_vec3_mulv(vec3 a, vec3 b, vec3 d)
  29. multiplies individual items
  30. Parameters:
  31. | *[in]* **a** vec1
  32. | *[in]* **b** vec2
  33. | *[out]* **d** destination (v1[0] * v2[0], v1[1] * v2[1], v1[2] * v2[2])
  34. .. c:function:: void glm_vec3_broadcast(float val, vec3 d)
  35. fill a vector with specified value
  36. Parameters:
  37. | *[in]* **val** value
  38. | *[out]* **dest** destination
  39. .. c:function:: bool glm_vec3_eq(vec3 v, float val)
  40. check if vector is equal to value (without epsilon)
  41. Parameters:
  42. | *[in]* **v** vector
  43. | *[in]* **val** value
  44. .. c:function:: bool glm_vec3_eq_eps(vec3 v, float val)
  45. check if vector is equal to value (with epsilon)
  46. Parameters:
  47. | *[in]* **v** vector
  48. | *[in]* **val** value
  49. .. c:function:: bool glm_vec3_eq_all(vec3 v)
  50. check if vectors members are equal (without epsilon)
  51. Parameters:
  52. | *[in]* **v** vector
  53. .. c:function:: bool glm_vec3_eqv(vec3 v1, vec3 v2)
  54. check if vector is equal to another (without epsilon) vector
  55. Parameters:
  56. | *[in]* **vec** vector 1
  57. | *[in]* **vec** vector 2
  58. .. c:function:: bool glm_vec3_eqv_eps(vec3 v1, vec3 v2)
  59. check if vector is equal to another (with epsilon)
  60. Parameters:
  61. | *[in]* **v1** vector1
  62. | *[in]* **v2** vector2
  63. .. c:function:: float glm_vec3_max(vec3 v)
  64. max value of vector
  65. Parameters:
  66. | *[in]* **v** vector
  67. .. c:function:: float glm_vec3_min(vec3 v)
  68. min value of vector
  69. Parameters:
  70. | *[in]* **v** vector
  71. .. c:function:: bool glm_vec3_isnan(vec3 v)
  72. | check if one of items is NaN (not a number)
  73. | you should only use this in DEBUG mode or very critical asserts
  74. Parameters:
  75. | *[in]* **v** vector
  76. .. c:function:: bool glm_vec3_isinf(vec3 v)
  77. | check if one of items is INFINITY
  78. | you should only use this in DEBUG mode or very critical asserts
  79. Parameters:
  80. | *[in]* **v** vector
  81. .. c:function:: bool glm_vec3_isvalid(vec3 v)
  82. | check if all items are valid number
  83. | you should only use this in DEBUG mode or very critical asserts
  84. Parameters:
  85. | *[in]* **v** vector
  86. .. c:function:: void glm_vec3_sign(vec3 v, vec3 dest)
  87. get sign of 32 bit float as +1, -1, 0
  88. Parameters:
  89. | *[in]* **v** vector
  90. | *[out]* **dest** sign vector (only keeps signs as -1, 0, -1)
  91. .. c:function:: void glm_vec3_abs(vec3 v, vec3 dest)
  92. absolute value of each vector item
  93. Parameters:
  94. | *[in]* **v** vector
  95. | *[out]* **dest** destination vector
  96. .. c:function:: void glm_vec3_sqrt(vec3 v, vec3 dest)
  97. square root of each vector item
  98. Parameters:
  99. | *[in]* **v** vector
  100. | *[out]* **dest** destination vector (sqrt(v))