OSVR-Core
UsefulQuaternions.h
Go to the documentation of this file.
1 
11 // Copyright 2016 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_UsefulQuaternions_h_GUID_BC5D8169_7ACB_46AA_A5E0_77C77FE44498
26 #define INCLUDED_UsefulQuaternions_h_GUID_BC5D8169_7ACB_46AA_A5E0_77C77FE44498
27 
28 // Internal Includes
29 // - none
30 
31 // Library/third-party includes
33 
34 // Standard includes
35 // - none
36 
37 namespace osvr {
38 namespace vbtracker {
39  inline Eigen::Quaterniond get180aboutX() {
40  // all zero except x = 1 produces 180 about x
41  return Eigen::Quaterniond(0, 1, 0, 0);
42  }
43  inline Eigen::Quaterniond get180aboutY() {
44  // all zero except y = 1 produces 180 about y
45  return Eigen::Quaterniond(0, 0, 1, 0);
46  }
47  inline Eigen::Quaterniond get180aboutZ() {
48  // all zero except z = 1 produces 180 about z
49  return Eigen::Quaterniond(0, 0, 0, 1);
50  }
51 } // namespace vbtracker
52 } // namespace osvr
53 
54 #endif // INCLUDED_UsefulQuaternions_h_GUID_BC5D8169_7ACB_46AA_A5E0_77C77FE44498
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Header wrapping include of <Eigen/Core> and <Eigen/Geometry> for warning quieting.
Definition: Quaternion.h:47
Quaternion< double > Quaterniond
double precision quaternion type
Definition: Quaternion.h:211