Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Lamp::Joystick Class Reference

ジョイスティック More...

`#include <Joystick.h>`

Inheritance diagram for Lamp::Joystick:

List of all members.

## Public Member Functions
virtual int | getAxisCount () const
| 軸数の取得
virtual int | getAxisCountWithoutSlider () const
| スライダ以外の軸数取得
virtual bool | hasAxis (Axis axis) const
| 軸を持つか
virtual float | getAxis (Axis axis) const
| 軸の値取得
virtual bool | hasXAxis () const
| X軸を持つか.
virtual float | getXAxis () const
| X軸の取得.
virtual float | getPreXAxis () const
| 前回のX軸の取得
virtual bool | hasYAxis () const
| Y軸を持つか.
virtual float | getYAxis () const
| Y軸の取得.
virtual float | getPreYAxis () const
| 前回のY軸の取得
virtual bool | hasZAxis () const
| Z軸を持つか.
virtual float | getZAxis () const
| Z軸の取得.
virtual float | getPreZAxis () const
| 前回のZ軸の取得
virtual bool | hasXRotation () const
| X回転を持つか.
virtual float | getXRotation () const
| X回転の取得.
virtual float | getPreXRotation () const
| 前回のX回転の取得
virtual bool | hasYRotation () const
| Y回転を持つか.
virtual float | getYRotation () const
| Y回転の取得.
virtual float | getPreYRotation () const
| 前回のY回転の取得
virtual bool | hasZRotation () const
| Z回転を持つか.
virtual float | getZRotation () const
| Z回転の取得.
virtual float | getPreZRotation () const
| 前回のZ回転の取得
virtual int | getPOVCount () const
| 視点コントローラ数の取得
virtual int | getPOV (int id) const
| 視点コントローラ値の取得
virtual int | getPrePOV (int id) const
| 前回の視点コントローラ値の取得
virtual bool | isPOVCenter (int id) const
| 視点コントローラが中心か
virtual int | getSliderCount () const
| スライダ数の取得
virtual float | getSlider (int id) const
| スライダ値の取得
virtual int | getButtonCount () const
| ボタン数の取得
virtual bool | buttonPressed (int id) const
| ボタンが押されているか
virtual bool | buttonDown (int id) const
| ボタンが下がった
virtual bool | buttonUp (int id) const
| ボタンが上がった
virtual String | getName () const
| 名前の取得
virtual bool | isAttached () const
| アタッチされているか
virtual bool | isPolled () const
| ポーリングが必要か
virtual String | toString () const
| 文字列への変換
virtual void | clear ()
| クリア
virtual bool | setCooperativeLevel (bool exclusive, bool foreground)
| 協調レベルの設定
virtual bool | isExclusive () const
| 排他モードか
virtual bool | isForeground () const
| フォアグラウンドモードか
## Static Public Attributes
const int | maxPOVCount = JoystickState::maxPOVCount
| 最大視点コントローラ数
const int | maxSliderCount = JoystickState::maxSliderCount
| 最大スライダ数
const int | maxButtonCount = JoystickState::maxButtonCount
| 最大ボタン数
const int | maxAxisValue = JoystickState::maxAxisValue
| 軸データ最大値
const int | minAxisValue = JoystickState::minAxisValue
| 軸データ最小値
const int | maxPOVValue = JoystickState::maxPOVValue
| 視点コントローラ最大値
## Protected Member Functions
| Joystick (JoystickDevice *device)
| コンストラクタ
virtual | ~Joystick ()
| デストラクタ
virtual void | setNextState (const JoystickState &state)
| 次のステート設定
virtual const JoystickState & | getState ()
| ステートの取得
virtual float | correctAxisValue (int axisValue) const
| 軸補正
virtual float | correctSliderValue (int sliderValue) const
| スライダ補正
## Friends
class | LampInput
class | BufferedInput

## Detailed Description

ジョイスティック

Definition at line 38 of file Joystick.h.

## Constructor & Destructor Documentation

Lamp::Joystick::Joystick | ( | JoystickDevice * | device | ) | `[protected]`

  | コンストラクタ Parameters:
  device | デバイス
Definition at line 32 of file Joystick.cpp.

