SceneConfiguration provides a way of conveniently specifying information about a glTF2 file and accompanying helpers to be loaded. More...
Header: | #include <SceneConfiguration> |
Since: | Kuesa 1.3 |
Instantiated By: | SceneConfiguration |
Inherits: | Kuesa::KuesaNode |
This class was introduced in Kuesa 1.3.
QUrl | source() const |
void | setSource(const QUrl &source) |
void | sourceChanged(const QUrl &source) |
SceneConfiguration provides a way of conveniently specifying information about a glTF2 file and accompanying helpers to be loaded.
When building an application that should display different scenes at different moments in time, recreating a new Qt 3D view with its FrameGraph, Kuesa::GLTF2Importer and other assets can be costly and unnecessary. Yet, that approach is still often favored as it can be seen as more convenient for the developer from an architecture point of view.
The KuesaUtils::SceneConfiguration used in conjunction with KuesaUtils::View3DScene provides a new way to architecture such type of applications. The idea is to instantiate the View3DScene once and use its KuesaUtils::View3DScene::activeScene property to point to different KuesaUtils::SceneConfiguration instances. Internally, when the active scene is changed, the new glTF2 file will be loaded and assets needed created while previous glTF2 file and assets unloaded.
The signals KuesaUtils::SceneConfiguration::loadingDone and KuesaUtils::SceneConfiguration::unloadingDone can be used to watch which state the SceneConfiguration is in and react accordingly.
KuesaUtils::SceneConfiguration can also specify different viewports for showing different parts of a glTF2 scene at the same moment in time. This is done by adding or removing KuesaUtils::ViewConfiguration.