Kuesa Runtime

View3DScene QML Type

View3DScene is a convenience wrapper aiming at simplifying the set up of a 3D scene and the loading of a glTF 2 scene file. More...

Since: Kuesa 1.3
Instantiates: View3DScene

Properties

Detailed Description

View3D is a convenience wrapper aiming at simplifying the set up of a 3D scene and the loading of a glTF 2 scene file.

It is a subclass of Kuesa::SceneEntity which grants access to the various asset collections. Aditionnaly it contains a Kuesa::GLTF2Importer and sets up a Kuesa::ForwardRenderer framegraph.

The property KuesaUtils::View3DScene::ready and signal View3DScene::readyChanged can be used to detect when the scene is visible on screen and therefore synchronize with other aspect of your application.

When used in conjunction with KuesaUtils::SceneConfiguration this class makes it convenient to set up a Kuesa renderer that can easily load and unload scenes.

To set the scene to be loaded by the View3DScene, an instance of KuesaUtils::SceneConfiguration must be set as the activeScene property.

Kuesa::AnimationPlayer and Kuesa::TransformTracker instances defined on the activeScene will be added. Additionally, the View3DScene will take care of population the camera, screenSize and sceneEntity properties.

Furthermore, animation playback and control is abstracted by convenience methods on the View3DScene instance.

Property Documentation

If this points to a valid KuesaUtils::SceneConfiguration instance, the KuesaUtils::View3DScene::source, KuesaUtils::View3DScene::cameraName as well as the Kuesa::AnimationPlayer and Kuesa::TransformTracker instances will be automatically set based on the values provided by the SceneConfiguration. This offers a convenient way of specifying content when dealing with multiple scenes.


asynchronous : bool

If true, glTF parsing is performed in a non blocking manner from a secondary thread. This is false by default.


[read-only] cameraName : string

The name of the camera asset that should be used to view the scene. If the name references a valid camera, the camera will automatically be set on the ForwardRenderer frameGraph and other internal assets such as Kuesa::TransformTracker.


frameGraph : Kuesa::ForwardRenderer

Points to the Kuesa::ForwardRenderer frame graph instance wrapped around by the View3DScene.


Points to the Kuesa::GLTF2Importer instance wrapped around by the View3D.


layerNames : list<string>

The names of the layer assets that should be used to select objects to render in the scene. If the name references a valid layer, it will automatically be set on the ForwardRenderer frameGraph.


loaded : bool

This is true once the glTF file has been properly loaded. The scene might not be visible on screen when this becomes true.


ready : bool

This is true once the glTF file has been properly loaded and that Qt 3D GPU resources have been successfully loaded onto the GPU. The scene should be visible on screen when this becomes true.


reflectionPlaneName : string

If non empty, the View3DScene will try to load the Kuesa::ReflectionPlane matching the name from the collection and set it on the ForwardRenderer framegraph views.


renderSettings : Qt3DRender::QRenderSettings

Points to the Qt3DRender::QRenderSettings render settings instance wrapped around by the View3DScene.


screenSize : size

Holds the size in pixels of the rendered area. When set, this automatically updates the Kuesa::TransformTracker instances referenced by the View3D with the new value for proper coodinate projection.


showDebugOverlay : bool

Specifies whether the Qt 3D debug overlay should be displayed.

Note: this only works when Qt is running with its OpenGL backend.


[read-only] source : url

The source of the glTF file to be loaded.