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を追加すると、シーンをナビゲートする標準的な方法を提供したいアプリケーションや、開発中やトラブルシューティング中の一時的な手段として、使い慣れたキーボードやマウスナビゲーションで実行時にシーンを検査できるため、非常に便利です。
キーバインディングは以下の通り:
W
or - 前進up
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 |
コントローラが受け付けるボタンを指定します。
DragHandler とMultiPointHandlerも参照してください 。
backSpeed : real |
バックキーが押されたときのナビゲーションの速度を指定します。
controlledObject : QtQuick3D::Node |
制御するノードを指定します。通常は Camera オブジェクトです。
downSpeed : real |
下キーが押されたときのナビゲーションの速度を指定します。
forwardSpeed : real |
進むキーが押されたときのナビゲーションの速度を指定します。
inputsNeedProcessing : bool |
このプロパティは、処理が必要な入力がある場合に真になります。
keysEnabled : bool |
キーコントロールを有効にします。デフォルト値はtrueである。
leftSpeed : real |
左キーが押されたときのナビゲーションの速度を指定する。
mouseEnabled : bool |
マウスコントロールを有効にします。デフォルト値はtrue。
rightSpeed : real |
右キーを押したときの移動速度を指定する。
shiftSpeed : real |
シフトキー押下時の速度倍率を指定します。
speed : real |
ナビゲーションの速度を指定します。
upSpeed : real |
上キーが押されたときのナビゲーションの速度を指定する。
xInvert : bool |
X軸コントロールを無効にする。デフォルト値はfalse。
xSpeed : real |
X軸に沿ってマウスを動かしたときのナビゲーションの速度を指定する。
yInvert : bool |
Y 軸コントロールを無効にする。デフォルト値はtrue。
ySpeed : real |
Y 軸に沿ってマウスを動かしたときのナビゲーションの速度を指定する。
© 2025 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.