Main Page
Namespaces
Classes
Files
File List
File Members
include
Mathematics
GteEulerAngles.h
Go to the documentation of this file.
1
// David Eberly, Geometric Tools, Redmond WA 98052
2
// Copyright (c) 1998-2017
3
// Distributed under the Boost Software License, Version 1.0.
4
// http://www.boost.org/LICENSE_1_0.txt
5
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6
// File Version: 3.0.0 (2016/06/19)
7
8
#pragma once
9
10
#include <
Mathematics/GteVector.h
>
11
12
namespace
gte
13
{
14
15
// Factorization into Euler angles is not necessarily unique. Let the
16
// integer indices for the axes be (N0,N1,N2), which must be in the set
17
// {(0,1,2),(0,2,1),(1,0,2),(1,2,0),(2,0,1),(2,1,0),
18
// (0,1,0),(0,2,0),(1,0,1),(1,2,1),(2,0,2),(2,1,2)}
19
// Let the corresponding angles be (angleN0,angleN1,angleN2). If the
20
// result is ER_NOT_UNIQUE_SUM, then the multiple solutions occur because
21
// angleN2+angleN0 is constant. If the result is ER_NOT_UNIQUE_DIF, then
22
// the multiple solutions occur because angleN2-angleN0 is constant. In
23
// either type of nonuniqueness, the function returns angleN0=0.
24
enum
EulerResult
25
{
26
// The solution is invalid (incorrect axis indices).
27
ER_INVALID
,
28
29
// The solution is unique.
30
ER_UNIQUE
,
31
32
// The solution is not unique. A sum of angles is constant.
33
ER_NOT_UNIQUE_SUM
,
34
35
// The solution is not unique. A difference of angles is constant.
36
ER_NOT_UNIQUE_DIF
37
};
38
39
template
<
typename
Real>
40
class
EulerAngles
41
{
42
public
:
43
EulerAngles
();
44
EulerAngles
(
int
i0,
int
i1,
int
i2, Real a0, Real a1, Real a2);
45
46
int
axis
[3];
47
Real
angle
[3];
48
49
// This member is set during conversions from rotation matrices,
50
// quaternions, or axis-angles.
51
EulerResult
result
;
52
};
53
54
55
template
<
typename
Real>
56
EulerAngles<Real>::EulerAngles
()
57
:
58
result
(
ER_INVALID
)
59
{
60
for
(
int
i = 0; i < 3; ++i)
61
{
62
axis
[i] = 0;
63
angle
[i] = (Real)0;
64
}
65
}
66
67
template
<
typename
Real>
68
EulerAngles<Real>::EulerAngles
(
int
i0,
int
i1,
int
i2, Real a0, Real a1,
69
Real a2)
70
:
71
result
(
ER_UNIQUE
)
72
{
73
axis
[0] = i0;
74
axis
[1] = i1;
75
axis
[2] = i2;
76
angle
[0] = a0;
77
angle
[1] = a1;
78
angle
[2] = a2;
79
}
80
81
82
}
gte::EulerAngles::EulerAngles
EulerAngles()
Definition:
GteEulerAngles.h:56
gte::EulerResult
EulerResult
Definition:
GteEulerAngles.h:24
angle
GLfloat angle
Definition:
glext.h:6466
gte::ER_UNIQUE
Definition:
GteEulerAngles.h:30
GteVector.h
gte::EulerAngles::result
EulerResult result
Definition:
GteEulerAngles.h:51
gte
Definition:
GLX/GteWICFileIO.h:16
gte::EulerAngles
Definition:
GteEulerAngles.h:40
gte::ER_NOT_UNIQUE_SUM
Definition:
GteEulerAngles.h:33
gte::ER_INVALID
Definition:
GteEulerAngles.h:27
gte::ER_NOT_UNIQUE_DIF
Definition:
GteEulerAngles.h:36
gte::EulerAngles::axis
int axis[3]
Definition:
GteEulerAngles.h:46
result
GLuint64EXT * result
Definition:
glext.h:10003
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59