vec2-ext.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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_fract`
  25. #. :c:func:`glm_vec2_floor`
  26. #. :c:func:`glm_vec2_sqrt`
  27. Functions documentation
  28. ~~~~~~~~~~~~~~~~~~~~~~~
  29. .. c:function:: void glm_vec2_fill(vec2 v, float val)
  30. fill a vector with specified value
  31. Parameters:
  32. | *[in,out]* **dest** destination
  33. | *[in]* **val** value
  34. .. c:function:: bool glm_vec2_eq(vec2 v, float val)
  35. check if vector is equal to value (without epsilon)
  36. Parameters:
  37. | *[in]* **v** vector
  38. | *[in]* **val** value
  39. .. c:function:: bool glm_vec2_eq_eps(vec2 v, float val)
  40. check if vector is equal to value (with epsilon)
  41. Parameters:
  42. | *[in]* **v** vector
  43. | *[in]* **val** value
  44. .. c:function:: bool glm_vec2_eq_all(vec2 v)
  45. check if vectors members are equal (without epsilon)
  46. Parameters:
  47. | *[in]* **v** vector
  48. .. c:function:: bool glm_vec2_eqv(vec2 v1, vec2 v2)
  49. check if vector is equal to another (without epsilon) vector
  50. Parameters:
  51. | *[in]* **vec** vector 1
  52. | *[in]* **vec** vector 2
  53. .. c:function:: bool glm_vec2_eqv_eps(vec2 v1, vec2 v2)
  54. check if vector is equal to another (with epsilon)
  55. Parameters:
  56. | *[in]* **v1** vector1
  57. | *[in]* **v2** vector2
  58. .. c:function:: float glm_vec2_max(vec2 v)
  59. max value of vector
  60. Parameters:
  61. | *[in]* **v** vector
  62. .. c:function:: float glm_vec2_min(vec2 v)
  63. min value of vector
  64. Parameters:
  65. | *[in]* **v** vector
  66. .. c:function:: bool glm_vec2_isnan(vec2 v)
  67. | check if one of items is NaN (not a number)
  68. | you should only use this in DEBUG mode or very critical asserts
  69. Parameters:
  70. | *[in]* **v** vector
  71. .. c:function:: bool glm_vec2_isinf(vec2 v)
  72. | check if one of items is INFINITY
  73. | you should only use this in DEBUG mode or very critical asserts
  74. Parameters:
  75. | *[in]* **v** vector
  76. .. c:function:: bool glm_vec2_isvalid(vec2 v)
  77. | check if all items are valid number
  78. | you should only use this in DEBUG mode or very critical asserts
  79. Parameters:
  80. | *[in]* **v** vector
  81. .. c:function:: void glm_vec2_sign(vec2 v, vec2 dest)
  82. get sign of 32 bit float as +1, -1, 0
  83. Parameters:
  84. | *[in]* **v** vector
  85. | *[out]* **dest** sign vector (only keeps signs as -1, 0, -1)
  86. .. c:function:: void glm_vec2_abs(vec2 v, vec2 dest)
  87. absolute value of each vector item
  88. Parameters:
  89. | *[in]* **v** vector
  90. | *[out]* **dest** destination vector
  91. .. c:function:: void glm_vec2_fract(vec2 v, vec2 dest)
  92. get fractional part of each vector item
  93. Parameters:
  94. | *[in]* **v** vector
  95. | *[out]* **dest** destination vector
  96. .. c:function:: void glm_vec2_floor(vec2 v, vec2 dest)
  97. floor value of each vector item
  98. Parameters:
  99. | *[in]* **v** vector
  100. | *[out]* **dest** destination vector
  101. .. c:function:: void glm_vec2_sqrt(vec2 v, vec2 dest)
  102. square root of each vector item
  103. Parameters:
  104. | *[in]* **v** vector
  105. | *[out]* **dest** destination vector (sqrt(v))