vec3-ext.rst 3.4 KB

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