00001 /**************************************************************************** 00002 00003 This file is part of the GLC-lib library. 00004 Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net) 00005 http://glc-lib.sourceforge.net 00006 00007 GLC-lib is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 GLC-lib is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with GLC-lib; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 00021 *****************************************************************************/ 00022 00024 00025 #ifndef GLC_INTERPOLATOR_H_ 00026 #define GLC_INTERPOLATOR_H_ 00027 00028 #include "glc_vector3d.h" 00029 #include "glc_matrix4x4.h" 00030 00031 #include "../glc_config.h" 00032 00033 // Types d'interpolation 00034 enum INTERPOL_TYPE 00035 { 00036 INTERPOL_LINEAIRE, 00037 INTERPOL_ANGULAIRE, 00038 INTERPOL_HOMOTETIE 00039 }; 00040 00043 00046 00047 class GLC_LIB_EXPORT GLC_Interpolator 00048 { 00049 00051 // Construction 00053 public: 00054 // Contructeur par défaut Interpolation Linéaire 00055 GLC_Interpolator(); 00056 00058 // Fonctions Set 00060 public: 00061 // Défini la matrice d'interpolation 00062 void SetInterpolMat(int NbrPas, const GLC_Vector3d &VectDepart, const GLC_Vector3d &VectArrive 00063 , INTERPOL_TYPE Interpolation = INTERPOL_LINEAIRE); 00064 // Type d'interpolation 00065 void SetType(INTERPOL_TYPE Interpolation); 00066 // Nombre de pas 00067 void SetNbrPas(int NbrPas); 00068 // Vecteur d'arrivée et de depart 00069 void SetVecteurs(const GLC_Vector3d &VectDepart, const GLC_Vector3d &VectArrive); 00070 00072 // Fonctions Get 00074 public: 00075 // Retourne la matrice d'interpolation 00076 GLC_Matrix4x4 GetInterpolMat(void) const 00077 { 00078 return m_InterpolMat; 00079 } 00080 00082 // Fonctions de Service privée 00084 private: 00085 // Calcul La matrice d'interpolation 00086 bool CalcInterpolMat(void); 00087 00088 // Calcul la matrice d'interpolation linéaire 00089 bool CalcInterpolLineaireMat(void); 00090 00091 // Calcul la matrice d'interpolation angulaire 00092 bool CalcInterpolAngulaireMat(void); 00093 00095 // Membres privés 00097 private: 00098 // Vecteur de départ 00099 GLC_Vector3d m_VectDepart; 00100 // Vecteur d'arriver 00101 GLC_Vector3d m_VectArrive; 00102 00103 // Type d'interpolation courante 00104 INTERPOL_TYPE m_InterpolType; 00105 00106 // Nombre de pas d'interpolation 00107 int m_nNbrPas; 00108 00109 // Matrice d'interpolation 00110 GLC_Matrix4x4 m_InterpolMat; 00111 }; 00112 00113 #endif /*GLC_INTERPOLATOR_H_*/