[ui] Viewer3D: TransformGizmo - add picking and transformations

- For now, transformations do not take well in count the orientation of the mouse but gizmo is functional.
This commit is contained in:
Julien-Haudegond 2020-07-06 17:10:54 +02:00
parent 30004fe690
commit 45fae981ba
2 changed files with 144 additions and 7 deletions

View file

@ -0,0 +1,30 @@
import Qt3D.Core 2.0
import Qt3D.Render 2.9
import Qt3D.Input 2.0
import Qt3D.Extras 2.10
import QtQuick 2.9
import Qt3D.Logic 2.0
ObjectPicker {
id: root
hoverEnabled: true
property bool isPressed : false
signal pickedChanged(bool picked)
onPressed: {
root.isPressed = true
pickedChanged(true)
mouseHandler.currentPosition = mouseHandler.lastPosition = pick.position
}
onEntered: {
material.ambient = "white"
}
onExited: {
if(!isPressed) material.ambient = baseColor
}
onReleased: {
material.ambient = baseColor
root.isPressed = false
pickedChanged(false)
}
}