FXQuatd.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *              D o u b l e - P r e c i s i o n  Q u a t e r n i o n             *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1994,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXQuatd.h,v 1.15 2006/01/22 17:58:07 fox Exp $                           *
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

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:24 2009 for TnFOX by doxygen v1.4.7