2 * Copyright (C) 2016 The LibrePilot Project
3 * Contact: http://www.librepilot.org
5 * This file is part of LibrePilot GCS.
7 * LibrePilot GCS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * LibrePilot GCS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with LibrePilot GCS. If not, see <http://www.gnu.org/licenses/>.
21 import QtQuick.Controls 1.4
26 import "../js/common.js" as Utils
27 import "../js/uav.js" as UAV
38 manipulator: nodeTrackerManipulator
39 //incrementalCompile: true
44 logarithmicDepthBuffer: true
47 OSGNodeTrackerManipulator {
48 id: nodeTrackerManipulator
49 // use model to compute camera home position
50 sceneNode: modelTransformNode
51 // model will be tracked
52 trackNode: modelTransformNode
59 dateTime: Utils.getDateTime()
60 minimumAmbientLight: pfdContext.minimumAmbientLight
65 children: [ terrainFileNode, modelNode ]
71 sceneNode: terrainFileNode
72 children: [ modelTransformNode ]
76 position: UAV.position()
80 id: modelTransformNode
82 children: [ modelFileNode ]
84 // model dimensions are in mm, scale to meters
85 scale: Qt.vector3d(0.001, 0.001, 0.001)
86 attitude: UAV.attitude()
91 source: pfdContext.terrainFile
97 // use ShaderGen pseudoloader to generate the shaders expected by osgEarth
98 // see http://docs.osgearth.org/en/latest/faq.html#i-added-a-node-but-it-has-no-texture-lighting-etc-in-osgearth-why
99 source: pfdContext.modelFile + ".osgearth_shadergen"
101 optimizeMode: OptimizeMode.OptimizeAndCheck
105 pfdContext.nextModel();
108 Keys.onDownPressed: {
109 pfdContext.previousModel();
115 anchors.right: parent.right
116 anchors.top: parent.top
119 running: osgViewport.busy