Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

inputcontrol.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002    this file is part of rcssserver3D
00003    Fri May 9 2003
00004    Copyright (C) 2003 Koblenz University
00005    $Id: inputcontrol.h,v 1.3 2004/12/31 11:02:13 rollmark Exp $
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; version 2 of the License.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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     // define common input constants
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             // first user defined input constant
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 } // namespace kerosin
00145 
00146 #endif // KEROSIN_INPUTCONTROL_H

Generated on Thu Apr 6 15:25:38 2006 for rcssserver3d by  doxygen 1.4.4