HikoGUI
Select Version:
main (latest dev)
0.8.1 (latest)
0.8.0
0.7.0
0.6.0
0.5.1
0.5.0
0.4.0
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0
theme-value
theme-tag
text
ranged-int
phrase-mask-chars
new-window-widget
msvs-bug-20230517
msvs-bug-20230503
msvs-bug-20230428
msvc-c1001-20231106
msvc-bug-20230706
msvc-bug-20221214
modules-part1
label-delegate
bug-msvs-20220928
attribute-parser
⚠️ This documents the
main
development branch of HikoGUI. It might differ from release versions.
A low latency retained GUI
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Variables
c
d
g
i
l
o
p
r
s
t
x
Typedefs
Enumerations
a
b
c
d
f
g
h
k
l
p
s
t
u
v
w
Concepts
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
k
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Related Symbols
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
Files
File List
Globals
All
Functions
Macros
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
src
hikogui
geometry
rotate2.hpp
1
// Copyright Take Vos 2021-2022.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "../macros.hpp"
8
#include <hikocpu/hikocpu.hpp>
9
#include <cmath>
10
#include <exception>
11
#include <compare>
12
13
hi_export_module(hikogui.geometry : rotate2);
14
15
hi_export
namespace
hi
{
inline
namespace
v1
{
16
17
class
rotate2
{
18
public
:
19
using
array_type =
simd<float, 4>
;
20
using
value_type = array_type::value_type;
21
22
constexpr
rotate2
(
rotate2
const
&)
noexcept
=
default
;
23
constexpr
rotate2
(
rotate2
&&)
noexcept
=
default
;
24
constexpr
rotate2
& operator=(
rotate2
const
&)
noexcept
=
default
;
25
constexpr
rotate2
& operator=(
rotate2
&&)
noexcept
=
default
;
26
constexpr
rotate2
() noexcept : _v(0.0f, 0.0f, 1.0f, 0.0f) {}
27
28
[[nodiscard]]
rotate2
(
float
angle) noexcept : _v()
29
{
30
auto
const
half_angle = angle * 0.5f;
31
auto
const
C =
std::cos
(half_angle);
32
auto
const
S =
std::sin
(half_angle);
33
34
_v =
f32x4
{0.0f, 0.0f, S, C};
35
}
36
37
[[nodiscard]]
constexpr
explicit
operator
array_type()
const
noexcept
38
{
39
return
_v;
40
}
41
42
//std::pair<float, vector3> angle_and_axis() const noexcept
43
//{
44
// auto const rcp_length = rcp_hypot<0b0111>(_v);
45
// auto const length = 1.0f / rcp_length;
46
//
47
// return {2.0f * std::atan2(length), vector3{_v.xyz0() * rcp_length}};
48
//}
49
50
private
:
54
array_type _v;
55
};
17
class
rotate2
{
…
};
56
57
}}
// namespace hi::v1
hi
The HikoGUI namespace.
Definition
array_generic.hpp:20
v1
DOXYGEN BUG.
Definition
algorithm_misc.hpp:20
hi::simd
Definition
simd_intf.hpp:18
hi::rotate2
Definition
rotate2.hpp:17
std::cos
T cos(T... args)
std::sin
T sin(T... args)
Generated on Mon Apr 22 2024 12:51:35 for HikoGUI by
1.10.0