vec2-ext.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. .. default-domain:: C
  2. vec2 extra
  3. ==========
  4. Header: cglm/vec2-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 vec2.h in the future some of
  7. these functions ma be moved to vec2 header.
  8. Table of contents (click to go):
  9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. Functions:
  11. 1. :c:func:`glm_vec2_fill`
  12. #. :c:func:`glm_vec2_eq`
  13. #. :c:func:`glm_vec2_eq_eps`
  14. #. :c:func:`glm_vec2_eq_all`
  15. #. :c:func:`glm_vec2_eqv`
  16. #. :c:func:`glm_vec2_eqv_eps`
  17. #. :c:func:`glm_vec2_max`
  18. #. :c:func:`glm_vec2_min`
  19. #. :c:func:`glm_vec2_isnan`
  20. #. :c:func:`glm_vec2_isinf`
  21. #. :c:func:`glm_vec2_isvalid`
  22. #. :c:func:`glm_vec2_sign`
  23. #. :c:func:`glm_vec2_abs`
  24. #. :c:func:`glm_vec2_sqrt`
  25. Functions documentation
  26. ~~~~~~~~~~~~~~~~~~~~~~~
  27. .. c:function:: void glm_vec2_fill(vec2 v, float val)
  28. fill a vector with specified value
  29. Parameters:
  30. | *[in,out]* **dest** destination
  31. | *[in]* **val** value
  32. .. c:function:: bool glm_vec2_eq(vec2 v, float val)
  33. check if vector is equal to value (without epsilon)
  34. Parameters:
  35. | *[in]* **v** vector
  36. | *[in]* **val** value
  37. .. c:function:: bool glm_vec2_eq_eps(vec2 v, float val)
  38. check if vector is equal to value (with epsilon)
  39. Parameters:
  40. | *[in]* **v** vector
  41. | *[in]* **val** value
  42. .. c:function:: bool glm_vec2_eq_all(vec2 v)
  43. check if vectors members are equal (without epsilon)
  44. Parameters:
  45. | *[in]* **v** vector
  46. .. c:function:: bool glm_vec2_eqv(vec2 v1, vec2 v2)
  47. check if vector is equal to another (without epsilon) vector
  48. Parameters:
  49. | *[in]* **vec** vector 1
  50. | *[in]* **vec** vector 2
  51. .. c:function:: bool glm_vec2_eqv_eps(vec2 v1, vec2 v2)
  52. check if vector is equal to another (with epsilon)
  53. Parameters:
  54. | *[in]* **v1** vector1
  55. | *[in]* **v2** vector2
  56. .. c:function:: float glm_vec2_max(vec2 v)
  57. max value of vector
  58. Parameters:
  59. | *[in]* **v** vector
  60. .. c:function:: float glm_vec2_min(vec2 v)
  61. min value of vector
  62. Parameters:
  63. | *[in]* **v** vector
  64. .. c:function:: bool glm_vec2_isnan(vec2 v)
  65. | check if one of items is NaN (not a number)
  66. | you should only use this in DEBUG mode or very critical asserts
  67. Parameters:
  68. | *[in]* **v** vector
  69. .. c:function:: bool glm_vec2_isinf(vec2 v)
  70. | check if one of items is INFINITY
  71. | you should only use this in DEBUG mode or very critical asserts
  72. Parameters:
  73. | *[in]* **v** vector
  74. .. c:function:: bool glm_vec2_isvalid(vec2 v)
  75. | check if all items are valid number
  76. | you should only use this in DEBUG mode or very critical asserts
  77. Parameters:
  78. | *[in]* **v** vector
  79. .. c:function:: void glm_vec2_sign(vec2 v, vec2 dest)
  80. get sign of 32 bit float as +1, -1, 0
  81. Parameters:
  82. | *[in]* **v** vector
  83. | *[out]* **dest** sign vector (only keeps signs as -1, 0, -1)
  84. .. c:function:: void glm_vec2_abs(vec2 v, vec2 dest)
  85. absolute value of each vector item
  86. Parameters:
  87. | *[in]* **v** vector
  88. | *[out]* **dest** destination vector
  89. .. c:function:: void glm_vec2_sqrt(vec2 v, vec2 dest)
  90. square root of each vector item
  91. Parameters:
  92. | *[in]* **v** vector
  93. | *[out]* **dest** destination vector (sqrt(v))