[ui] Viewer3D: TransformGizmo - drawing gizmo on top of the object

- Special entity acting as an object container: we can add the entities we want to control with a gizmo inside it.
- Drawing the gizmo always on top of the object to make sure to see it every time.
This commit is contained in:
Julien-Haudegond 2020-07-09 10:56:25 +02:00
parent bdf9d74ec8
commit 85ebbba14f
4 changed files with 55 additions and 7 deletions

View file

@ -23,6 +23,8 @@ Entity {
property alias windowSize: trackball.windowSize
property alias trackballSize: trackball.trackballSize
property bool loseMouseFocus: false // Must be changed by other entities when they want to take mouse focus
readonly property alias pressed: mouseHandler._pressed
signal mousePressed(var mouse)
signal mouseReleased(var mouse, var moved)
@ -166,6 +168,8 @@ Entity {
components: [
FrameAction {
onTriggered: {
if(loseMouseFocus) return
if(panning) { // translate
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
var tx = axisMX.value * root.translateSpeed * d;