WasdController QML Type
キーとマウスでノードの位置と向きを制御します。詳細...
| Import Statement: | import QtQuick3D.Helpers |
| Inherits: |
プロパティ
- acceptedButtons : enumeration
- backSpeed : real
- controlledObject : QtQuick3D::Node
- downSpeed : real
- forwardSpeed : real
- inputsNeedProcessing : bool
- keysEnabled : bool
- leftSpeed : real
- mouseEnabled : bool
- rightSpeed : real
- shiftSpeed : real
- speed : real
- upSpeed : real
- xInvert : bool
- xSpeed : real
- yInvert : bool
- ySpeed : real
詳しい説明
このヘルパーを使うと、W、A、S、D、矢印キー、マウスを使ってノードを操作することができます。通常、制御されるノードは Camera で、controlledObject プロパティで指定します。
WasdControllerを追加すると、シーンをナビゲートする標準的な方法を提供したいアプリケーションや、開発中やトラブルシューティング中の一時的な手段として、使い慣れたキーボードやマウスナビゲーションで実行時にシーンを検査できるため、非常に便利です。
キーバインディングは以下の通り:
Worup- 前進Sまたはdown- 後進Aまたはleft- 左にそれるDまたはright- 右に移動Rまたはpage up- 上へ移動Fまたはpage down- 下に移動shift他のキーと併用することで、より速く移動することができます。shiftSpeed
次のスニペットは、WasdControllerオブジェクトを追加する方法を示しています。デフォルトでは、キーとマウスの両方が有効になっているので、ほとんどの場合、これ以上の設定は必要ありません:
View3D {
anchors.fill: parent
camera: camera
PerspectiveCamera {
id: camera
position: Qt.vector3d(0, 0, 600)
}
...
}
WasdController {
controlledObject: camera
}プロパティドキュメント
acceptedButtons : enumeration [default: Qt.LeftButton]
コントローラが受け付けるボタンを指定する。
DragHandler およびMultiPointHandlerも参照 。
backSpeed : real [default: 5]
バックキーを押したときのナビゲーションの速度を指定する。
controlledObject : QtQuick3D::Node
制御するノードを指定します。これは通常Cameraオブジェクトです。
downSpeed : real [default: 5]
ダウンキーを押したときのナビゲーションの速度を指定する。
forwardSpeed : real [default: 5]
前進キーが押されたときのナビゲーションの速度を指定する。
inputsNeedProcessing : bool [read-only]
このプロパティは、処理が必要な入力がある場合に真となる。
keysEnabled : bool [default: true]
キーコントロールを有効にする。
leftSpeed : real [default: 5]
左キーを押したときのナビゲーションの速度を指定する。
mouseEnabled : bool [default: true]
マウス操作を有効にする。
rightSpeed : real [default: 5]
右キーを押したときのナビゲーションの速度を指定する。
shiftSpeed : real [default: 3]
シフトキーが押されたときに有効になる速度倍率を指定する。
speed : real [default: 1]
ナビゲーションの速度を指定する。
upSpeed : real [default: 5]
アップキーを押したときのナビゲーションの速度を指定する。
xInvert : bool [default: false]
X軸コントロールを反転する。
xSpeed : real [default: 0.1]
X軸に沿ってマウスを動かしたときのナビゲーションの速度を指定する。
yInvert : bool [default: true]
Y軸コントロールを反転させる。
ySpeed : real [default: 0.1]
Y軸に沿ってマウスを動かしたときのナビゲーションの速度を指定する。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.