## Member Function Documentation

virtual bool Lamp::Joystick::buttonDown | ( | int | id | ) | const`[inline, virtual]`

  | ボタンが下がった Parameters:
  id | ボタンID
Returns: ボタンが下がったならばtrue Definition at line 327 of file Joystick.h. References Lamp::JoystickState::buttonPressed(). Referenced by Lamp::SFPad::buttonDown(), Lamp::PS2Pad::buttonDown(), and toString().

virtual bool Lamp::Joystick::buttonPressed | ( | int | id | ) | const`[inline, virtual]`

  | ボタンが押されているか Parameters:
  id | 対象ボタンID
Returns: ボタンが押されていればtrue Definition at line 318 of file Joystick.h. References Lamp::JoystickState::buttonPressed(). Referenced by Lamp::SFPad::buttonPressed(), Lamp::PS2Pad::buttonPressed(), and toString().

virtual bool Lamp::Joystick::buttonUp | ( | int | id | ) | const`[inline, virtual]`

  | ボタンが上がった Parameters:
  id | ボタンID
Returns: ボタンが上がったならばtrue Definition at line 336 of file Joystick.h. References Lamp::JoystickState::buttonPressed(). Referenced by Lamp::SFPad::buttonUp(), Lamp::PS2Pad::buttonUp(), and toString().

virtual float Lamp::Joystick::correctAxisValue | ( | int | axisValue | ) | const`[inline, protected, virtual]`

  | 軸補正 Parameters:
  axisValue | 補正する値
Returns: 補正された値 Definition at line 425 of file Joystick.h. References maxAxisValue. Referenced by getPreXAxis(), getPreXRotation(), getPreYAxis(), getPreYRotation(), getPreZAxis(), getPreZRotation(), getXAxis(), getXRotation(), getYAxis(), getYRotation(), getZAxis(), and getZRotation().

virtual float Lamp::Joystick::correctSliderValue | ( | int | sliderValue | ) | const`[inline, protected, virtual]`

  | スライダ補正 Parameters:
  sliderValue | 補正する値
Returns: 補正された値 Definition at line 434 of file Joystick.h. References maxAxisValue. Referenced by getSlider().

virtual float Lamp::Joystick::getAxis | ( | Axis | axis | ) | const`[inline, virtual]`

| 軸の値取得 Returns: 軸の値 Definition at line 103 of file Joystick.h. References Assert, getSlider(), getXAxis(), getXRotation(), getYAxis(), getYRotation(), getZAxis(), and getZRotation().

virtual int Lamp::Joystick::getAxisCount | ( |  | ) | const`[inline, virtual]`

| 軸数の取得 Returns: 軸数 Definition at line 70 of file Joystick.h. References Lamp::InputDevice::getAxisCount(). Referenced by toString().

virtual int Lamp::Joystick::getAxisCountWithoutSlider | ( |  | ) | const`[inline, virtual]`

| スライダ以外の軸数取得 Returns: スライダ以外の軸数 Definition at line 76 of file Joystick.h. References Lamp::InputDevice::getAxisCount(), and Lamp::JoystickDevice::getSliderCount().

virtual int Lamp::Joystick::getButtonCount | ( |  | ) | const`[inline, virtual]`

| ボタン数の取得 Returns: ボタン数 Definition at line 311 of file Joystick.h. References Lamp::InputDevice::getButtonCount(). Referenced by Lamp::SFPad::checkCompatibility(), Lamp::PS2Pad::checkCompatibility(), Lamp::SFPad::SFPad(), and toString().

virtual String Lamp::Joystick::getName | ( |  | ) | const`[inline, virtual]`

| 名前の取得 Returns: 名前 Definition at line 345 of file Joystick.h. References Lamp::InputDevice::getProductName(). Referenced by Lamp::Pad::getName(), and toString().

virtual int Lamp::Joystick::getPOV | ( | int | id | ) | const`[inline, virtual]`

  | 視点コントローラ値の取得 Parameters:
  id | 視点コントローラID
