![]() |
VR-Link API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 00007 #ifndef vlQuaternion_H_ 00008 #define vlQuaternion_H_ 00009 00010 #include <vlutil/vlMachineTypes.h> 00011 #include <vlutil/vlString.h> 00012 #include "vlDcm.h" 00013 #include <iosfwd> 00014 00019 00020 #ifdef DtUSE_UTILITIES_NAMESPACE 00021 namespace DtUSE_UTILITIES_NAMESPACE 00022 { 00023 #endif 00024 00025 class DtTaitBryan; 00026 00030 class DT_DLL_MATRIX DtQuaternion 00031 { 00032 public: 00033 00035 DtQuaternion(); 00036 00038 DtQuaternion(double w, double x, double y, double z); 00039 00041 DtQuaternion(const DtQuaternion &other); 00042 00044 DtQuaternion(const DtTaitBryan &tb); 00045 00047 DtQuaternion &operator=(const DtQuaternion&other); 00048 00049 00051 DtString string() const; 00052 00053 void printDataToStream(std::ostream &str) const; 00054 00055 double w() const; 00056 void setW(double w); 00057 00058 double x() const; 00059 void setX(double x); 00060 00061 double y() const; 00062 void setY(double y); 00063 00064 double z() const; 00065 void setZ(double z); 00066 00067 public: 00068 00071 double DtQ0; 00072 double DtQ1; 00073 double DtQ2; 00074 double DtQ3; 00075 }; 00076 00077 DT_DLL_MATRIX std::ostream & operator << (std::ostream &str, const DtQuaternion &sr); 00078 00079 DT_DLL_MATRIX void DtQuatQuatMul( 00080 DtQuaternion *qresult, const DtQuaternion *DtQ1, const DtQuaternion *DtQ2); 00081 00083 DT_DLL_MATRIX void DtQuaternionDump(const DtQuaternion *q); 00084 00085 inline double DtQuaternion::w() const 00086 { 00087 return DtQ0; 00088 } 00089 00090 inline void DtQuaternion::setW(double w) 00091 { 00092 DtQ0 = w; 00093 } 00094 00095 inline double DtQuaternion::x() const 00096 { 00097 return DtQ1; 00098 } 00099 00100 inline void DtQuaternion::setX(double x) 00101 { 00102 DtQ1 = x; 00103 } 00104 00105 inline double DtQuaternion::y() const 00106 { 00107 return DtQ2; 00108 } 00109 00110 inline void DtQuaternion::setY(double y) 00111 { 00112 DtQ2 = y; 00113 } 00114 00115 inline double DtQuaternion::z() const 00116 { 00117 return DtQ3; 00118 } 00119 00120 inline void DtQuaternion::setZ(double z) 00121 { 00122 DtQ3 = z; 00123 } 00124 00125 #ifdef DtUSE_UTILITIES_NAMESPACE 00126 } 00127 #endif 00128 #endif 00129 00130 00131 00132 00133 00134 00135