00001 /* 00002 * lib-controler : Un contrôleur générique de scène 3D. 00003 * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC 00004 * http://www.sic.sp2mi.univ-poitiers.fr/ 00005 * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS, 00006 * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/ 00007 * 00008 * This file is part of lib-controler 00009 * 00010 * This program is free software: you can redistribute it and/or modify 00011 * it under the terms of the GNU Lesser General Public License as published by 00012 * the Free Software Foundation, either version 3 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public License 00021 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 00024 //****************************************************************************** 00025 // Ce fichier fait partie de "controler-operations.hh". 00026 //****************************************************************************** 00027 00028 private: 00029 00030 CVertex eye_coord; 00031 00032 void calculEyePosition(TViewId AView, CParameterEyePosition * eye_pos, 00033 CParameterAimedPosition * pt_view); 00034 00035 public: 00036 00037 // Calcule les coordonnees de l'oeil. 00038 CVertex calculEyePosition(TViewId AView); 00039 00040 00041 // Retourne un accesseur sur les coordonnees de l'oeil 00042 // precedement calculees avec les fonctions horizontalRotationEye(), 00043 // verticalRotationEye(), moveEye() ou moveEyeLateral(). 00044 const CVertex & getEyePosition() const; 00045 00046 00047 // ------------------------------------- 00048 // Operations 3D 00049 // ------------------------------------- 00050 00051 // Effectue une rotation horizontale de la camera de 'alpha' degres. 00052 void horizontalRotationEye(TViewId AView,bool positive = true,float alpha = 0); 00053 00054 // Effectue une rotation veticale de la camera de 'beta' degres. 00055 void verticalRotationEye(TViewId AView,bool positive = true,float beta = 0); 00056 00057 // Deplace la camera dans la direction de visee. 00058 // 'coeff' indique la longueur du deplacement : 00059 // Un nombre positif fait avancer, un nomber negatif fait reculer. 00060 void moveEye(TViewId AView,bool positive = true,float coeff = 0); 00061 00062 // Deplacement latéral de la caméra : 00063 // 'coeff' indique la longueur du deplacement : 00064 // Un nombre positif fait avancer sur la droite, un nomber negatif sur la gauche. 00065 void moveEyeLateral(TViewId AView,bool positive = true,float coeff = 0); 00066 00067 00068 // ------------------------------------- 00069 // Operations 2D 00070 // ------------------------------------- 00071 00072 // Deplace le point de vue selon un axe. 00073 void moveEyeX(TViewId AView,bool positive = true,float coeff = 0); 00074 void moveEyeY(TViewId AView,bool positive = true,float coeff = 0); 00075 void moveEyeZ(TViewId AView,bool positive = true,float coeff = 0); 00076 00077 00078 //******************************************************************************
1.5.8