summaryrefslogtreecommitdiffstats
path: root/examples/qt3d
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-03-07 09:27:16 +0000
committerMike Krus <mike.krus@kdab.com>2020-04-23 10:46:06 +0100
commit60f42119fe5c341880f4576e0c9ad8d99ee277d5 (patch)
treee3a4992e501593c64ad506c13c0ddae87e9f5018 /examples/qt3d
parentee476605629a74fb824d3f014deb6e6be9e40e9f (diff)
Pull bounding volume info from front end
When an entity has a bounding QBoundingVolume component AND that has a QGeometryView, the bounding volume can be computed by the core aspect and the results get pulled to the render backend. Otherwise, we use the old code which computes the bounding volume in the render aspect. This means we have 2 jobs to compute bounding volumes and that the core version must complete before the render aspect runs. Change-Id: I4de45e48fa0c4d40d3d5084f387abfed5ea1a2f8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d')
-rw-r--r--examples/qt3d/scene3d/AnimatedEntity.qml6
-rw-r--r--examples/qt3d/scene3d/main.qml21
2 files changed, 26 insertions, 1 deletions
diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml
index 3e24dc785..962317a6b 100644
--- a/examples/qt3d/scene3d/AnimatedEntity.qml
+++ b/examples/qt3d/scene3d/AnimatedEntity.qml
@@ -48,7 +48,7 @@
**
****************************************************************************/
-import Qt3D.Core 2.0
+import Qt3D.Core 2.15
import Qt3D.Render 2.15
import Qt3D.Input 2.0
import Qt3D.Extras 2.15
@@ -60,6 +60,10 @@ Entity {
id: sceneRoot
property RenderCapabilities capabilities : renderSettings.renderCapabilities
+ property bool validBounds: sphereMesh.implicitPointsValid
+ property vector3d sphereMinPt: sphereMesh.implicitMinPoint
+ property vector3d sphereMaxPt: sphereMesh.implicitMaxPoint
+
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
diff --git a/examples/qt3d/scene3d/main.qml b/examples/qt3d/scene3d/main.qml
index 6d5617ca3..f7ba24ab4 100644
--- a/examples/qt3d/scene3d/main.qml
+++ b/examples/qt3d/scene3d/main.qml
@@ -151,6 +151,27 @@ Item {
}
}
+ Rectangle {
+ radius: 10
+ color: "#aaffffff"
+ border.width: 1
+ border.color: "black"
+ width: childrenRect.width + anchors.margins
+ height: childrenRect.height + anchors.margins
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.margins: 20
+ visible: rootEntity.validBounds
+
+ Column {
+ x: parent.anchors.margins / 2
+ y: x
+
+ Text { text: "Sphere:\n Min Extent: " + rootEntity.sphereMinPt }
+ Text { text: " Max Extent: " + rootEntity.sphereMaxPt }
+ }
+ }
+
SequentialAnimation {
id: animation