00001 /****************************************************************************\ 00002 * * 00003 * 16.04.2006 * 00004 * CScrollXZCamCtrl - Header File * 00005 * * 00006 * (c) Raphael Charwot, Robert Hausmair * 00007 * * 00008 \****************************************************************************/ 00009 00010 #ifndef __CSCROLLXZCAMCTRL_H__ 00011 #define __CSCROLLXZCAMCTRL_H__ 00012 00013 /****************************************************************************\ 00014 * REQUIRED HEADERS * 00015 \****************************************************************************/ 00016 #include <Definitions.h> 00017 00018 #include <Memory/mmgr.h> 00019 #include <Memory/TSmartPointer.h> 00020 #include <Input/IInputHandler.h> 00021 #include <Math/TAABox3.h> 00022 #include "ICamCtrl.h" 00023 00024 /****************************************************************************\ 00025 * DEFINITIONS * 00026 \****************************************************************************/ 00027 class CCamera; 00028 #include <Timer/CTimer.h> 00029 00030 /****************************************************************************\ 00031 * CLASS * 00032 \****************************************************************************/ 00033 class CScrollXZCamCtrl : public ICamCtrl, private IInputHandler 00034 { 00035 /**************************************************************************\ 00036 * PUBLIC CLASS FUNCTIONS * 00037 \**************************************************************************/ 00038 public: 00039 CScrollXZCamCtrl(float fScrollFrame, CAABox3f scrollArea, float fSpeed, //fScrollFrame = area of the window, where the mouse should scroll 00040 const TSmartPointer<CTimer> &pTimer, word wInputPriority); 00041 00042 void Enable(const TSmartPointer<CCamera> &pCamera); 00043 void Update(); 00044 void Disable(); 00045 00046 virtual ~CScrollXZCamCtrl(); 00047 00048 /**************************************************************************\ 00049 * PROTECTED CLASS FUNCTIONS * 00050 \**************************************************************************/ 00051 protected: 00052 00053 /**************************************************************************\ 00054 * PRIVATE CLASS FUNCTIONS * 00055 \**************************************************************************/ 00056 private: 00057 virtual bool OnKeyDown(dword dwKey); 00058 virtual bool OnKeyUp(dword dwKey); 00059 00060 //Private copy constructor and assignment operator to prevent mistakes: 00061 CScrollXZCamCtrl(const CScrollXZCamCtrl &); 00062 const CScrollXZCamCtrl &operator =(const CScrollXZCamCtrl &); 00063 00064 /**************************************************************************\ 00065 * PROTECTED CLASS MEMBERS * 00066 \**************************************************************************/ 00067 protected: 00068 00069 /**************************************************************************\ 00070 * PRIVATE CLASS MEMBERS * 00071 \**************************************************************************/ 00072 private: 00073 CAABox3f m_ScrollArea; 00074 float m_fScrollFrame; 00075 float m_fSpeed; 00076 00077 bool m_bForward, m_bBackward; 00078 bool m_bLeft, m_bRight; 00079 00080 TSmartPointer<CTimer> m_pTimer; 00081 }; 00082 00083 #endif