Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 54 of file qssgrenderhelpers.h.

Member Typedef Documentation

◆ MaterialList

Member Function Documentation

◆ getGlobalOpacity() [1/2]

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

frameData

Definition at line 283 of file qssgrenderhelpers.cpp.

◆ getGlobalOpacity() [2/2]

float QSSGModelHelpers::getGlobalOpacity ( const QSSGFrameData & frameData,
QSSGNodeId model,
QSSGPrepContextId prepId = QSSGPrepContextId::Invalid )
staticnodiscard
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 301 of file qssgrenderhelpers.cpp.

◆ getGlobalTransform()

QMatrix4x4 QSSGModelHelpers::getGlobalTransform ( const QSSGFrameData & frameData,
QSSGNodeId model,
QSSGPrepContextId prepId = {} )
staticnodiscard
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 252 of file qssgrenderhelpers.cpp.

◆ getLocalOpacity()

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

frameData

Definition at line 316 of file qssgrenderhelpers.cpp.

◆ getLocalTransform()

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

frameData

Definition at line 270 of file qssgrenderhelpers.cpp.

◆ 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 352 of file qssgrenderhelpers.cpp.

◆ 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 331 of file qssgrenderhelpers.cpp.

◆ 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 234 of file qssgrenderhelpers.cpp.

◆ 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 214 of file qssgrenderhelpers.cpp.


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