Engine::InputDeviceJoystick Class Reference

A input device that handles joystick input: More...

#include <InputDeviceJoystick.h>

Inheritance diagram for Engine::InputDeviceJoystick:

Engine::InputDevice List of all members.

Public Member Functions

 InputDeviceJoystick (int index)
 Process the input of one joystick detected by SDL.
 ~InputDeviceJoystick ()
int get_acceleration ()
 Get a number representing the acceleration or breaking.
int get_slide ()
 Sideways force .
int get_steering ()
 Stearing angle.
void poll ()
 Poll for events, if necessary.

Private Attributes

int joystick_index
 The index SDL uses for the joystick.
SDL_Joystick * sdl_joystick_handle
int steering
int acceleration
int slide
bool slide_left_down
bool slide_right_down

Detailed Description

A input device that handles joystick input:

Definition at line 26 of file InputDeviceJoystick.h.


Constructor & Destructor Documentation

Engine::InputDeviceJoystick::InputDeviceJoystick ( int  index  ) 

Process the input of one joystick detected by SDL.

Parameters:
index The index SDL uses for the joystick.

Definition at line 19 of file InputDeviceJoystick.cpp.

Engine::InputDeviceJoystick::~InputDeviceJoystick (  ) 

Definition at line 32 of file InputDeviceJoystick.cpp.


Member Function Documentation

int Engine::InputDeviceJoystick::get_acceleration (  )  [virtual]

Get a number representing the acceleration or breaking.

Returns:
A number from -32767 to 32767 giving the amount of accelerating or breaking to do: 0 if not accelerating or braking, a negative value for breaking, a positive value for acceleration.

Implements Engine::InputDevice.

Definition at line 45 of file InputDeviceJoystick.cpp.

int Engine::InputDeviceJoystick::get_slide (  )  [virtual]

Sideways force .

Returns:
a number between -32767 (maximum left) and +32767 (maximum right). 0 indicates no sliding.

Implements Engine::InputDevice.

Definition at line 50 of file InputDeviceJoystick.cpp.

int Engine::InputDeviceJoystick::get_steering (  )  [virtual]

Stearing angle.

Returns:
a number between -32767 (maximum left) and 32767 (maximum right). 0 is straight ahead.

Implements Engine::InputDevice.

Definition at line 40 of file InputDeviceJoystick.cpp.

void Engine::InputDeviceJoystick::poll (  )  [virtual]

Poll for events, if necessary.

Reimplemented from Engine::InputDevice.

Definition at line 57 of file InputDeviceJoystick.cpp.


Member Data Documentation

int Engine::InputDeviceJoystick::acceleration [private]

Definition at line 41 of file InputDeviceJoystick.h.

int Engine::InputDeviceJoystick::joystick_index [private]

The index SDL uses for the joystick.

Definition at line 39 of file InputDeviceJoystick.h.

SDL_Joystick* Engine::InputDeviceJoystick::sdl_joystick_handle [private]

Definition at line 40 of file InputDeviceJoystick.h.

int Engine::InputDeviceJoystick::slide [private]

Definition at line 41 of file InputDeviceJoystick.h.

bool Engine::InputDeviceJoystick::slide_left_down [private]

Definition at line 42 of file InputDeviceJoystick.h.

bool Engine::InputDeviceJoystick::slide_right_down [private]

Definition at line 42 of file InputDeviceJoystick.h.

int Engine::InputDeviceJoystick::steering [private]

Definition at line 41 of file InputDeviceJoystick.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.