CMotionController.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __CMOTIONCONTROLLER_H__
00027 #define __CMOTIONCONTROLLER_H__
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
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
00046
00047 #include "ISobController.h"
00048 #include "CPerformer.h"
00049 #include "ISimulationState.h"
00050
00051
00052
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 };
00085
00086 #endif // __CMOTIONCONTROLLER_H__