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

kerosin::InputControl Class Reference

SimControlNode that processes any pending input events from the InputServer at the begin of each simulation cycle. More...

#include <inputcontrol.h>

Inheritance diagram for kerosin::InputControl:

Inheritance graph
[legend]
Collaboration diagram for kerosin::InputControl:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ECmds {
  CmdTimer = 1, CmdMouseX = 2, CmdMouseY = 3, CmdUp = 4,
  CmdDown = 5, CmdLeft = 6, CmdRight = 7, CmdForward = 8,
  CmdBackward = 9, CmdMouseLook = 10, CmdQuit = 11, CmdUser = 12
}

Public Member Functions

 InputControl ()
virtual ~InputControl ()
bool SetFPSController (const std::string &path)
 sets the location of the FPS Controller to be used
void SetFPSController (boost::shared_ptr< oxygen::FPSController > controller)
 sets the FPSController to be used
void SetHorizontalSensitivity (float s)
 sets the horizontal mouse sensitivity
float GetHorizontalSensitivity ()
 returns the horizontal mouse sensitivity
void SetVerticalSensitivity (float s)
 sets the horizontal mouse sensitivity
float GetVerticalSensitivity ()
 returns the vertical mouse sensitivity
float GetDeltaTime ()
 returns the size of the last time step
void SetAdvanceTime (bool advance)
 if set the deltatime read from the InputServer is automatically passed to the SimulationServer.
bool GetAdvanceTime ()
 returns the advance time mode
virtual void InitSimulation ()
 called once when the simulation is started
virtual void StartCycle ()
 processes pending input events at the start of each simulation cycle
bool RegisterInputItem (const std::string &inputItem, const std::string &name)
 This function creates an instance of class 'inputItem' and adds it as a child node below this control node.

Protected Member Functions

virtual void OnLink ()
 This method is called, when the hierarchy object has been linked to a parent.
virtual void OnUnlink ()
 This rountine is called, before the hierarchy object is removed from the parent.

Protected Attributes

boost::shared_ptr< oxygen::FPSControllermFPSController
 the controlled FPSController
boost::shared_ptr< kerosin::InputServermInputServer
 cached reference to the InputServer
float mDeltaTime
 the size of the last time step
float mHorSens
 horizontal mouse sensitivity
float mVertSens
 vertical mouse sensitivity
bool mAdvanceTime
 true, if the deltatime read from the InputServer is automatically passed to the SimulationServer.
bool mMouseLook
 true, if mouse look is currently activated

Detailed Description

SimControlNode that processes any pending input events from the InputServer at the begin of each simulation cycle.

It defines and handles a set of default events and can be customized by registering InputItems to it.

If set, InputControl disables the automatic time stepping of the SimulationServer and steps the simulation using the real time passed.

Definition at line 42 of file inputcontrol.h.


Member Enumeration Documentation

enum kerosin::InputControl::ECmds
 

Enumerator:
CmdTimer 
CmdMouseX 
CmdMouseY 
CmdUp 
CmdDown 
CmdLeft 
CmdRight 
CmdForward 
CmdBackward 
CmdMouseLook 
CmdQuit 
CmdUser 

Definition at line 46 of file inputcontrol.h.


Constructor & Destructor Documentation

InputControl::InputControl  ) 
 

Definition at line 33 of file inputcontrol.cpp.

References mAdvanceTime, mDeltaTime, mHorSens, mMouseLook, and mVertSens.

InputControl::~InputControl  )  [virtual]
 

Definition at line 42 of file inputcontrol.cpp.


Member Function Documentation

bool InputControl::GetAdvanceTime  ) 
 

returns the advance time mode

Definition at line 276 of file inputcontrol.cpp.

References mAdvanceTime.

float InputControl::GetDeltaTime  ) 
 

returns the size of the last time step

Definition at line 266 of file inputcontrol.cpp.

References mDeltaTime.

float InputControl::GetHorizontalSensitivity  ) 
 

returns the horizontal mouse sensitivity

Definition at line 138 of file inputcontrol.cpp.

References mHorSens.

float InputControl::GetVerticalSensitivity  ) 
 

returns the vertical mouse sensitivity

Definition at line 143 of file inputcontrol.cpp.

References mVertSens.

void InputControl::InitSimulation  )  [virtual]
 

called once when the simulation is started

Reimplemented from oxygen::SimControlNode.

Definition at line 148 of file inputcontrol.cpp.

References oxygen::SimControlNode::GetSimulationServer(), and mAdvanceTime.

Here is the call graph for this function:

void InputControl::OnLink  )  [protected, virtual]
 

