00001 #ifndef COIN_SBROTATION_H
00002 #define COIN_SBROTATION_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <stdio.h>
00028 #include <Inventor/SbVec4f.h>
00029
00030 class SbMatrix;
00031 class SbVec3f;
00032
00033 class COIN_DLL_API SbRotation {
00034 public:
00035 SbRotation(void);
00036 SbRotation(const SbVec3f & axis, const float radians);
00037 SbRotation(const float q[4]);
00038 SbRotation(const float q0, const float q1, const float q2, const float q3);
00039 SbRotation(const SbMatrix & m);
00040 SbRotation(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
00041 const float * getValue(void) const;
00042 void getValue(float & q0, float & q1, float & q2, float & q3) const;
00043 SbRotation & setValue(const float q0, const float q1,
00044 const float q2, const float q3);
00045 void getValue(SbVec3f & axis, float & radians) const;
00046 void getValue(SbMatrix & matrix) const;
00047 SbRotation & invert(void);
00048 SbRotation inverse(void) const;
00049 SbRotation & setValue(const float q[4]);
00050 SbRotation & setValue(const SbMatrix & m);
00051 SbRotation & setValue(const SbVec3f & axis, const float radians);
00052 SbRotation & setValue(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
00053 SbRotation & operator*=(const SbRotation & q);
00054 SbRotation & operator*=(const float s);
00055 friend COIN_DLL_API int operator==(const SbRotation & q1, const SbRotation & q2);
00056 friend COIN_DLL_API int operator!=(const SbRotation & q1, const SbRotation & q2);
00057 SbBool equals(const SbRotation & r, const float tolerance) const;
00058 friend COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
00059 void multVec(const SbVec3f & src, SbVec3f & dst) const;
00060
00061 void scaleAngle(const float scaleFactor);
00062 static SbRotation slerp(const SbRotation & rot0, const SbRotation & rot1,
00063 float t);
00064 static SbRotation identity(void);
00065
00066 void print(FILE * fp) const;
00067
00068 private:
00069 SbVec4f quat;
00070 };
00071
00072 COIN_DLL_API int operator ==(const SbRotation & q1, const SbRotation & q2);
00073 COIN_DLL_API int operator !=(const SbRotation & q1, const SbRotation & q2);
00074 COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
00075
00076 #endif // !COIN_SBROTATION_H