vec2-ext.rst 3.1 KB

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