Bubba-3D  0.9.0
Awesome game engine!
Public Types | Public Member Functions | Static Public Member Functions | List of all members
JoystickAxis Class Reference

#include <JoystickAxis.h>

Inheritance diagram for JoystickAxis:
Input

Public Types

enum  Separation { POSITIVE, NEGATIVE }
 

Public Member Functions

 JoystickAxis (IJoystickTranslation::Axis axis, bool dual)
 
 JoystickAxis (IJoystickTranslation::Axis axis, Separation separation)
 
 JoystickAxis (IJoystickTranslation::Axis axisPos, IJoystickTranslation::Axis axisNeg)
 
ControlStatus getStatus ()
 
ControlStatus::Activator getActivator ()
 
- Public Member Functions inherited from Input
bool isDual ()
 

Static Public Member Functions

static float removeDeadZone (float val)
 

Additional Inherited Members

- Protected Member Functions inherited from Input
 Input (bool dual)
 
- Protected Attributes inherited from Input
bool dual
 

Detailed Description

An input class that uses the axes of joysticks. This class is quite versatile and can be used to bind different types of bindings. Check the various constructors to see their usages.

Definition at line 33 of file JoystickAxis.h.

Constructor & Destructor Documentation

JoystickAxis::JoystickAxis ( IJoystickTranslation::Axis  axis,
bool  dual 
)

This is the most simple constructor. It takes one axis and a boolean that signifies the duality of the axis. A joystick axis has the raw interval [-100,100] which is what you will receive if dual is true. If dual is false the interval is transformed to [0,100]. This can be useful for triggers. Triggers are seen as axes and has the interval [-100,100] but you often want a trigger to be seen as one button and not a dual.

Definition at line 28 of file JoystickAxis.cpp.

JoystickAxis::JoystickAxis ( IJoystickTranslation::Axis  axis,
Separation  separation 
)

Enables you to use only the positive or negative portion of an axis.

Definition at line 36 of file JoystickAxis.cpp.

JoystickAxis::JoystickAxis ( IJoystickTranslation::Axis  axisPos,
IJoystickTranslation::Axis  axisNeg 
)

Allows you to combine two axes into one dual interval. The interval of axisPos will be transformed from [-100,100] to [0,100]. The interval of will be transformed from [-100,100] to [-100,0]. Together they form the dual interval [-100,100]

Definition at line 41 of file JoystickAxis.cpp.

Member Function Documentation

ControlStatus::Activator JoystickAxis::getActivator ( )
virtual

returns ControlStatus::Activator::JOYSTICK

Implements Input.

Definition at line 32 of file JoystickAxis.cpp.

float JoystickAxis::removeDeadZone ( float  val)
static

This function takes a value in the interval [-100,100] and removes [-15,15]. This means that any number in [-15,15] is counted as zero and the rest of the numbers are scaled appropriately. This should be used whenever a value from a joystick axis is used as the axes often have a small resting area that should be ignored.

Definition at line 87 of file JoystickAxis.cpp.


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