Returns: 視点コントローラ値 Definition at line 268 of file Joystick.h. References Lamp::JoystickState::getPOV(). Referenced by Lamp::PS2Pad::downKeyDown(), Lamp::PS2Pad::downKeyPressed(), Lamp::PS2Pad::downKeyUp(), Lamp::PS2Pad::leftKeyDown(), Lamp::PS2Pad::leftKeyPressed(), Lamp::PS2Pad::leftKeyUp(), Lamp::PS2Pad::rightKeyDown(), Lamp::PS2Pad::rightKeyPressed(), Lamp::PS2Pad::rightKeyUp(), toString(), Lamp::PS2Pad::upKeyDown(), Lamp::PS2Pad::upKeyPressed(), and Lamp::PS2Pad::upKeyUp().

virtual int Lamp::Joystick::getPOVCount | ( |  | ) | const`[inline, virtual]`

| 視点コントローラ数の取得 Returns: 視点コントローラ数 Definition at line 261 of file Joystick.h. References Lamp::JoystickDevice::getPOVCount(). Referenced by Lamp::PS2Pad::checkCompatibility(), Lamp::PS2Pad::PS2Pad(), and toString().

virtual int Lamp::Joystick::getPrePOV | ( | int | id | ) | const`[inline, virtual]`

  | 前回の視点コントローラ値の取得 Parameters:
  id | 視点コントローラID
Returns: 視点コントローラ値 Definition at line 275 of file Joystick.h. References Lamp::JoystickState::getPOV(). Referenced by Lamp::PS2Pad::downKeyDown(), Lamp::PS2Pad::downKeyUp(), Lamp::PS2Pad::leftKeyDown(), Lamp::PS2Pad::leftKeyUp(), Lamp::PS2Pad::rightKeyDown(), Lamp::PS2Pad::rightKeyUp(), Lamp::PS2Pad::upKeyDown(), and Lamp::PS2Pad::upKeyUp().

virtual float Lamp::Joystick::getPreXAxis | ( |  | ) | const`[inline, virtual]`

| 前回のX軸の取得 Returns: 1から-1の値をとるX軸 Definition at line 135 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getXAxis(). Referenced by Lamp::SFPad::leftKeyDown(), Lamp::SFPad::leftKeyUp(), Lamp::SFPad::rightKeyDown(), and Lamp::SFPad::rightKeyUp().

virtual float Lamp::Joystick::getPreXRotation | ( |  | ) | const`[inline, virtual]`

| 前回のX回転の取得 Returns: 1から-1の値をとるX回転 Definition at line 204 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getXRotation().

virtual float Lamp::Joystick::getPreYAxis | ( |  | ) | const`[inline, virtual]`

| 前回のY軸の取得 Returns: 1から-1の値をとるY軸 Definition at line 158 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getYAxis(). Referenced by Lamp::SFPad::downKeyDown(), Lamp::SFPad::downKeyUp(), Lamp::SFPad::upKeyDown(), and Lamp::SFPad::upKeyUp().

virtual float Lamp::Joystick::getPreYRotation | ( |  | ) | const`[inline, virtual]`

| 前回のY回転の取得 Returns: 1から-1の値をとるY回転 Definition at line 227 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getYRotation().

virtual float Lamp::Joystick::getPreZAxis | ( |  | ) | const`[inline, virtual]`

| 前回のZ軸の取得 Returns: 1から-1の値をとるZ軸 Definition at line 181 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getZAxis().

virtual float Lamp::Joystick::getPreZRotation | ( |  | ) | const`[inline, virtual]`

| 前回のZ回転の取得 Returns: 1から-1の値をとるZ回転 Definition at line 250 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getZRotation().

virtual float Lamp::Joystick::getSlider | ( | int | id | ) | const`[inline, virtual]`

  | スライダ値の取得 Parameters:
  id | スライダID
Returns: 1から-1の値をとるスライダ値 Definition at line 300 of file Joystick.h. References correctSliderValue(), and Lamp::JoystickState::getSlider(). Referenced by getAxis(), and toString().

virtual int Lamp::Joystick::getSliderCount | ( |  | ) | const`[inline, virtual]`

| スライダ数の取得 Returns: スライダ数 Definition at line 293 of file Joystick.h. References Lamp::JoystickDevice::getSliderCount(). Referenced by hasAxis(), and toString().

