SIBCQuaternion.h

Go to the documentation of this file.
00001 //***************************************************************************************
00002 // File supervisor: Crosswalk team
00012 //***************************************************************************************
00013 
00014 //***************************************************************************************
00015 // Includes
00016 //***************************************************************************************
00017 #include <float.h>
00018 #include <SIBCUtil.h>
00019 #include <SIBCMatrix.h>
00020 #include <SIBCVector.h>
00021 
00022 
00023 //***************************************************************************************
00024 // Defines
00025 //***************************************************************************************
00026 #ifndef __CSIBCQUATERNION_H__
00027 #define __CSIBCQUATERNION_H__
00028 
00029 //***************************************************************************************
00030 // CSIBCQuaternion | Implementation of a Quaternion class.
00031 //***************************************************************************************
00032 
00045 class XSICOREEXPORT CSIBCQuaternion
00046 {
00047     public:
00048 
00053         CSIBCQuaternion() :
00054             m_fW(1.0), m_fX(0.0), m_fY(0.0), m_fZ(0.0) {}
00055 
00062         CSIBCQuaternion(const CSIBCQuaternion &in_quat) { *this = in_quat; }
00063 
00064         ~CSIBCQuaternion() {}
00065 
00072         inline SI_Error Init();
00073 
00080         SI_Error Init(CSIBCQuaternion &in_quat);
00081 
00091         SI_Error Init(SI_Float in_dX,
00092                       SI_Float in_dY,
00093                       SI_Float in_dZ,
00094                       SI_Float in_dW);
00095 
00104         SI_Error Init(SI_Float in_dX, SI_Float in_dY, SI_Float in_dZ);
00105 
00113         SI_Float GetX() const { return m_fX; }
00114 
00122         SI_Float GetY() const { return m_fY; }
00123 
00131         SI_Float GetZ() const { return m_fZ; }
00132 
00140         SI_Float GetW() const { return m_fW; }
00141 
00151         inline SI_Error SetX(SI_Float in_dX);
00152 
00162         inline SI_Error SetY(SI_Float in_dY);
00163 
00173         inline SI_Error SetZ(SI_Float in_dZ);
00174 
00184         inline SI_Error SetW(SI_Float in_dW);
00185 
00194         SI_Error GetMatrix(CSIBCMatrix4x4 &out_mat);
00195 
00202         inline SI_Error GetXYZRotation(CSIBCVector3D &out_vect);
00203 
00213         SI_Error GetXYZRotation(SI_Float in_dX,
00214                                 SI_Float in_dY,
00215                                 SI_Float in_dZ,
00216                                 CSIBCVector3D &out_vect);
00217 
00227         SI_Error GetAxisAngle(CSIBCVector3D &out_vAxis,
00228                               float &out_fAngle);
00229 
00241         inline SI_Error Set(SI_Float in_dX,
00242                             SI_Float in_dY,
00243                             SI_Float in_dZ,
00244                             SI_Float in_dW);
00245 
00250         inline void operator=(const CSIBCQuaternion &in_quat);
00251 
00256         inline SI_Error SelfTest();
00257 
00258     protected:
00259 
00260     private:
00261 
00262         // Attributes
00263         SI_Float m_fX, m_fY, m_fZ, m_fW;
00264 };
00265 
00266 
00267 #endif
00268 
00269 
00270