Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Phx::LogicalInputEngine Class Reference

This is the interface for the logical input layer that maps raw user inputs to logical inputs consumed by game objects. More...

#include <PhxLogicalInputEngine.h>

Inheritance diagram for Phx::LogicalInputEngine:

Phx::NamedInterface Phx::LockedPtrInterface< NamedInterface > List of all members.

Public Types

typedef double AxisState
 Value type for axis state.
typedef ValueType< ButtonStateClass,
uint8_t > 
ButtonState
 Value type for button state.

Public Member Functions

virtual void rawInputEngine (const Ptr< RawInputEngine > &rawInputEngine)=0
virtual Ptr< AxisClientnewAxisClient (const String &axisName)=0
 Creates a new AxisClient interface for the logical axis specified by the given name.
virtual Ptr< ButtonClientnewButtonClient (const String &buttonName)=0
 Creates a new ButtonClient interface for the logical button specified by the given name.
virtual Ptr< AnalogAxisDrivernewAnalogAxisDriver (const String &axisName)=0
 Creates a new AnalogAxisDriver that will bind the logical axis axisName to a raw analog axis.
virtual Ptr< DigitalAxisDrivernewDigitalAxisDriver (const String &axisName)=0
 Creates a new DigitalAxisDriver that will bind the logical axis axisName to a set of raw buttons.
virtual Ptr< AnalogButtonDrivernewAnalogButtonDriver (const String &buttonName)=0
 Creates a new AnalogButtonDriver that will bind the logical button buttonName to a raw analog axis.
virtual Ptr< DigitalButtonDrivernewDigitalButtonDriver (const String &buttonName)=0
 Creates a new DigitalButtonDriver that will bind the logical button buttonName to a set of raw buttons.
virtual void listener (Listener *listener)=0
 Sets the Listener that will be notified when logical.

Static Public Attributes

static const NamedInterface::Type INTERFACE_TYPE
static const String INTERFACE_TYPE_NAME
static const NamedInterface::Identifier LOGICAL_INPUT_ENGINE_IDENTIFIER
static const String LOGICAL_INPUT_ENGINE_NAME
static const ButtonState PRESSED
 The standard "pressed" state for 2-state buttons.
static const ButtonState RELEASED
 The standard "released" state for 2-state buttons.

Classes

class  AnalogAxisDriver
 A LogicalInputEngine driver that binds a logical axis directly to an raw axis. More...
class  AnalogButtonDriver
 A LogicalInputEngine driver that triggers its logical button whenever an analog axis exceeds a threshold value. More...
class  AxisClient
 A sub-interface of LogicalInputEngine that allows a client to retrieve the state of a logical axis. More...
class  AxisDriver
 An abstract interface to a driver for a logical axis created by the LogicalInputEngine. More...
class  AxisSpec
 A value-type that specifies a raw axis by its driver and identifier. More...
class  ButtonClient
 A sub-interface of LogicalInputEngine that allows a client to retrieve the state of a logical button. More...
class  ButtonDriver
 An abstract interface to a driver for a logical button created by the LogicalInputEngine. More...
class  ButtonSpec
 A value-type that specifies a raw button by its driver and identifier. More...
class  ButtonSpecState
 A value type that specifies a raw button with a ButtonSpec and a state for that button. More...
class  DigitalAxisDriver
 A LogicalInputEngine driver that controls a logical axis by binding it to a set of raw buttons. More...
class  DigitalButtonDriver
 A LogicalInputEngine driver that triggers a logical button when a set of raw buttons enter specified states. More...
class  Listener
 A listener that can receive notifications as axis and button clients are created. More...

Detailed Description

This is the interface for the logical input layer that maps raw user inputs to logical inputs consumed by game objects.

The logical input engine acts as an organizer for drivers and interfaces to digital-type button inputs and analog-type axis inputs. The logical inputs (as seen by game objects) are identified by string names.

Game objects can retrieve client interfaces that allow them to poll the current state of logical buttons/axes, or be notified when the state of the button/axis changes.