This method is called, when the hierarchy object has been linked to a parent.

At that point, traversal can commence. It can be overridden to support custom 'link' behavior.

Reimplemented from zeitgeist::Leaf.

Definition at line 91 of file inputcontrol.cpp.

References CmdBackward, CmdDown, CmdForward, CmdLeft, CmdMouseLook, CmdMouseX, CmdMouseY, CmdQuit, CmdRight, CmdTimer, CmdUp, zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), and mInputServer.

Here is the call graph for this function:

void InputControl::OnUnlink  )  [protected, virtual]
 

This rountine is called, before the hierarchy object is removed from the parent.

It can be overridden to support custom 'unlink' behavior.

Reimplemented from zeitgeist::Leaf.

Definition at line 118 of file inputcontrol.cpp.

References mFPSController, and mInputServer.

bool kerosin::InputControl::RegisterInputItem const std::string &  inputItem,
const std::string &  name
 

This function creates an instance of class 'inputItem' and adds it as a child node below this control node.

void InputControl::SetAdvanceTime bool  advance  ) 
 

if set the deltatime read from the InputServer is automatically passed to the SimulationServer.

The automatic time stepping of the SimulationServer is disabled and this ControlNode takes the responsibility to advance the time, default true. This useful if the simulation speed should be locked to the real time passed.

Definition at line 271 of file inputcontrol.cpp.

References mAdvanceTime.

void kerosin::InputControl::SetFPSController boost::shared_ptr< oxygen::FPSController controller  ) 
 

sets the FPSController to be used

bool InputControl::SetFPSController const std::string &  path  ) 
 

sets the location of the FPS Controller to be used

Definition at line 46 of file inputcontrol.cpp.

References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), and mFPSController.

Here is the call graph for this function:

void InputControl::SetHorizontalSensitivity float  s  ) 
 

sets the horizontal mouse sensitivity

Definition at line 128 of file inputcontrol.cpp.

References mHorSens.

void InputControl::SetVerticalSensitivity float  s  ) 
 

sets the horizontal mouse sensitivity

Definition at line 133 of file inputcontrol.cpp.

References mVertSens.

void InputControl::StartCycle  )  [virtual]
 

processes pending input events at the start of each simulation cycle

Reimplemented from oxygen::SimControlNode.

Definition at line 157 of file inputcontrol.cpp.

References CmdBackward, CmdDown, CmdForward, CmdLeft, CmdMouseLook, CmdMouseX, CmdMouseY, CmdQuit, CmdRight, CmdTimer, CmdUp, kerosin::InputServer::Input::data, oxygen::SimControlNode::GetSimulationServer(), kerosin::InputServer::Input::id, mAdvanceTime, mDeltaTime, mFPSController, mHorSens, mInputServer, mMouseLook, and mVertSens.

Here is the call graph for this function:


Member Data Documentation

bool kerosin::InputControl::mAdvanceTime [protected]
 

true, if the deltatime read from the InputServer is automatically passed to the SimulationServer.

Definition at line 136 of file inputcontrol.h.

Referenced by GetAdvanceTime(), InitSimulation(), InputControl(), SetAdvanceTime(), and StartCycle().

float kerosin::InputControl::mDeltaTime [protected]
 

the size of the last time step

Definition at line 125 of file inputcontrol.h.

Referenced by GetDeltaTime(), InputControl(), and StartCycle().

boost::shared_ptr<oxygen::FPSController> kerosin::InputControl::mFPSController [protected]
 

the controlled FPSController

Definition at line 119 of file inputcontrol.h.

Referenced by OnUnlink(), SetFPSController(), and StartCycle().

float kerosin::InputControl::mHorSens [protected]
 

horizontal mouse sensitivity

Definition at line 128 of file inputcontrol.h.

Referenced by GetHorizontalSensitivity(), InputControl(), SetHorizontalSensitivity(), and StartCycle().

boost::shared_ptr<kerosin::InputServer> kerosin::InputControl::mInputServer [protected]
 

cached reference to the InputServer

Definition at line 122 of file inputcontrol.h.

Referenced by OnLink(), OnUnlink(), and StartCycle().

bool kerosin::InputControl::mMouseLook [protected]
 

true, if mouse look is currently activated

Definition at line 139 of file inputcontrol.h.

Referenced by InputControl(), and StartCycle().

float kerosin::InputControl::mVertSens [protected]
 

vertical mouse sensitivity

Definition at line 131 of file inputcontrol.h.

Referenced by GetVerticalSensitivity(), InputControl(), SetVerticalSensitivity(), and StartCycle().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:42:44 2006 for rcssserver3d by  doxygen 1.4.4