reference-libobs-graphics-math.rst 707 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. Extra Math Functions/Macros
  2. ===========================
  3. .. code:: cpp
  4. #include <graphics/math-extra.h>
  5. Helper functions/macros for graphics math.
  6. .. macro:: RAD(val)
  7. Macro that converts a floating point degrees value to radians.
  8. .. macro:: DEG(val)
  9. Macro that converts a floating point radians value to degrees.
  10. **LARGE_EPSILON** 1e-2f
  11. Large epsilon value.
  12. **EPSILON** 1e-4f
  13. Epsilon value.
  14. **TINY_EPSILON** 1e-5f
  15. Tiny Epsilon value.
  16. **M_INFINITE** 3.4e38f
  17. Infinite value
  18. ---------------------
  19. .. function:: float rand_float(int positive_only)
  20. Generates a random floating point value (from -1.0f..1.0f, or
  21. 0.0f..1.0f if *positive_only* is set).