00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEROSIN_INPUTCONTROL_H
00021 #define KEROSIN_INPUTCONTROL_H
00022
00023 #include <oxygen/simulationserver/simcontrolnode.h>
00024 #include <kerosin/inputserver/inputserver.h>
00025
00026 namespace oxygen
00027 {
00028 class FPSController;
00029 }
00030
00031 namespace kerosin
00032 {
00042 class InputControl : public oxygen::SimControlNode
00043 {
00044 public:
00045
00046 enum ECmds
00047 {
00048 CmdTimer = 1,
00049 CmdMouseX = 2,
00050 CmdMouseY = 3,
00051 CmdUp = 4,
00052 CmdDown = 5,
00053 CmdLeft = 6,
00054 CmdRight = 7,
00055 CmdForward = 8,
00056 CmdBackward = 9,
00057 CmdMouseLook = 10,
00058 CmdQuit = 11,
00059
00060
00061 CmdUser = 12
00062 };
00063
00064 public:
00065 InputControl();
00066 virtual ~InputControl();
00067
00069 bool SetFPSController(const std::string& path);
00070
00072 void SetFPSController(boost::shared_ptr<oxygen::FPSController> controller);
00073
00075 void SetHorizontalSensitivity(float s);
00076
00078 float GetHorizontalSensitivity();
00079
00081 void SetVerticalSensitivity(float s);
00082
00084 float GetVerticalSensitivity();
00085
00087 float GetDeltaTime();
00088
00096 void SetAdvanceTime(bool advance);
00097
00099 bool GetAdvanceTime();
00100
00102 virtual void InitSimulation();
00103
00106 virtual void StartCycle();
00107
00111 bool RegisterInputItem(const std::string& inputItem, const std::string& name);
00112
00113 protected:
00114 virtual void OnLink();
00115 virtual void OnUnlink();
00116
00117 protected:
00119 boost::shared_ptr<oxygen::FPSController> mFPSController;
00120
00122 boost::shared_ptr<kerosin::InputServer> mInputServer;
00123
00125 float mDeltaTime;
00126
00128 float mHorSens;
00129
00131 float mVertSens;
00132
00136 bool mAdvanceTime;
00137
00139 bool mMouseLook;
00140 };
00141
00142 DECLARE_CLASS(InputControl);
00143
00144 }
00145
00146 #endif // KEROSIN_INPUTCONTROL_H