![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2006 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: rotWingJoyCtl.h,v $ $Revision: 1.24 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00014 00015 00016 #ifndef DtRotaryWingJoyFlightController_H_ 00017 #define DtRotaryWingJoyFlightController_H_ 00018 00019 #include "vrfobjcore/simRadio.h" 00020 #include "vrfmodel/rotWngPltCtl.h" 00021 #include "vrfutil/rwReal.h" 00022 00023 class DtString; 00024 class DtSimManager; 00025 class DtRotaryWingJoyDeviceControllerDescriptor; 00026 class DtJoyDevice; 00027 00032 #include "vrfmodel/vrfmodelDefines.h" 00033 class DT_DLL_vrfmodel DtRotaryWingJoyFlightController : public DtRotaryWingPilotController 00034 { 00035 00036 public: 00037 00040 DtRotaryWingJoyFlightController(const DtString& name, 00041 DtVrfObject* owner, 00042 DtSimManager* simManager, 00043 DtComponentDescriptor* desc = 0, 00044 DtReaderWriterRegistry* parentRegistry = 0); 00045 00047 virtual ~DtRotaryWingJoyFlightController(); 00048 00049 virtual bool init(); 00050 00052 virtual void tick(); 00053 00056 virtual DtString type() const; 00057 00059 static void setJoyDeviceSwitchCallbacks(DtSimMessage * msg, void * usrData); 00060 00062 virtual void processSetJoyDeviceSwitch(DtSimMessage * msg); 00063 00065 virtual void calcAndSetPortValues(); 00066 00067 virtual bool joystickEnabled() const; 00068 00072 static DtSimComponent * creator(const DtString& name, 00073 DtVrfObject* owner, 00074 DtSimManager* simManager, 00075 DtComponentDescriptor* desc = 0, 00076 DtReaderWriterRegistry* parentRegistry = 0); 00077 00078 protected: 00079 00082 virtual void calculateGains(const DtReal manuverConst, const DtReal riseTime, 00083 DtReal & velGain, DtReal & oriGain); 00084 00086 virtual void initializeJoyDevice(); 00087 00089 virtual void setRadio(DtSimRadio * radio); 00090 00091 protected: 00092 00094 DtRotaryWingJoyFlightController(); 00095 00097 DtRotaryWingJoyFlightController( 00098 const DtRotaryWingJoyFlightController& orig); 00099 00101 DtRotaryWingJoyFlightController& operator=( 00102 const DtRotaryWingJoyFlightController& orig); 00103 00104 00105 protected: 00106 00107 DtJoyDevice * myJoyDevice; 00108 const DtRotaryWingJoyDeviceControllerDescriptor * myJoyDeviceControllerDescriptor; 00109 bool myJoyDeviceInitialized; 00110 00111 DtReal myPitchVelGain; 00112 DtReal myPitchOriGain; 00113 DtReal myRollVelGain; 00114 DtReal myRollOriGain; 00115 DtReal myYawVelGain; 00116 DtReal myYawOriGain; 00117 00118 bool myJoystickEnabled; 00119 }; 00120 00121 #endif