00001 /* 00002 00003 ************************************************************************* 00004 00005 ArmageTron -- Just another Tron Lightcycle Game in 3D. 00006 Copyright (C) 2005 by Manuel Moos 00007 and the AA DevTeam (see the file AUTHORS(.txt) in the main source directory) 00008 00009 ************************************************************************** 00010 00011 This program is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License 00013 as published by the Free Software Foundation; either version 2 00014 of the License, or (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with this program; if not, write to the Free Software 00023 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00024 00025 *************************************************************************** 00026 00027 */ 00028 00029 #ifndef ArmageTron_gJoystick_H 00030 #define ArmageTron_gJoystick_H 00031 00032 class gCycleMovement; 00033 class uActionPlayer; 00034 00035 #include "tCoord.h" 00036 00038 // just don't cut it there. 00039 00040 class gJoystick 00041 { 00042 friend class gCycle; 00043 public: 00044 gJoystick( gCycleMovement * cycle ) 00045 : cycle_( cycle ), lastCommand_( 0 ), lastTurn_(0), glance_( false ), turnRequested_( false ) 00046 { 00047 } 00048 00050 bool Act( uActionPlayer * act, REAL value ); 00051 00053 void Turn(); 00054 private: 00055 bool ActInternal( uActionPlayer * act, REAL value ); 00056 00057 gCycleMovement * cycle_; 00058 tCoord cameraDirection_; 00059 tCoord driveDirection_; 00060 tCoord joyDirection_; 00061 00062 double lastCommand_; 00063 int lastTurn_; 00064 00065 bool glance_; 00066 bool turnRequested_; 00067 }; 00068 00069 #endif