KuesaUtils::View3DScene¶
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...
#include <view3dscene.h>
Inherits from Kuesa::Qt3D::SceneEntity, Qt3DCore::QEntity
Public Slots¶
Name | |
---|---|
void | setShowDebugOverlay(bool showDebugOverlay) |
void | setScreenSize(const QSize & screenSize) |
void | setAsynchronous(bool asynchronous) |
void | setReflectionPlaneName(const QString & reflectionPlaneName) |
void | setActiveScene(SceneConfiguration * scene) Sets the active scene configuration to scene. If scene is a valid non null instance, the [View3DScene::source ],. |
void | adoptNode(QObject * object) |
void | start() Starts all the AnimationPlayer instances referenced by the View3DScene instance. |
void | restart() Restarts all the AnimationPlayer instances referenced by the View3DScene instance. |
void | stop() Stops all the AnimationPlayer instances referenced by the View3DScene instance. |
void | gotoNormalizedTime(float time) Set the normalized time of all the AnimationPlayer instances referenced by the View3DScene instance to time. |
void | gotoStart() Set the normalized time of all the AnimationPlayer instances referenced by the View3DScene instance to 0. |
void | gotoEnd() Set the normalized time of all the AnimationPlayer instances referenced by the View3DScene instance to 1. |
Public Signals¶
Name | |
---|---|
void | sourceChanged(const QUrl & source) |
void | cameraNameChanged(const QString & cameraName) |
void | showDebugOverlayChanged(bool showDebugOverlay) |
void | screenSizeChanged(const QSize & screenSize) |
void | readyChanged(bool ready) |
void | loadedChanged(bool loaded) |
void | asynchronousChanged(bool asynchronous) |
void | activeSceneChanged(SceneConfiguration * activeScene) |
void | reflectionPlaneNameChanged(const QString & reflectionPlaneName) |
Public Functions¶
Name | |
---|---|
View3DScene(Qt3DCore::QNode * parent =nullptr) | |
~View3DScene() | |
Kuesa::Qt3D::GLTF2Importer * | importer() const |
Kuesa::Qt3D::ForwardRenderer * | frameGraph() const |
Qt3DRender::QRenderSettings * | renderSettings() const |
QUrl | source() const |
bool | showDebugOverlay() const |
QSize | screenSize() const |
bool | asynchronous() const |
QString | reflectionPlaneName() const |
const std::vector< Kuesa::Qt3D::AnimationPlayer * > & | animationPlayers() const Returns the AnimationPlayer instances referenced by the View3DScene instance. |
SceneConfiguration * | activeScene() const |
bool | isReady() const |
bool | isLoaded() const |
Public Properties¶
Name | |
---|---|
Kuesa::Qt3D::GLTF2Importer * | importer Points to the GLTF2Importer instance wrapped around by the View3DScene. |
Kuesa::Qt3D::ForwardRenderer * | frameGraph Points to the ForwardRenderer frame graph instance wrapped around by the View3DScene. |
Qt3DRender::QRenderSettings * | renderSettings Points to the. |
QUrl | source The source of the glTF file to be loaded. \readonly. |
bool | showDebugOverlay Specifies whether the Qt 3D debug overlay should be displayed. |
QSize | screenSize Holds the size in pixels of the rendered area. When set, this automatically updates the TransformTracker instances referenced by the View3DScene with the new value for proper coodinate projection. |
bool | ready 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. |
bool | loaded This is true once the glTF file has been properly loaded. The scene might not be visible on screen when this becomes true. |
bool | asynchronous If true, glTF parsing is performed in a non blocking manner from a secondary thread. This is false by default. |
KuesaUtils::SceneConfiguration * | activeScene If this points to a valid SceneConfiguration instance, the View3DScene::source ,. |
QString | reflectionPlaneName If non empty, the View3DScene will try to load the. |
Additional inherited members¶
Public Signals inherited from Kuesa::Qt3D::SceneEntity
Name | |
---|---|
void | loadingDone() |
Public Functions inherited from Kuesa::Qt3D::SceneEntity
Name | |
---|---|
SceneEntity(Qt3DCore::QNode * parent =nullptr) | |
~SceneEntity() | |
AnimationClipCollection * | animationClips() const |
Q_INVOKABLE Qt3DAnimation::QAbstractAnimationClip * | animationClip(const QString & name) const |
ArmatureCollection * | armatures() const |
Q_INVOKABLE Qt3DCore::QArmature * | armature(const QString & name) const |
EffectCollection * | effects() const |
Q_INVOKABLE Qt3DRender::QEffect * | effect(const QString & name) const |
Q_INVOKABLE Qt3DRender::QEffect * | effect(int effectPropertyFlags) const |
LayerCollection * | layers() const |
Q_INVOKABLE Qt3DRender::QLayer * | layer(const QString & name) const |
MaterialCollection * | materials() const |
Q_INVOKABLE Kuesa::Qt3D::GLTF2MaterialProperties * | material(const QString & name) const |
MeshCollection * | meshes() const |
Q_INVOKABLE Qt3DRender::QGeometryRenderer * | mesh(const QString & name) const |
SkeletonCollection * | skeletons() const |
Q_INVOKABLE Qt3DCore::QAbstractSkeleton * | skeleton(const QString & name) const |
TextureCollection * | textures() const |
Q_INVOKABLE Qt3DRender::QAbstractTexture * | texture(const QString & name) const |
CameraCollection * | cameras() const |
Q_INVOKABLE Qt3DRender::QCamera * | camera(const QString & name) const |
EntityCollection * | entities() const |
Q_INVOKABLE Qt3DCore::QEntity * | entity(const QString & name) const |
TransformCollection * | transforms() const |
Q_INVOKABLE Qt3DCore::QTransform * | transform(const QString & name) const |
PlaceholderCollection * | placeholders() const |
Q_INVOKABLE Kuesa::Qt3D::Placeholder * | placeholder(const QString & name) const |
TextureImageCollection * | textureImages() const |
Q_INVOKABLE Qt3DRender::QAbstractTextureImage * | textureImage(const QString & name) |
AnimationMappingCollection * | animationMappings() const |
Q_INVOKABLE Qt3DAnimation::QChannelMapper * | animationMapping(const QString & name) |
Q_INVOKABLE void | clearCollections() Removes all assets from all the collections. |
Q_INVOKABLE Qt3DCore::QNode * | transformForEntity(const QString & name) |
Q_INVOKABLE Qt3DRender::QAbstractTexture * | brdfLut() const SceneEntity::brdfLut Returns the brdfLut texture stored in the SceneEntity. |
Kuesa::Qt3D::LightCollection * | lights() const |
Q_INVOKABLE Qt3DRender::QAbstractLight * | light(const QString & name) const |
Kuesa::Qt3D::ReflectionPlaneCollection * | reflectionPlanes() const |
Q_INVOKABLE Kuesa::Qt3D::ReflectionPlane * | reflectionPlane(const QString & name) const |
Q_INVOKABLE Kuesa::Qt3D::SceneEntity * | findParentSceneEntity(Qt3DCore::QEntity * entity) |
Public Properties inherited from Kuesa::Qt3D::SceneEntity
Detailed Description¶
1 |
|
View3DScene is a convenience wrapper aiming at simplifying the set up of a 3D scene and the loading of a glTF 2 scene file.
Since: Kuesa 2.0
View3DScene 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 SceneEntity which grants access to the various asset collections. Aditionnaly it contains a
The property View3DScene::ready and signal
When used in conjunction with 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 SceneConfiguration must be set as the activeScene property.
Public Slots Documentation¶
slot setShowDebugOverlay¶
1 2 3 |
|
slot setScreenSize¶
1 2 3 |
|
slot setAsynchronous¶
1 2 3 |
|
slot setReflectionPlaneName¶
1 2 3 |
|
slot setActiveScene¶
1 2 3 |
|
Sets the active scene configuration to scene. If scene is a valid non null instance, the [View3DScene::source ],.
When switching between two SceneConfiguration instances, the collections, assets and gltf files are clear prior to being reloaded, even if both instances reference the same source file.
slot adoptNode¶
1 2 3 |
|
slot start¶
1 |
|
Starts all the AnimationPlayer instances referenced by the View3DScene instance.
See: View3DScene::stop, View3DScene::restart
slot restart¶
1 |
|
Restarts all the AnimationPlayer instances referenced by the View3DScene instance.
See: View3DScene::stop, View3DScene::start
slot stop¶
1 |
|
Stops all the AnimationPlayer instances referenced by the View3DScene instance.
See: View3DScene::start
slot gotoNormalizedTime¶
1 2 3 |
|
Set the normalized time of all the AnimationPlayer instances referenced by the View3DScene instance to time.
slot gotoStart¶
1 |
|
Set the normalized time of all the AnimationPlayer instances referenced by the View3DScene instance to 0.
slot gotoEnd¶
1 |
|
Set the normalized time of all the AnimationPlayer instances referenced by the View3DScene instance to 1.
Public Signals Documentation¶
signal sourceChanged¶
1 2 3 |
|
signal cameraNameChanged¶
1 2 3 |
|
signal showDebugOverlayChanged¶
1 2 3 |
|
signal screenSizeChanged¶
1 2 3 |
|
signal readyChanged¶
1 2 3 |
|
signal loadedChanged¶
1 2 3 |
|
signal asynchronousChanged¶
1 2 3 |
|
signal activeSceneChanged¶
1 2 3 |
|
signal reflectionPlaneNameChanged¶
1 2 3 |
|
Public Functions Documentation¶
function View3DScene¶
1 2 3 |
|
function ~View3DScene¶
1 |
|
function importer¶
1 |
|
function frameGraph¶
1 |
|
function renderSettings¶
1 |
|
function source¶
1 |
|
function showDebugOverlay¶
1 |
|
function screenSize¶
1 |
|
function asynchronous¶
1 |
|
function reflectionPlaneName¶
1 |
|
function animationPlayers¶
1 |
|
Returns the AnimationPlayer instances referenced by the View3DScene instance.
function activeScene¶
1 |
|
function isReady¶
1 |
|
function isLoaded¶
1 |
|
Public Property Documentation¶
property importer¶
1 |
|
Points to the GLTF2Importer instance wrapped around by the View3DScene.
property frameGraph¶
1 |
|
Points to the ForwardRenderer frame graph instance wrapped around by the View3DScene.
property renderSettings¶
1 |
|
Points to the.
property source¶
1 |
|
The source of the glTF file to be loaded. \readonly.
property showDebugOverlay¶
1 |
|
Specifies whether the Qt 3D debug overlay should be displayed.
Note: this only works when Qt is running with its OpenGL backend.
property screenSize¶
1 |
|
Holds the size in pixels of the rendered area. When set, this automatically updates the TransformTracker instances referenced by the View3DScene with the new value for proper coodinate projection.
property ready¶
1 |
|
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.
property loaded¶
1 |
|
This is true once the glTF file has been properly loaded. The scene might not be visible on screen when this becomes true.
property asynchronous¶
1 |
|
If true, glTF parsing is performed in a non blocking manner from a secondary thread. This is false by default.
property activeScene¶
1 |
|
If this points to a valid SceneConfiguration instance, the View3DScene::source ,.
property reflectionPlaneName¶
1 |
|
If non empty, the View3DScene will try to load the.
Updated on 2023-07-03 at 11:02:02 +0000