virtual const JoystickState& Lamp::Joystick::getState | ( |  | ) | `[inline, protected, virtual]`

| ステートの取得 Returns: ステート Definition at line 418 of file Joystick.h.

virtual float Lamp::Joystick::getXAxis | ( |  | ) | const`[inline, virtual]`

| X軸の取得. Returns: 1から-1の値をとるX軸 Definition at line 127 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getXAxis(). Referenced by getAxis(), Lamp::PS2Pad::getLeftXAxis(), Lamp::SFPad::getXAxis(), Lamp::SFPad::leftKeyDown(), Lamp::SFPad::leftKeyPressed(), Lamp::SFPad::leftKeyUp(), Lamp::SFPad::rightKeyDown(), Lamp::SFPad::rightKeyPressed(), Lamp::SFPad::rightKeyUp(), and toString().

virtual float Lamp::Joystick::getXRotation | ( |  | ) | const`[inline, virtual]`

| X回転の取得. Returns: 1から-1の値をとるX回転 Definition at line 196 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getXRotation(). Referenced by getAxis(), and toString().

virtual float Lamp::Joystick::getYAxis | ( |  | ) | const`[inline, virtual]`

| Y軸の取得. Returns: 1から-1の値をとるY軸 Definition at line 150 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getYAxis(). Referenced by Lamp::SFPad::downKeyDown(), Lamp::SFPad::downKeyPressed(), Lamp::SFPad::downKeyUp(), getAxis(), Lamp::PS2Pad::getLeftYAxis(), Lamp::SFPad::getYAxis(), toString(), Lamp::SFPad::upKeyDown(), Lamp::SFPad::upKeyPressed(), and Lamp::SFPad::upKeyUp().

virtual float Lamp::Joystick::getYRotation | ( |  | ) | const`[inline, virtual]`

| Y回転の取得. Returns: 1から-1の値をとるY回転 Definition at line 219 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getYRotation(). Referenced by getAxis(), and toString().

virtual float Lamp::Joystick::getZAxis | ( |  | ) | const`[inline, virtual]`

| Z軸の取得. Returns: 1から-1の値をとるZ軸 Definition at line 173 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getZAxis(). Referenced by getAxis(), Lamp::PS2Pad::getRightXAxis(), Lamp::PS2Pad::getRightYAxis(), and toString().

virtual float Lamp::Joystick::getZRotation | ( |  | ) | const`[inline, virtual]`

| Z回転の取得. Returns: 1から-1の値をとるZ回転 Definition at line 242 of file Joystick.h. References correctAxisValue(), and Lamp::JoystickState::getZRotation(). Referenced by getAxis(), Lamp::PS2Pad::getRightXAxis(), Lamp::PS2Pad::getRightYAxis(), and toString().

virtual bool Lamp::Joystick::hasAxis | ( | Axis | axis | ) | const`[inline, virtual]`

  | 軸を持つか Parameters:
  axis | 軸
Returns: 軸を持っていればture Definition at line 86 of file Joystick.h. References Assert, getSliderCount(), hasXAxis(), hasXRotation(), hasYAxis(), hasYRotation(), hasZAxis(), and hasZRotation().

virtual bool Lamp::Joystick::hasXAxis | ( |  | ) | const`[inline, virtual]`

| X軸を持つか. Returns: X軸を持てばtrue Definition at line 121 of file Joystick.h. References Lamp::JoystickDevice::hasXAxis(). Referenced by Lamp::SFPad::checkCompatibility(), Lamp::PS2Pad::checkCompatibility(), hasAxis(), and toString().

virtual bool Lamp::Joystick::hasXRotation | ( |  | ) | const`[inline, virtual]`

| X回転を持つか. Returns: X回転を持てばtrue Definition at line 190 of file Joystick.h. References Lamp::JoystickDevice::hasXRotation(). Referenced by hasAxis(), and toString().

virtual bool Lamp::Joystick::hasYAxis | ( |  | ) | const`[inline, virtual]`

| Y軸を持つか. Returns: Y軸を持てばtrue Definition at line 144 of file Joystick.h. References Lamp::JoystickDevice::hasYAxis(). Referenced by Lamp::SFPad::checkCompatibility(), Lamp::PS2Pad::checkCompatibility(), hasAxis(), and toString().

