#include <Control.h>
Public Member Functions | |
Controler () | |
ControlState & | getControlState () |
const ControlState & | getControlState () const |
ControlEventList::const_iterator | getEventBegin () const |
ControlEventList::const_iterator | getEventEnd () const |
void | clearEvents () |
void | clearAxis () |
void | clear () |
Program controled events helpers. | |
These methods are useful for AI since they're AI's entry point. | |
void | doSwitch (double curTime, ControlState::ESwitchId switchId, int unmappedKey, bool pushed) |
Push down or release a switch. | |
void | doSwitchPush (double curTime, ControlState::ESwitchId switchId, int unmappedKey) |
Push down a switch (and keep it down). | |
void | doSwitchRelease (double curTime, ControlState::ESwitchId switchId, int unmappedKey) |
Release a switch. | |
void | doSwitchPR (double curTime, ControlState::ESwitchId switchId, int unmappedKey) |
Do as if a switch (key or button) was pressed and immediatly released. | |
void | axisMove (double curTime, ControlState::EAxisId axisId, float movement) |
Do as if an axis was moved. | |
Protected Attributes | |
ControlState | state |
Current state of controls. | |
ControlEventList | vEvents |
Events "stack" (Events should be read all at once, and the list cleared afterwards). | |
TNL::EventConnection * | pConnection |
Connection for sending events. | |
Static Protected Attributes | |
static const UINT | INITIAL_EVENTS_SIZE = 8 |
Initial size of vEvents (4 seems ok, 8 is default (avoids reallocation)). |
Please remind to call clearEvents() and clearAxis() on each frame (GFX, physics or anything else that "consumes" data).
Definition at line 284 of file Control.h.
Controler::Controler | ( | ) | [inline] |
void Controler::axisMove | ( | double | curTime, | |
ControlState::EAxisId | axisId, | |||
float | movement | |||
) | [inline] |
Do as if an axis was moved.
Definition at line 324 of file Control.h.
References ControlState::addToAxis(), state, and vEvents.
void Controler::clear | ( | ) | [inline] |
Definition at line 294 of file Control.h.
References ControlState::resetAllAxis(), state, and vEvents.
void Controler::clearAxis | ( | ) | [inline] |
void Controler::clearEvents | ( | ) | [inline] |
Definition at line 292 of file Control.h.
References vEvents.
Referenced by HumanMatrixGetter::handleFrame().
void Controler::doSwitch | ( | double | curTime, | |
ControlState::ESwitchId | switchId, | |||
int | unmappedKey, | |||
bool | pushed | |||
) | [inline] |
void Controler::doSwitchPR | ( | double | curTime, | |
ControlState::ESwitchId | switchId, | |||
int | unmappedKey | |||
) | [inline] |
void Controler::doSwitchPush | ( | double | curTime, | |
ControlState::ESwitchId | switchId, | |||
int | unmappedKey | |||
) | [inline] |
void Controler::doSwitchRelease | ( | double | curTime, | |
ControlState::ESwitchId | switchId, | |||
int | unmappedKey | |||
) | [inline] |
const ControlState& Controler::getControlState | ( | ) | const [inline] |
ControlState& Controler::getControlState | ( | ) | [inline] |
Definition at line 287 of file Control.h.
References state.
Referenced by HumanMatrixGetter::handleFrame().
ControlEventList::const_iterator Controler::getEventBegin | ( | ) | const [inline] |
Definition at line 290 of file Control.h.
References vEvents.
Referenced by HumanMatrixGetter::handleFrame().
ControlEventList::const_iterator Controler::getEventEnd | ( | ) | const [inline] |
Definition at line 291 of file Control.h.
References vEvents.
Referenced by HumanMatrixGetter::handleFrame().
const UINT Controler::INITIAL_EVENTS_SIZE = 8 [static, protected] |
Initial size of vEvents (4 seems ok, 8 is default (avoids reallocation)).
Definition at line 344 of file Control.h.
Referenced by Controler().
TNL::EventConnection* Controler::pConnection [protected] |
Connection for sending events.
Definition at line 348 of file Control.h.
Referenced by ControlMapper::processHandlerLists().
ControlState Controler::state [protected] |
Current state of controls.
Definition at line 345 of file Control.h.
Referenced by axisMove(), clear(), clearAxis(), ControlMapper::computePickPos(), doSwitch(), doSwitchPR(), doSwitchPush(), doSwitchRelease(), getControlState(), and ControlMapper::handle().
ControlEventList Controler::vEvents [protected] |
Events "stack" (Events should be read all at once, and the list cleared afterwards).
Definition at line 346 of file Control.h.
Referenced by axisMove(), clear(), clearEvents(), Controler(), doSwitch(), doSwitchPR(), doSwitchPush(), doSwitchRelease(), getEventBegin(), getEventEnd(), and ControlMapper::handle().