//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * PS2パッドカメラコントローラヘッダ
 * @author Junpee
 */

#ifndef PS2_PAD_CAMERA_CONTROLLER_H_
#define PS2_PAD_CAMERA_CONTROLLER_H_

namespace Lamp{

class Camera;
class Joystick;
class PS2Pad;

//------------------------------------------------------------------------------
/**
 * PS2パッドカメラコントローラ
 */
class PS2PadCameraController{
public:
	/**
	 * コンストラクタ
	 */
	PS2PadCameraController();

	/**
	 * デストラクタ
	 */
	virtual ~PS2PadCameraController();

	/**
	 * コントロール
	 */
	virtual void control();

	//--------------------------------------------------------------------------
	/**
	 * カメラの設定
	 * @param camera 設定するカメラ
	 */
	virtual void setCamera(Camera* camera){ camera_ = camera; }

	/**
	 * カメラの取得
	 * @return カメラ
	 */
	virtual Camera* getCamera(){ return camera_; }

	//--------------------------------------------------------------------------
	/**
	 * 回転感度の設定
	 * @param rotationSensibility 回転感度
	 */
	virtual void setRotationSensibility(float rotationSensibility){
		rotationSensibility_ = rotationSensibility;
	}

	/**
	 * 回転感度の取得
	 * @return 回転感度
	 */
	virtual float getRotationSensibility() const{ return rotationSensibility_; }

	//--------------------------------------------------------------------------
	/**
	 * 移動感度の設定
	 * @param translationSensibility 移動感度
	 */
	virtual void setTranslationSensibility(float translationSensibility){
		translationSensibility_ = translationSensibility;
	}

	/**
	 * 移動感度の取得
	 * @return 移動感度
	 */
	virtual float getTranslationSensibility() const{
		return translationSensibility_;
	}

	//--------------------------------------------------------------------------
	/**
	 * 画角感度の設定
	 * @param fovYSensibility 画角感度
	 */
	virtual void setFovYSensibility(float fovYSensibility){
		fovYSensibility_ = fovYSensibility;
	}

	/**
	 * 画角感度の取得
	 * @return 画角感度
	 */
	virtual float getFovYSensibility() const{ return fovYSensibility_; }

	//--------------------------------------------------------------------------
	/**
	 * ジョイスティックの設定
	 * @param joystick 設定するPS2互換ジョイスティック
	 * @return 成功すればtrue
	 */
	virtual bool setJoystick(Joystick* joystick);

	/**
	 * ジョイスティックの取得
	 * @return ジョイスティック
	 */
	virtual Joystick* getJoystick();

	/**
	 * ジョイスティックの検索
	 * @return 見つかったジョイスティック。無ければNULL。
	 */
	virtual Joystick* searchJoystick();

protected:
	//--------------------------------------------------------------------------
	/// カメラ
	Camera* camera_;
	/// パッド
	PS2Pad* pad_;
	/// 回転感度
	float rotationSensibility_;
	/// 移動感度
	float translationSensibility_;
	/// 画角感度
	float fovYSensibility_;
	/// 移動モード
	bool moveMode_;

private:
	// コピーコンストラクタの隠蔽
	PS2PadCameraController(const PS2PadCameraController& copy);

	// 代入コピーの隠蔽
	void operator =(const PS2PadCameraController& copy);

};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of PS2_PAD_CAMERA_CONTROLLER_H_
//------------------------------------------------------------------------------
