Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSSGModelHelpers Class Reference

\inmodule QtQuick3D More...

#include <qssgrenderhelpers.h>

+ Collaboration diagram for QSSGModelHelpers:

Public Types

using MaterialList = QList<QSSGResourceId>
 

Static Public Member Functions

static void setModelMaterials (const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, MaterialList materials)
 Sets the materials to be used on model.
 
static void setModelMaterials (const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, MaterialList materials)
 Convenience function to apply materials to all models in the renderablesId set.
 
static QMatrix4x4 getGlobalTransform (const QSSGFrameData &frameData, QSSGNodeId model, QSSGPrepContextId prepId={})
 
static QMatrix4x4 getLocalTransform (const QSSGFrameData &frameData, QSSGNodeId model)
 
static float getGlobalOpacity (const QSSGFrameData &frameData, QSSGNodeId model)
 
static float getGlobalOpacity (const QSSGFrameData &frameData, QSSGNodeId model, QSSGPrepContextId prepId)
 
static float getLocalOpacity (const QSSGFrameData &frameData, QSSGNodeId model)
 
static void setGlobalTransform (const QSSGFrameData &frameData, QSSGRenderablesId prepId, QSSGNodeId model, const QMatrix4x4 &transform)
 Sets the global transform for model in the context of the renderablesId.
 
static void setGlobalOpacity (const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, float opacity)
 Sets the global opacity for model in the context of the renderablesId.
 

Detailed Description

\inmodule QtQuick3D

Since
6.7

Class containing helper functions for modifying and setting data for model renderables.

Definition at line 52 of file qssgrenderhelpers.h.

Member Typedef Documentation

◆ MaterialList

Member Function Documentation

◆ getGlobalOpacity() [1/2]

float QSSGModelHelpers::getGlobalOpacity ( const QSSGFrameData & frameData,
QSSGNodeId model )
static
Returns
Returns the global opacity for the model.

frameData

Definition at line 281 of file qssgrenderhelpers.cpp.

References model, Q_UNUSED, and QSSG_ASSERT_X.

◆ getGlobalOpacity() [2/2]

float QSSGModelHelpers::getGlobalOpacity ( const QSSGFrameData & frameData,
QSSGNodeId model,
QSSGPrepContextId prepId = QSSGPrepContextId::Invalid )
static
Returns
Returns the global opacity for the model in context of the prepId. By default the prep context argument is QSSGPrepContextId::Uninitialized which returns the model's original global opacity.

frameData

See also
QSSGRenderHelpers::createRenderables()

Definition at line 297 of file qssgrenderhelpers.cpp.

References QSSGFrameData::contextInterface(), QSSGLayerRenderData::getCurrent(), Invalid, model, and QSSG_ASSERT_X.

+ Here is the call graph for this function:

◆ getGlobalTransform()

QMatrix4x4 QSSGModelHelpers::getGlobalTransform ( const QSSGFrameData & frameData,
QSSGNodeId model,
QSSGPrepContextId prepId = {} )
static
Returns
Returns the global transform for the model in context of the prepId. By default the prep context argument is QSSGPrepContextId::Uninitialized which returns the model's original global transform.

frameData

See also
QSSGRenderHelpers::createRenderables()

Definition at line 250 of file qssgrenderhelpers.cpp.

References QSSGFrameData::contextInterface(), QSSGLayerRenderData::getCurrent(), Invalid, model, and QSSG_ASSERT_X.

+ Here is the call graph for this function:

◆ getLocalOpacity()

float QSSGModelHelpers::getLocalOpacity ( const QSSGFrameData & frameData,
QSSGNodeId model )
static
Returns
Returns the local opacity for the model.

frameData

Definition at line 313 of file qssgrenderhelpers.cpp.

References model, Q_UNUSED, and QSSG_ASSERT_X.

◆ getLocalTransform()

QMatrix4x4 QSSGModelHelpers::getLocalTransform ( const QSSGFrameData & frameData,
QSSGNodeId model )
static
Returns
Returns the local transform for the model.

frameData

Definition at line 268 of file qssgrenderhelpers.cpp.

References model, Q_UNUSED, and QSSG_ASSERT_X.

◆ setGlobalOpacity()

void QSSGModelHelpers::setGlobalOpacity ( const QSSGFrameData & frameData,
QSSGRenderablesId renderablesId,
QSSGNodeId model,
float opacity )
static

Sets the global opacity for model in the context of the renderablesId.

frameData, opacity

See also
QSSGRenderHelpers::createRenderables()

Definition at line 349 of file qssgrenderhelpers.cpp.

References QSSGFrameData::contextInterface(), QSSGLayerRenderData::getCurrent(), QSSGRenderGraphObjectUtils::getNode(), model, and QSSG_ASSERT_X.

+ Here is the call graph for this function:

◆ setGlobalTransform()

void QSSGModelHelpers::setGlobalTransform ( const QSSGFrameData & frameData,
QSSGRenderablesId renderablesId,
QSSGNodeId model,
const QMatrix4x4 & transform )
static

Sets the global transform for model in the context of the renderablesId.

frameData, transform

See also
QSSGRenderHelpers::createRenderables()

Definition at line 328 of file qssgrenderhelpers.cpp.

References QSSGFrameData::contextInterface(), QSSGLayerRenderData::getCurrent(), QSSGRenderGraphObjectUtils::getNode(), model, and QSSG_ASSERT_X.

+ Here is the call graph for this function:

◆ setModelMaterials() [1/2]

void QSSGModelHelpers::setModelMaterials ( const QSSGFrameData & frameData,
QSSGRenderablesId renderablesId,
MaterialList materials )
static

Convenience function to apply materials to all models in the renderablesId set.

frameData, renderablesId

See also
QSSGRenderHelpers::createRenderables()

Definition at line 232 of file qssgrenderhelpers.cpp.

References QSSGFrameData::contextInterface(), QSSGLayerRenderData::getCurrent(), and QSSG_ASSERT_X.

+ Here is the call graph for this function:

◆ setModelMaterials() [2/2]

void QSSGModelHelpers::setModelMaterials ( const QSSGFrameData & frameData,
QSSGRenderablesId renderablesId,
QSSGNodeId model,
MaterialList materials )
static

Sets the materials to be used on model.

Note
As with the \l {QtQuick3D::Model::materials}{materials} on the \l {QtQuick3D::Model}{model} item, materials are applied in the same manner.

The sub-mesh uses a material from the \l{materials} list, corresponding to its index. If the number of materials is less than the sub-meshes, the last material in the list is used for subsequent sub-meshes.

frameData renderablesId

See also
QSSGRenderHelpers::createRenderables()

Definition at line 212 of file qssgrenderhelpers.cpp.

References QSSGFrameData::contextInterface(), QSSGLayerRenderData::getCurrent(), model, and QSSG_ASSERT_X.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: