00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_DUAL_QUATERNION_H
00012 #define CAL_DUAL_QUATERNION_H
00013
00014
00015
00016
00017
00018 #include "cal3d/global.h"
00019 #include "cal3d/vector.h"
00020 #include "cal3d/quaternion.h"
00021
00022
00023
00024
00025
00026 class CAL3D_API CalDualQuaternion
00027 {
00028 public:
00029
00030 CalQuaternion nondual;
00031 CalQuaternion dual;
00032
00033
00034 CalDualQuaternion() {}
00035 CalDualQuaternion( const CalDualQuaternion& inOther )
00036 : nondual( inOther.nondual ), dual( inOther.dual ) {}
00037 CalDualQuaternion( const CalQuaternion& inRotation,
00038 const CalVector& inTranslation );
00039 ~CalDualQuaternion() {}
00040
00041
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