CMotionController.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2006 Werewolf
00008  *
00009  * This file is part of Werewolf.
00010  * Werewolf is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * Werewolf is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with Werewolf; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef __CMOTIONCONTROLLER_H__
00027 #define __CMOTIONCONTROLLER_H__
00028 
00029 //
00030 // Standard Includes
00031 //
00032 
00033 //
00034 // System Includes
00035 //
00036 
00037 //
00038 // NeL Includes
00039 //
00040 #include <nel/misc/matrix.h>
00041 #include <nel/3d/u_visual_collision_entity.h>
00042 #include <nel/3d/u_visual_collision_manager.h>
00043 
00044 //
00045 // Werewolf Includes
00046 //
00047 #include "ISobController.h"
00048 #include "CPerformer.h"
00049 #include "ISimulationState.h"
00050 
00051 //
00052 // Namespaces
00053 //
00054 
00055 namespace WWCOMMON {
00056 
00057 class CMotionController : public ISobController {
00058 public:
00059     CMotionController(CPerformer* subject);
00060     virtual ~CMotionController();
00061 
00062     void setVisualCollisionEntity(NL3D::UVisualCollisionManager* vcm);
00063 
00064     void update();
00065     void update(double dt);
00066 
00067     const char* getControllerName();
00068     NLMISC::CVector snapToGround(NLMISC::CVector pos);
00069     double Duration;
00070 
00071 private:
00072     void move(double dt, bool correction);
00073     void ODE(float dt, float& yaw, float& vYaw, NLMISC::CVector& pos, NLMISC::CVector& sPos, NLMISC::CVector& vPos);
00074     void ODEStep(float dt, float& yaw, float& vYaw, NLMISC::CVector& pos, NLMISC::CVector& sPos, NLMISC::CVector& vPos, ISimulationState* moveState, ISimulationState* orientState, NLMISC::CMatrix &rotMat);
00075     void setKey();
00076 
00077     double m_CorrectionDt;
00078     static const char* m_Name;
00079     NL3D::UVisualCollisionEntity *m_VCE;
00080     NL3D::UVisualCollisionManager *m_VCM;
00081     CPerformer* m_Subject;
00082 };
00083 
00084 }; // END OF NAMESPACE WWCOMMON
00085 
00086 #endif // __CMOTIONCONTROLLER_H__

Generated on Mon Jan 11 12:03:39 2010 for Werewolf by  doxygen 1.6.1