xsi_rotation.h
Go to the documentation of this file.

    00001 //*****************************************************************************
    00011 //*****************************************************************************
    00012 #ifndef __XSIROTATION_H__
    00013 #define __XSIROTATION_H__
    00014
    00015 #include "sicppsdk.h"
    00016
    00017 namespace XSI {
    00018
    00019 namespace MATH {
    00020
    00021 class CVector3;
    00022 class CVector4;
    00023 class CMatrix3;
    00024 class CQuaternion;
    00025
    00026 //*****************************************************************************
    00062 //*****************************************************************************
    00063 class SICPPSDKDECL CRotation
    00064 {
    00065 public:
    00068     enum RotationOrder
    00069     {
    00070         siXYZ = 0,
    00071         siXZY = 1,
    00072         siYXZ = 2,
    00073         siYZX = 3,
    00074         siZXY = 4,
    00075         siZYX = 5
    00076     };
    00077
    00079     CRotation();
    00080
    00084     CRotation( const CRotation& in_rotation);
    00085
    00091     CRotation( const CVector3 &in_EulerAngles, RotationOrder in_RotOrder = siXYZ);
    00092
    00100     CRotation( double in_dX, double in_dY, double in_dZ, RotationOrder in_RotOrder = siXYZ);
    00101
    00102
    00107     CRotation( const CQuaternion &in_Quat );
    00108
    00114     CRotation( const CVector3 &in_Axis,  double in_dAngle );
    00115
    00120     CRotation( const CMatrix3 &in_Matrix );
    00121
    00123     ~CRotation();
    00124
    00129     CRotation & operator=( const CRotation & in_rotation);
    00130
    00135     CRotation& Copy( const CRotation &in_SrcRot);
    00136
    00141     CVector3 GetXYZAngles() const;
    00142
    00149     void GetXYZAngles( double &io_dX, double &io_dY, double &io_dZ ) const;
    00150
    00154     RotationOrder GetRotationOrder() const;
    00155
    00160     void PutRotationOrder( RotationOrder in_RotationOrder );
    00161
    00168     CRotation& SetFromXYZAngles( const CVector3 &in_EulerAngles, RotationOrder in_Order = siXYZ);
    00169
    00178     CRotation& SetFromXYZAngles( double in_dX, double in_dY, double in_dZ, RotationOrder in_Order = siXYZ);
    00179
    00187     CRotation& SetFromXYZAxes( const CVector3 &in_XAxis,  const CVector3 &in_YAxis, const CVector3 &in_ZAxis);
    00188
    00193     CRotation& operator *= ( const CRotation &in_Rotation );
    00194
    00199     CRotation& MulInPlace( const CRotation &in_Rotation );
    00200
    00206     CRotation& Mul( const CRotation &in_Rotation1, const CRotation &in_Rotation2 );
    00207
    00211     CRotation& InvertInPlace();
    00212
    00217     CRotation& Invert( const CRotation &in_Rot );
    00218
    00223     CQuaternion GetQuaternion() const;
    00224
    00230     CRotation& SetFromQuaternion( const CQuaternion &in_Quat);
    00231
    00237     CRotation& operator = ( const CQuaternion &in_Quat );
    00238
    00244     CVector3 GetAxisAngle( double &io_dAngle) const;
    00245
    00252     CRotation& SetFromAxisAngle( const CVector3 &in_Axis,  double in_dAngle );
    00253
    00258     CMatrix3 GetMatrix() const;
    00259
    00265     CRotation& SetFromMatrix( const CMatrix3 &in_Matrix);
    00266
    00272     CRotation& operator= (const CMatrix3 &in_Matrix);
    00273
    00276     void SetIdentity();
    00277
    00287     bool EpsilonEquals( const CRotation &in_Rot, double in_dEpsilon ) const;
    00288
    00294     bool Equals( const CRotation &in_Rot ) const;
    00295
    00301     bool operator == ( const CRotation &in_Rot ) const;
    00302
    00308     bool operator !=(const CRotation & in_Rot ) const;
    00309 private:
    00310     void *m_ptr;
    00311 };
    00312
    00313 };
    00314 };
    00315
    00316 #endif // __XSIROTATION_H__