00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXQUATD_H
00025 #define FXQUATD_H
00026
00027
00028 namespace FX {
00029
00030
00031 class FXMat3d;
00032
00033
00035 class FXAPI FXQuatd : public FXVec4d {
00036 public:
00037
00039 FXQuatd(){}
00040
00042 FXQuatd(const FXQuatd& q):FXVec4d(q){}
00043
00045 FXQuatd(FXdouble xx,FXdouble yy,FXdouble zz,FXdouble ww):FXVec4d(xx,yy,zz,ww){}
00046
00048 FXQuatd(const FXdouble v[]):FXVec4d(v){}
00049
00051 FXQuatd(const FXVec3d& axis,FXdouble phi=0.0);
00052
00054 FXQuatd(FXdouble roll,FXdouble pitch,FXdouble yaw);
00055
00057 FXQuatd(const FXVec3d& fr,const FXVec3d& to);
00058
00060 FXQuatd(const FXVec3d& ex,const FXVec3d& ey,const FXVec3d& ez);
00061
00063 FXQuatd(const FXMat3d& mat);
00064
00066 FXQuatd& adjust();
00067
00069 void setAxisAngle(const FXVec3d& axis,FXdouble phi=0.0);
00070
00072 void getAxisAngle(FXVec3d& axis,FXdouble& phi) const;
00073
00075 void setRollPitchYaw(FXdouble roll,FXdouble pitch,FXdouble yaw);
00076 void getRollPitchYaw(FXdouble& roll,FXdouble& pitch,FXdouble& yaw) const;
00077
00079 void setYawPitchRoll(FXdouble yaw,FXdouble pitch,FXdouble roll);
00080 void getYawPitchRoll(FXdouble& yaw,FXdouble& pitch,FXdouble& roll) const;
00081
00083 void setRollYawPitch(FXdouble roll,FXdouble yaw,FXdouble pitch);
00084 void getRollYawPitch(FXdouble& roll,FXdouble& yaw,FXdouble& pitch) const;
00085
00087 void setPitchRollYaw(FXdouble pitch,FXdouble roll,FXdouble yaw);
00088 void getPitchRollYaw(FXdouble& pitch,FXdouble& roll,FXdouble& yaw) const;
00089
00091 void setPitchYawRoll(FXdouble pitch,FXdouble yaw,FXdouble roll);
00092 void getPitchYawRoll(FXdouble& pitch,FXdouble& yaw,FXdouble& roll) const;
00093
00095 void setYawRollPitch(FXdouble yaw,FXdouble roll,FXdouble pitch);
00096 void getYawRollPitch(FXdouble& yaw,FXdouble& roll,FXdouble& pitch) const;
00097
00099 void setAxes(const FXVec3d& ex,const FXVec3d& ey,const FXVec3d& ez);
00100
00102 void getAxes(FXVec3d& ex,FXVec3d& ey,FXVec3d& ez) const;
00103
00105 FXVec3d getXAxis() const;
00106
00108 FXVec3d getYAxis() const;
00109
00111 FXVec3d getZAxis() const;
00112
00114 FXQuatd exp() const;
00115
00117 FXQuatd log() const;
00118
00120 FXQuatd invert() const;
00121
00123 FXQuatd unitinvert() const;
00124
00126 FXQuatd conj() const;
00127
00129 FXQuatd& arc(const FXVec3d& a,const FXVec3d& b);
00130
00132 FXQuatd& lerp(const FXQuatd& u,const FXQuatd& v,FXdouble f);
00133
00135 FXQuatd operator*(const FXQuatd& q) const;
00136
00138 FXVec3d operator*(const FXVec3d& v) const;
00139 };
00140
00141
00142 }
00143
00144 #endif