FastUIDraw
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
i
j
l
m
n
o
p
r
s
t
u
v
w
+
Functions
a
b
c
d
f
g
i
l
m
n
o
p
r
s
t
u
+
Typedefs
c
d
f
i
p
r
u
v
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
f
i
l
m
n
r
s
t
u
v
+
Typedefs
b
c
d
f
i
j
n
p
r
s
t
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
m
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
z
Related Functions
+
Files
File List
+
File Members
+
All
f
o
+
Functions
f
o
Variables
+
Macros
f
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
doxy
glsl
src
fastuidraw
glsl
shaders
fastuidraw_unpack_unit_vector.glsl.hpp
Go to the documentation of this file.
1
/*!
2
* \file fastuidraw_unpack_unit_vector.glsl.hpp
3
* \brief file fastuidraw_unpack_unit_vector.glsl.hpp
4
*
5
* Copyright 2018 by Intel.
6
*
7
* Contact: kevin.rogovin@gmail.com
8
*
9
* This Source Code Form is subject to the
10
* terms of the Mozilla Public License, v. 2.0.
11
* If a copy of the MPL was not distributed with
12
* this file, You can obtain one at
13
* http://mozilla.org/MPL/2.0/.
14
*
15
* \author Kevin Rogovin <kevin.rogovin@gmail.com>
16
*
17
*/
18
19
/*!\addtogroup GLSLVertFragCode
20
* @{
21
*/
22
23
/*!
24
* \brief unpack a unit vector
25
* \param x x-coordinate value of unit vector
26
* \param b if b is non-zero, indicates that y-coordinate is negative
27
*/
28
vec2
29
fastuidraw_unpack_unit_vector
(
float
x, uint b)
30
{
31
vec2
return_value;
32
return_value.
x
= x;
33
return_value.y = sqrt(max(0.0, 1.0 - x * x));
34
if
(b != 0u)
35
{
36
return_value.y = -return_value.y;
37
}
38
return
return_value;
39
}
40
/*! @} */
fastuidraw::vec2
vecN< float, 2 > vec2
Definition:
vecN.hpp:1231
fastuidraw_unpack_unit_vector
vec2 fastuidraw_unpack_unit_vector(float x, uint b)
unpack a unit vector
Definition:
fastuidraw_unpack_unit_vector.glsl.hpp:29
fastuidraw::vecN::x
reference x(void)
Definition:
vecN.hpp:435
Generated by
1.8.13