00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * PS2パッドカメラコントローラヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef PS2_PAD_CAMERA_CONTROLLER_H_ 00026 #define PS2_PAD_CAMERA_CONTROLLER_H_ 00027 00028 namespace Lamp{ 00029 00030 class Camera; 00031 class Joystick; 00032 class PS2Pad; 00033 00034 //------------------------------------------------------------------------------ 00035 /** 00036 * PS2パッドカメラコントローラ 00037 */ 00038 class PS2PadCameraController{ 00039 public: 00040 /** 00041 * コンストラクタ 00042 */ 00043 PS2PadCameraController(); 00044 00045 /** 00046 * デストラクタ 00047 */ 00048 virtual ~PS2PadCameraController(); 00049 00050 /** 00051 * コントロール 00052 */ 00053 virtual void control(); 00054 00055 //-------------------------------------------------------------------------- 00056 /** 00057 * カメラの設定 00058 * @param camera 設定するカメラ 00059 */ 00060 virtual void setCamera(Camera* camera){ camera_ = camera; } 00061 00062 /** 00063 * カメラの取得 00064 * @return カメラ 00065 */ 00066 virtual Camera* getCamera(){ return camera_; } 00067 00068 //-------------------------------------------------------------------------- 00069 /** 00070 * 回転感度の設定 00071 * @param rotationSensibility 回転感度 00072 */ 00073 virtual void setRotationSensibility(float rotationSensibility){ 00074 rotationSensibility_ = rotationSensibility; 00075 } 00076 00077 /** 00078 * 回転感度の取得 00079 * @return 回転感度 00080 */ 00081 virtual float getRotationSensibility() const{ return rotationSensibility_; } 00082 00083 //-------------------------------------------------------------------------- 00084 /** 00085 * 移動感度の設定 00086 * @param translationSensibility 移動感度 00087 */ 00088 virtual void setTranslationSensibility(float translationSensibility){ 00089 translationSensibility_ = translationSensibility; 00090 } 00091 00092 /** 00093 * 移動感度の取得 00094 * @return 移動感度 00095 */ 00096 virtual float getTranslationSensibility() const{ 00097 return translationSensibility_; 00098 } 00099 00100 //-------------------------------------------------------------------------- 00101 /** 00102 * 画角感度の設定 00103 * @param fovYSensibility 画角感度 00104 */ 00105 virtual void setFovYSensibility(float fovYSensibility){ 00106 fovYSensibility_ = fovYSensibility; 00107 } 00108 00109 /** 00110 * 画角感度の取得 00111 * @return 画角感度 00112 */ 00113 virtual float getFovYSensibility() const{ return fovYSensibility_; } 00114 00115 //-------------------------------------------------------------------------- 00116 /** 00117 * ジョイスティックの設定 00118 * @param joystick 設定するPS2互換ジョイスティック 00119 * @return 成功すればtrue 00120 */ 00121 virtual bool setJoystick(Joystick* joystick); 00122 00123 /** 00124 * ジョイスティックの取得 00125 * @return ジョイスティック 00126 */ 00127 virtual Joystick* getJoystick(); 00128 00129 /** 00130 * ジョイスティックの検索 00131 * @return 見つかったジョイスティック。無ければNULL。 00132 */ 00133 virtual Joystick* searchJoystick(); 00134 00135 protected: 00136 //-------------------------------------------------------------------------- 00137 /// カメラ 00138 Camera* camera_; 00139 /// パッド 00140 PS2Pad* pad_; 00141 /// 回転感度 00142 float rotationSensibility_; 00143 /// 移動感度 00144 float translationSensibility_; 00145 /// 画角感度 00146 float fovYSensibility_; 00147 /// 移動モード 00148 bool moveMode_; 00149 00150 private: 00151 // コピーコンストラクタの隠蔽 00152 PS2PadCameraController(const PS2PadCameraController& copy); 00153 00154 // 代入コピーの隠蔽 00155 void operator =(const PS2PadCameraController& copy); 00156 00157 }; 00158 00159 //------------------------------------------------------------------------------ 00160 } // End of namespace Lamp 00161 #endif // End of PS2_PAD_CAMERA_CONTROLLER_H_ 00162 //------------------------------------------------------------------------------