NAO documentation
|
C++ Libraries
|
index
libalmath
1.14
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Groups
Pages
almath
types
alquaternion.h
1
/*
2
* Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
3
* Use of this source code is governed by a BSD-style license that can be
4
* found in the COPYING file.
5
*/
6
7
8
#pragma once
9
#ifndef _LIBALMATH_ALMATH_TYPES_ALQUATERNION_H_
10
#define _LIBALMATH_ALMATH_TYPES_ALQUATERNION_H_
11
12
#include <vector>
13
14
namespace
AL {
15
namespace
Math {
16
23
struct
Quaternion
{
25
float
w
;
27
float
x
;
29
float
y
;
31
float
z
;
32
35
50
51
Quaternion
();
52
55
70
71
72
73
74
75
Quaternion
(
76
float
pW,
77
float
pX,
78
float
pY,
79
float
pZ);
80
83
98
99
100
101
102
103
Quaternion
(
const
std::vector<float>& pFloats);
104
109
Quaternion
&
operator*=
(
const
Quaternion
& pQu2);
110
115
Quaternion
operator*
(
const
Quaternion
& pQua2)
const
;
116
121
bool
operator==
(
const
Quaternion
& pQua2)
const
;
122
127
bool
operator!=
(
const
Quaternion
& pQua2)
const
;
128
133
Quaternion
&
operator*=
(
float
pVal);
134
139
Quaternion
&
operator/=
(
float
pVal);
140
152
bool
isNear
(
153
const
Quaternion
& pQua2,
154
const
float
& pEpsilon=0.0001f)
const
;
155
164
float
norm
()
const
;
165
174
Quaternion
normalize
()
const
;
175
183
Quaternion
inverse
()
const
;
184
193
static
Quaternion
fromAngleAndAxisRotation
(
194
const
float
pAngle,
195
const
float
pAxisX,
196
const
float
pAxisY,
197
const
float
pAxisZ);
198
202
std::vector<float>
toVector
()
const
;
203
};
204
215
float
norm
(
const
Quaternion
& pQua);
216
227
Quaternion
normalize
(
const
Quaternion
& pQua);
228
229
237
void
quaternionInverse
(
238
const
Quaternion
& pQua,
239
Quaternion
& pQuaOut);
240
250
Quaternion
quaternionInverse
(
const
Quaternion
& pQua);
251
252
265
Quaternion
quaternionFromAngleAndAxisRotation
(
266
const
float
pAngle,
267
const
float
pAxisX,
268
const
float
pAxisY,
269
const
float
pAxisZ);
270
271
282
void
angleAndAxisRotationFromQuaternion
(
283
const
Quaternion
& pQuaternion,
284
float
& pAngle,
285
float
& pAxisX,
286
float
& pAxisY,
287
float
& pAxisZ);
288
289
}
// end namespace math
290
}
// end namespace al
291
#endif // _LIBALMATH_ALMATH_TYPES_ALQUATERNION_H_
Copyright Aldebaran Robotics