WasdController QML Type
Control node position and orientation with keys and mouse. More...
| Import Statement: | import QtQuick3D.Helpers 1.0 |
Properties
- 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
Detailed Description
This helper allows the user to control a node using W, A, S, D, the arrow keys, and the mouse. Usually the controlled node is a Camera, specified in the controlledObject property.
Adding a WasdController can be highly useful both in applications that wish to provide a standard way of navigating the scene, and also as a temporary measure during development and troubleshooting, as it allows inspecting the scene at run time via familiar keyboard and mouse navigation.
The key bindings are as follows:
Worup- go forwardSordown- go backwardAorleft- strafe leftDorright- strafe rightRorpage up- move upForpage down- move downshifttogether with other keys - move faster, depending on shiftSpeed
The following snippet shows how a WasdController object can be added. By default both key and mouse based navigation is active, so in most cases there is no further configuration needed:
View3D {
anchors.fill: parent
camera: camera
PerspectiveCamera {
id: camera
position: Qt.vector3d(0, 0, 600)
}
...
}
WasdController {
controlledObject: camera
}
Property Documentation
Specifies the buttons accepted by the controller.
See also DragHandler and MultiPointHandler.
controlledObject : QtQuick3D::Node |
Specifies the node to control. This is typically a Camera object.
This property is true when there are inputs needing processing.