Quatern.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef QUATERN_HH
00028 #define QUATERN_HH
00029
00030 #include <iostream>
00031 #include "Vector3.hh"
00032
00033 namespace gazebo
00034 {
00035
00039
00041 class Quatern
00042 {
00044 public: Quatern();
00045
00051 public: Quatern( const double &u, const double &x, const double &y, const double &z);
00052
00055 public: Quatern( const Quatern &qt );
00056
00058 public: ~Quatern();
00059
00062 public: const Quatern &operator=(const Quatern &qt);
00063
00065 public: void Invert();
00066
00069 public: Quatern GetInverse() const;
00070
00072 public: void SetToIdentity();
00073
00075 public: void Normalize();
00076
00082 public: void SetFromAxis(double x, double y, double z, double a);
00083
00086 public: void SetFromEuler(const Vector3 &vec);
00087
00090 public: Vector3 GetAsEuler();
00091
00093 public: double GetRoll();
00094
00096 public: double GetPitch();
00097
00099 public: double GetYaw();
00100
00103 public: Quatern GetAsAxis();
00104
00107 public: void Scale(double scale);
00108
00112 public: Quatern operator*( const Quatern &qt ) const;
00113
00116 public: bool IsFinite() const;
00117
00119 public: double u;
00120
00122 public: double x;
00123
00125 public: double y;
00126
00128 public: double z;
00129
00134 public: friend std::ostream &operator<<( std::ostream &out, const gazebo::Quatern &q )
00135 {
00136 out << q.u << " " << q.x << " " << q.y << " " << q.z;
00137
00138 return out;
00139 }
00140
00141 };
00142
00144 }
00145
00146 #endif