00001 /****************************************************************************\ 00002 * * 00003 * 16.04.2006 * 00004 * CFlyCamCtrl - Header File * 00005 * * 00006 * (c) Robert Hausmair * 00007 * * 00008 \****************************************************************************/ 00009 00010 #ifndef __CSceneControl_H__ 00011 #define __CSceneControl_H__ 00012 00013 /****************************************************************************\ 00014 * REQUIRED HEADERS * 00015 \****************************************************************************/ 00016 00017 //need to include this because of mmgr macro redefinition 00018 #include <QWidget> 00019 00020 #include <Definitions.h> 00021 #include <Memory/mmgr.h> 00022 #include <Memory/TSmartPointer.h> 00023 00024 #include "ICamCtrl.h" 00025 #include "Math/TVector3.h" 00026 00027 /****************************************************************************\ 00028 * DEFINITIONS * 00029 \****************************************************************************/ 00030 00031 /****************************************************************************\ 00032 * CLASS * 00033 \****************************************************************************/ 00034 class CSceneCtrl : public ICamCtrl 00035 { 00036 /**************************************************************************\ 00037 * PUBLIC CLASS FUNCTIONS * 00038 \**************************************************************************/ 00039 public: 00040 CSceneCtrl(); 00041 virtual ~CSceneCtrl(); 00042 00043 virtual void Enable(const TSmartPointer<CCamera> &pCamera); 00044 virtual void Disable(); 00045 virtual void Reset(); 00046 00047 virtual void Update(); 00048 00049 virtual bool OnMouseMove(sdword sdwX, sdword sdwY, sdword sdwZ); 00050 virtual bool OnMouseKeyDown(byte bKey); 00051 virtual bool OnMouseKeyUp(byte bKey); 00052 virtual bool OnKeyDown(dword dwKey); 00053 virtual bool OnKeyUp(dword dwKey); 00054 00055 virtual CVector3f * GetRot(){return &m_rot;} 00056 virtual CVector3f * GetPos(){return &m_pos;} 00057 virtual float GetFOV(){return m_fov;} 00058 virtual void SetRot(CVector3f & rot){m_rot = rot;} 00059 virtual void SetPos(CVector3f & pos){m_pos = pos;} 00060 virtual void SetFOV(float fov){m_fov = fov;} 00061 00062 00063 /**************************************************************************\ 00064 * PROTECTED CLASS FUNCTIONS * 00065 \**************************************************************************/ 00066 protected: 00067 00068 /**************************************************************************\ 00069 * PRIVATE CLASS FUNCTIONS * 00070 \**************************************************************************/ 00071 private: 00072 //Private copy constructor and assignment operator to prevent mistakes: 00073 CSceneCtrl(const CSceneCtrl &); 00074 const CSceneCtrl &operator =(const CSceneCtrl &); 00075 00076 /**************************************************************************\ 00077 * PROTECTED CLASS MEMBERS * 00078 \**************************************************************************/ 00079 protected: 00080 00081 /**************************************************************************\ 00082 * PRIVATE CLASS MEMBERS * 00083 \**************************************************************************/ 00084 private: 00085 bool m_bActive; 00086 bool m_bRotate; 00087 bool m_bDolly; 00088 bool m_bPan; 00089 bool m_bChangeFov; 00090 00091 bool m_bLButtonDown; 00092 bool m_bRButtonDown; 00093 bool m_bMButtonDown; 00094 00095 CVector3f m_pos; 00096 CVector3f m_rot; 00097 double m_fov; 00098 }; 00099 00100 #endif