virtual bool Lamp::Joystick::hasYRotation | ( |  | ) | const`[inline, virtual]`

| Y回転を持つか. Returns: Y回転を持てばtrue Definition at line 213 of file Joystick.h. References Lamp::JoystickDevice::hasYRotation(). Referenced by hasAxis(), and toString().

virtual bool Lamp::Joystick::hasZAxis | ( |  | ) | const`[inline, virtual]`

| Z軸を持つか. Returns: Z軸を持てばtrue Definition at line 167 of file Joystick.h. References Lamp::JoystickDevice::hasZAxis(). Referenced by Lamp::PS2Pad::checkCompatibility(), hasAxis(), and toString().

virtual bool Lamp::Joystick::hasZRotation | ( |  | ) | const`[inline, virtual]`

| Z回転を持つか. Returns: Z回転を持てばtrue Definition at line 236 of file Joystick.h. References Lamp::JoystickDevice::hasZRotation(). Referenced by Lamp::PS2Pad::checkCompatibility(), hasAxis(), and toString().

virtual bool Lamp::Joystick::isAttached | ( |  | ) | const`[inline, virtual]`

| アタッチされているか Returns: アタッチされていればtrue Definition at line 351 of file Joystick.h. References Lamp::InputDevice::isAttached(). Referenced by Lamp::Pad::isAttached(), and toString().

virtual bool Lamp::Joystick::isExclusive | ( |  | ) | const`[inline, virtual]`

| 排他モードか Returns: 排他モードならtrue Definition at line 387 of file Joystick.h. References Lamp::InputDevice::isExclusive(). Referenced by Lamp::Pad::isExclusive().

virtual bool Lamp::Joystick::isForeground | ( |  | ) | const`[inline, virtual]`

| フォアグラウンドモードか Returns: フォアグラウンドモードならtrue、バックグラウンドモードならfalse Definition at line 393 of file Joystick.h. References Lamp::InputDevice::isForeground(). Referenced by Lamp::Pad::isForeground().

virtual bool Lamp::Joystick::isPolled | ( |  | ) | const`[inline, virtual]`

| ポーリングが必要か Returns: ポーリングが必要ならtrue Definition at line 357 of file Joystick.h. References Lamp::InputDevice::isPolled(). Referenced by toString().

virtual bool Lamp::Joystick::isPOVCenter | ( | int | id | ) | const`[inline, virtual]`

  | 視点コントローラが中心か Parameters:
  id | 視点コントローラID
Returns: 視点コントローラが中心ならtrue Definition at line 282 of file Joystick.h. References Lamp::JoystickState::getPOV(). Referenced by toString().

virtual bool Lamp::Joystick::setCooperativeLevel | ( | bool | exclusive,
|  | bool | foreground
| ) | `[inline, virtual]`

  | 協調レベルの設定 Parameters:
  exclusive | 排他モードならtrue
  foreground | フォアグラウンドモードならtrue
Returns: 成功すればtrue Definition at line 379 of file Joystick.h. References Lamp::InputDevice::setCooperativeLevel(). Referenced by Lamp::Pad::setCooperativeLevel().

void Lamp::Joystick::setNextState | ( | const JoystickState & | state | ) | `[protected, virtual]`

  | 次のステート設定 Parameters:
  state | 次のステート
Definition at line 40 of file Joystick.cpp.

String Lamp::Joystick::toString | ( |  | ) | const`[virtual]`

| 文字列への変換 Returns: 文字列 Definition at line 46 of file Joystick.cpp. References buttonDown(), buttonPressed(), buttonUp(), Lamp::String::format(), getAxisCount(), getButtonCount(), getName(), getPOV(), getPOVCount(), getSlider(), getSliderCount(), getXAxis(), getXRotation(), getYAxis(), getYRotation(), getZAxis(), getZRotation(), hasXAxis(), hasXRotation(), hasYAxis(), hasYRotation(), hasZAxis(), hasZRotation(), isAttached(), isPolled(), and isPOVCenter().

The documentation for this class was generated from the following files:

- Joystick.h
- Joystick.cpp