#include <inputcontrol.h>
Inheritance diagram for kerosin::InputControl:
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::FPSController > | mFPSController |
the controlled FPSController | |
boost::shared_ptr< kerosin::InputServer > | mInputServer |
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 |
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.
|
Definition at line 46 of file inputcontrol.h. |
|
Definition at line 33 of file inputcontrol.cpp. References mAdvanceTime, mDeltaTime, mHorSens, mMouseLook, and mVertSens. |
|
Definition at line 42 of file inputcontrol.cpp. |
|
returns the advance time mode
Definition at line 276 of file inputcontrol.cpp. References mAdvanceTime. |
|
returns the size of the last time step
Definition at line 266 of file inputcontrol.cpp. References mDeltaTime. |
|
returns the horizontal mouse sensitivity
Definition at line 138 of file inputcontrol.cpp. References mHorSens. |
|
returns the vertical mouse sensitivity
Definition at line 143 of file inputcontrol.cpp. References mVertSens. |
|
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: ![]() |
|
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: ![]() |
|
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. |
|
This function creates an instance of class 'inputItem' and adds it as a child node below this control node.
|
|
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. |
|
sets the FPSController to be used
|
|
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: ![]() |
|
sets the horizontal mouse sensitivity
Definition at line 128 of file inputcontrol.cpp. References mHorSens. |
|
sets the horizontal mouse sensitivity
Definition at line 133 of file inputcontrol.cpp. References mVertSens. |
|
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: ![]() |
|
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(). |
|
the size of the last time step
Definition at line 125 of file inputcontrol.h. Referenced by GetDeltaTime(), InputControl(), and StartCycle(). |
|
the controlled FPSController
Definition at line 119 of file inputcontrol.h. Referenced by OnUnlink(), SetFPSController(), and StartCycle(). |
|
horizontal mouse sensitivity
Definition at line 128 of file inputcontrol.h. Referenced by GetHorizontalSensitivity(), InputControl(), SetHorizontalSensitivity(), and StartCycle(). |
|
cached reference to the InputServer
Definition at line 122 of file inputcontrol.h. Referenced by OnLink(), OnUnlink(), and StartCycle(). |
|
true, if mouse look is currently activated
Definition at line 139 of file inputcontrol.h. Referenced by InputControl(), and StartCycle(). |
|
vertical mouse sensitivity
Definition at line 131 of file inputcontrol.h. Referenced by GetVerticalSensitivity(), InputControl(), SetVerticalSensitivity(), and StartCycle(). |