For each logical axis or button, there is a corresopnding driver (also called a "binding") whose job is to determine the logical state given the current state of raw input devices. In simple cases, this merely involves forwarding information from a single raw input (e.g., feeding the raw joystick data to the logical aircraft control stick). In other cases, the driver may use combinations of buttons and/or axes (possibly coming from multiple devices) to determine the output of a single logical button or axis. For instance, an infrequently used knob in the cockpit could be controlled by holding down Shift and then rotating a knob on the joystick (note that one event is from the keyboard, the other from a joystick). Another example: a user that does not have an appropriate physical device may want to emulate a logical axis by using several keys on the keyboard to increase/decrease/center the axis (e.g., for rudder control if they do not own pedals; or the radar range knob if their HOTAS does not have a knob for this).


Member Typedef Documentation

typedef double Phx::LogicalInputEngine::AxisState
 

Value type for axis state.

Unlike the RawInputEngine::AxisState, which represents raw digital values, this represents a "continuous" value, normalized to the full range of the axis.

typedef ValueType<ButtonStateClass, uint8_t> Phx::LogicalInputEngine::ButtonState
 

Value type for button state.

This is essentially the same value as the value reported by the raw input layer. Typically, a button state has a value matching the constants PRESSED or RELEASED; however, multistage buttons (e.g., a 2-stage trigger) may define more states.

Note:
Presently, there is no mechanism by which a driver will generate more than the standard 2 states, even in the case of multistate switches, etc. (which will likely be handled by having each state identified by a separate 2-state button). However, for the moment, this interface does not preclude the existence of such multistate logical buttons in the future.

The ButtonState is an 8-bit value. If this is insufficient, consider using multiple buttons or using an Axis.


Member Function Documentation

virtual void Phx::LogicalInputEngine::listener Listener listener  )  [pure virtual]
 

Sets the Listener that will be notified when logical.

axes/buttons are created.

Parameters:
listener The listener to be notified of axis/button creation.

virtual Ptr<AnalogAxisDriver> Phx::LogicalInputEngine::newAnalogAxisDriver const String &  axisName  )  [pure virtual]
 

Creates a new AnalogAxisDriver that will bind the logical axis axisName to a raw analog axis.

Parameters:
axisName The name of the axis whose driver should be created.
Returns:
A pointer to a new AnalogAxisDriver that drives logical axis axisName.
Exceptions:
InUseException thrown if axisName already has a driver in existence.

virtual Ptr<AnalogButtonDriver> Phx::LogicalInputEngine::newAnalogButtonDriver const String &  buttonName  )  [pure virtual]
 

Creates a new AnalogButtonDriver that will bind the logical button buttonName to a raw analog axis.

Parameters:
buttonName The name of the button whose driver should be created.
Returns:
A pointer to a new AnalogButtonDriver that drives logical button buttonName.
Exceptions:
InUseException thrown if buttonName already has a driver in existence.

virtual Ptr<AxisClient> Phx::LogicalInputEngine::newAxisClient const String &  axisName  )  [pure virtual]
 

Creates a new AxisClient interface for the logical axis specified by the given name.

Parameters:
axisName The name of the logical axis for which a client interface is requested.
Returns:
A new AxisClient interface to the logical axis with name axisName.

virtual Ptr<ButtonClient> Phx::LogicalInputEngine::newButtonClient const String &  buttonName  )  [pure virtual]
 

Creates a new ButtonClient interface for the logical button specified by the given name.

Parameters:
buttonName The name of the logical button for which a client interface is requested.
Returns:
A new ButtonClient interface to the logical button with name buttonName.

virtual Ptr<DigitalAxisDriver> Phx::LogicalInputEngine::newDigitalAxisDriver const String &  axisName  )  [pure virtual]
 

Creates a new DigitalAxisDriver that will bind the logical axis axisName to a set of raw buttons.

Parameters:
axisName The name of the axis whose driver should be created.
Returns:
A pointer to a new DigitalAxisDriver that drives logical axis axisName.
Exceptions:
InUseException thrown if axisName already has a driver in existence.

virtual Ptr<DigitalButtonDriver> Phx::LogicalInputEngine::newDigitalButtonDriver const String &  buttonName  )  [pure virtual]
 

Creates a new DigitalButtonDriver that will bind the logical button buttonName to a set of raw buttons.

Parameters:
buttonName The name of the button whose driver should be created.
Returns:
A pointer to a new DigitalButtonDriver that drives logical button buttonName.
Exceptions:
InUseException thrown if buttonName already has a driver in existence.


The documentation for this class was generated from the following file:
Generated on Mon Jul 10 19:45:29 2006 for Phoenix OSFS by  doxygen 1.4.2