Drag[en]gine Game Engine  1.0
deInputDeviceAxis Class Reference

Input device axis. More...

#include <deInputDeviceAxis.h>

Public Member Functions

Constructors and Destructors
 deInputDeviceAxis ()
 Create input device axis. More...
 
 deInputDeviceAxis (const deInputDeviceAxis &axis)
 Create copy of input device axis. More...
 
 ~deInputDeviceAxis ()
 Clean up input device axis. More...
 
Management
const decStringGetID () const
 Axis identifier. More...
 
void SetID (const char *id)
 Set identifier. More...
 
const decStringGetName () const
 Display name. More...
 
void SetName (const char *name)
 Set Display name. More...
 
float GetMinimum () const
 Minimum value. More...
 
void SetMinimum (float minimum)
 Set minimum value. More...
 
float GetMaximum () const
 Maximum value. More...
 
void SetMaximum (float maximum)
 Set maximum value. More...
 
float GetCenter () const
 Center value. More...
 
void SetCenter (float center)
 Set center value. More...
 
Operators
deInputDeviceAxisoperator= (const deInputDeviceAxis &axis)
 Copy input device axis. More...
 

Detailed Description

Input device axis.

Axes can be any input control a user can alter between a minimum and maximum range. Axes are always a single value. Input elements moving along more than 1 degree of freedom one individual axis is used for each degree of freedom. A mouse has 2 axes one for X movement and one for Y movement. The same applies to an analog stick on a joystick or gamepad. A 3D mouse or joystick with twist support use 3 axes. Complex input controls like racing can have more than 3 axes.

Dead zone and jitter is handled by the input module. The scripting module does not have to worry about this. The input module adjusts the values to hide these parameters. For example for a gamepad the input value is mapped from the range (realMinimum -> deadZone) to (minimum, center) and (deadZone -> realMaximum) to (center, maximum). The entire dead zone shows up as single center value to the scripting module no matter how the user configurated the dead zone.

The minimum, center and maximum values are typically -1, 0 and 1. These can though change for specific devices. A trottle control for example might have larger range towards the maximum than the minimum. This can result in the center located closer to the minimum or the minimum to be closer to the center. Another example would be 3D tracking devices. Their minimum and maximum is typically a lot larger/smaller than 1/-1 covering the entire range they can move in. This avoids the need to scale values in the scripting module for individual devices.

Constructor & Destructor Documentation

◆ deInputDeviceAxis() [1/2]

deInputDeviceAxis::deInputDeviceAxis ( )

Create input device axis.

◆ deInputDeviceAxis() [2/2]

deInputDeviceAxis::deInputDeviceAxis ( const deInputDeviceAxis axis)

Create copy of input device axis.

◆ ~deInputDeviceAxis()

deInputDeviceAxis::~deInputDeviceAxis ( )

Clean up input device axis.

Member Function Documentation

◆ GetCenter()

float deInputDeviceAxis::GetCenter ( ) const
inline

Center value.

References operator=(), and SetCenter().

◆ GetID()

const decString& deInputDeviceAxis::GetID ( ) const
inline

Axis identifier.

Unique identifier for the axis identifying it inside the parent device. The prefix is a normalized string that contains only letters, numbers and underscores. It is suitable to be combined with the device identifier to store them in config files as key bindings.

References SetID().

◆ GetMaximum()

float deInputDeviceAxis::GetMaximum ( ) const
inline

Maximum value.

References SetMaximum().

◆ GetMinimum()

float deInputDeviceAxis::GetMinimum ( ) const
inline

Minimum value.

References SetMinimum().

◆ GetName()

const decString& deInputDeviceAxis::GetName ( ) const
inline

Display name.

Dispaly name is human readable like for example 'Axis #1'. The name is unique but not guaranteed to stay the same across restarting the input module or game engine.

References SetName().

◆ operator=()

deInputDeviceAxis& deInputDeviceAxis::operator= ( const deInputDeviceAxis axis)

Copy input device axis.

Referenced by GetCenter().

◆ SetCenter()

void deInputDeviceAxis::SetCenter ( float  center)

Set center value.

Referenced by GetCenter().

◆ SetID()

void deInputDeviceAxis::SetID ( const char *  id)

Set identifier.

Referenced by GetID().

◆ SetMaximum()

void deInputDeviceAxis::SetMaximum ( float  maximum)

Set maximum value.

Referenced by GetMaximum().

◆ SetMinimum()

void deInputDeviceAxis::SetMinimum ( float  minimum)

Set minimum value.

Referenced by GetMinimum().

◆ SetName()

void deInputDeviceAxis::SetName ( const char *  name)

Set Display name.

Referenced by GetName().


The documentation for this class was generated from the following file: