mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 08:18:25 +02:00
[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:
parent
30004fe690
commit
45fae981ba
2 changed files with 144 additions and 7 deletions
30
meshroom/ui/qml/Viewer3D/TransformGizmoPicker.qml
Normal file
30
meshroom/ui/qml/Viewer3D/TransformGizmoPicker.qml
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue