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 FXQUATF_H
00025 #define FXQUATF_H
00026
00027
00028 namespace FX {
00029
00030
00031 class FXMat3f;
00032
00033
00035 class FXAPI FXQuatf : public FXVec4f {
00036 public:
00037
00039 FXQuatf(){}
00040
00042 FXQuatf(const FXQuatf& q):FXVec4f(q){}
00043
00045 FXQuatf(FXfloat xx,FXfloat yy,FXfloat zz,FXfloat ww):FXVec4f(xx,yy,zz,ww){}
00046
00048 FXQuatf(const FXfloat v[]):FXVec4f(v){}
00049
00051 FXQuatf(const FXVec3f& axis,FXfloat phi=0.0f);
00052
00054 FXQuatf(FXfloat roll,FXfloat pitch,FXfloat yaw);
00055
00057 FXQuatf(const FXVec3f& fr,const FXVec3f& to);
00058
00060 FXQuatf(const FXVec3f& ex,const FXVec3f& ey,const FXVec3f& ez);
00061
00063 FXQuatf(const FXMat3f& mat);
00064
00066 FXQuatf& adjust();
00067
00069 void setAxisAngle(const FXVec3f& axis,FXfloat phi=0.0f);
00070
00072 void getAxisAngle(FXVec3f& axis,FXfloat& phi) const;
00073
00075 void setRollPitchYaw(FXfloat roll,FXfloat pitch,FXfloat yaw);
00076 void getRollPitchYaw(FXfloat& roll,FXfloat& pitch,FXfloat& yaw) const;
00077
00079 void setYawPitchRoll(FXfloat yaw,FXfloat pitch,FXfloat roll);
00080 void getYawPitchRoll(FXfloat& yaw,FXfloat& pitch,FXfloat& roll) const;
00081
00083 void setRollYawPitch(FXfloat roll,FXfloat yaw,FXfloat pitch);
00084 void getRollYawPitch(FXfloat& roll,FXfloat& yaw,FXfloat& pitch) const;
00085
00087 void setPitchRollYaw(FXfloat pitch,FXfloat roll,FXfloat yaw);
00088 void getPitchRollYaw(FXfloat& pitch,FXfloat& roll,FXfloat& yaw) const;
00089
00091 void setPitchYawRoll(FXfloat pitch,FXfloat yaw,FXfloat roll);
00092 void getPitchYawRoll(FXfloat& pitch,FXfloat& yaw,FXfloat& roll) const;
00093
00095 void setYawRollPitch(FXfloat yaw,FXfloat roll,FXfloat pitch);
00096 void getYawRollPitch(FXfloat& yaw,FXfloat& roll,FXfloat& pitch) const;
00097
00099 void setAxes(const FXVec3f& ex,const FXVec3f& ey,const FXVec3f& ez);
00100
00102 void getAxes(FXVec3f& ex,FXVec3f& ey,FXVec3f& ez) const;
00103
00105 FXVec3f getXAxis() const;
00106
00108 FXVec3f getYAxis() const;
00109
00111 FXVec3f getZAxis() const;
00112
00114 FXQuatf exp() const;
00115
00117 FXQuatf log() const;
00118
00120 FXQuatf invert() const;
00121
00123 FXQuatf unitinvert() const;
00124
00126 FXQuatf conj() const;
00127
00129 FXQuatf& arc(const FXVec3f& a,const FXVec3f& b);
00130
00132 FXQuatf& lerp(const FXQuatf& u,const FXQuatf& v,FXfloat f);
00133
00135 FXQuatf operator*(const FXQuatf& q) const;
00136
00138 FXVec3f operator*(const FXVec3f& v) const;
00139 };
00140
00141
00142 }
00143
00144 #endif