File: reference-libobs-graphics-math.rst

package info (click to toggle)
obs-studio 29.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 35,920 kB
  • sloc: ansic: 182,921; cpp: 98,959; sh: 1,591; python: 945; makefile: 858; javascript: 19
file content (39 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Extra Math Functions/Macros
===========================

.. code:: cpp

   #include <graphics/math-extra.h>

Helper functions/macros for graphics math.

.. :c:macro:: RAD(val)

   Macro that converts a floating point degrees value to radians.

.. :c:macro:: DEG(val)

   Macro that converts a floating point radians value to degrees.

**LARGE_EPSILON**   1e-2f

   Large epsilon value.

**EPSILON**         1e-4f

   Epsilon value.

**TINY_EPSILON**    1e-5f

   Tiny Epsilon value.

**M_INFINITE**      3.4e38f

   Infinite value

---------------------

.. function:: float rand_float(int positive_only)

   Generates a random floating point value (from -1.0f..1.0f, or
   0.0f..1.0f if *positive_only* is set).