- Cal3D 0.11 API Reference -

dualquaternion.h

00001 //****************************************************************************//
00002 // dualquaternion.h                                                           //
00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger                       //
00004 //****************************************************************************//
00005 // This library is free software; you can redistribute it and/or modify it    //
00006 // under the terms of the GNU Lesser General Public License as published by   //
00007 // the Free Software Foundation; either version 2.1 of the License, or (at    //
00008 // your option) any later version.                                            //
00009 //****************************************************************************//
00010 
00011 #ifndef CAL_DUAL_QUATERNION_H
00012 #define CAL_DUAL_QUATERNION_H
00013 
00014 //****************************************************************************//
00015 // Includes                                                                   //
00016 //****************************************************************************//
00017 
00018 #include "cal3d/global.h"
00019 #include "cal3d/vector.h"
00020 #include "cal3d/quaternion.h"
00021 
00022 //****************************************************************************//
00023 // Class declaration                                                          //
00024 //****************************************************************************//
00025 
00026 class CAL3D_API CalDualQuaternion
00027 {
00028 public:
00029   // member variables
00030   CalQuaternion nondual;
00031   CalQuaternion dual;
00032 
00033   // constructors/destructor
00034   CalDualQuaternion() {}  // default constructor
00035   CalDualQuaternion( const CalDualQuaternion& inOther ) // copy constructor
00036     : nondual( inOther.nondual ), dual( inOther.dual ) {}
00037   CalDualQuaternion( const CalQuaternion& inRotation,
00038                      const CalVector& inTranslation );
00039   ~CalDualQuaternion() {}
00040 
00041   // assignment
00042   inline CalDualQuaternion& operator=( const CalDualQuaternion& inOther )
00043   {
00044     nondual = inOther.nondual;
00045     dual = inOther.dual;
00046     return *this;
00047   }
00048 
00049   inline void operator*=( float s )
00050   {
00051     nondual *= s;
00052     dual *= s;
00053   }
00054 
00055   inline void operator+=( const CalDualQuaternion& inOther )
00056   {
00057     nondual += inOther.nondual;
00058     dual += inOther.dual;
00059   }
00060 
00061   void normalize();
00062 
00063   void transformPoint( const CalVector& inPt, CalVector& outPt ) const;
00064 };
00065 
00066 
00067 #endif  // CAL_DUAL_QUATERNION_H
00068 
00069 //****************************************************************************//

Generated by The Cal3D Team with Doxygen 1.7.3