Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QSSGRenderNode Struct Reference

#include <qssgrendernode_p.h>

+ Inheritance diagram for QSSGRenderNode:
+ Collaboration diagram for QSSGRenderNode:

Public Types

enum class  LocalState : quint8 { Active = 1 << 0 , Pickable = 1 << 1 }
 
enum class  GlobalState : quint8 { Active = 1 << 2 , Pickable = 1 << 3 }
 
enum class  DirtyFlag : quint32 {
  TransformDirty = 1 << 4 , OpacityDirty = 1 << 5 , ActiveDirty = 1 << 6 , PickableDirty = 1 << 7 ,
  SubNodeDirty = 1 << 8 , GlobalValuesDirty = TransformDirty | OpacityDirty | ActiveDirty | PickableDirty , DirtyMask = GlobalValuesDirty | SubNodeDirty
}
 
using FlagT = std::underlying_type_t< DirtyFlag >
 
using ChildList = QSSGInvasiveLinkedList< QSSGRenderNode, &QSSGRenderNode::previousSibling, &QSSGRenderNode::nextSibling >
 
- Public Types inherited from QSSGRenderGraphObject
enum  BaseType : quint16 {
  Node = 0x10 , Light = 0x20 , Camera = 0x40 , Renderable = 0x80 ,
  Resource = 0x100 , Material = 0x200 , Texture = 0x400 , Extension = 0x800
}
 
enum class  Type : quint16 {
  Unknown = 0 , Node = BaseType::Node , Layer , Joint ,
  Skeleton , ImportScene , ReflectionProbe , DirectionalLight = BaseType::Light | BaseType::Node ,
  PointLight , SpotLight , OrthographicCamera = BaseType::Camera | BaseType::Node , PerspectiveCamera ,
  CustomFrustumCamera , CustomCamera , Model = BaseType::Renderable | BaseType::Node , Item2D ,
  Particles , SceneEnvironment = BaseType::Resource , Effect , Geometry ,
  TextureData , MorphTarget , ModelInstance , ModelBlendParticle ,
  ResourceLoader , DefaultMaterial = BaseType::Material | BaseType::Resource , PrincipledMaterial , CustomMaterial ,
  SpecularGlossyMaterial , Skin , Image2D = BaseType::Texture | BaseType::Resource , ImageCube ,
  RenderExtension = BaseType::Extension
}
 

Public Member Functions

 QSSGRenderNode ()
 
 QSSGRenderNode (Type type)
 
 ~QSSGRenderNode () override
 
void markDirty (DirtyFlag dirtyFlag)
 
void clearDirty (DirtyFlag dirtyFlag)
 
constexpr bool isDirty (DirtyFlag dirtyFlag=DirtyFlag::DirtyMask) const
 
void setState (LocalState state, bool on=true)
 
constexpr bool getLocalState (LocalState stateFlag) const
 
constexpr bool getGlobalState (GlobalState stateFlag) const
 
void addChild (QSSGRenderNode &inChild)
 
void removeChild (QSSGRenderNode &inChild)
 
void removeFromGraph ()
 
bool calculateGlobalVariables ()
 
QSSGBounds3 getBounds (QSSGBufferManager &inManager, bool inIncludeChildren=true) const
 
QSSGBounds3 getChildBounds (QSSGBufferManager &inManager) const
 
QVector3D getGlobalPos () const
 
QVector3D getGlobalPivot () const
 
QVector3D getDirection () const
 
QVector3D getScalingCorrectDirection () const
 
void calculateMVPAndNormalMatrix (const QMatrix4x4 &inViewProjection, QMatrix4x4 &outMVP, QMatrix3x3 &outNormalMatrix) const
 
QMatrix3x3 calculateNormalMatrix () const
 
- Public Member Functions inherited from QSSGRenderGraphObject
Q_QUICK3D_PROFILE_ID QSSGRenderGraphObject (QSSGRenderGraphObject::Type inType)
 
virtual ~QSSGRenderGraphObject ()
 

Static Public Member Functions

static QMatrix4x4 calculateTransformMatrix (QVector3D position, QVector3D scale, QVector3D pivot, QQuaternion rotation)
 
static float signedSquared (float val)
 
- Static Public Member Functions inherited from QSSGRenderGraphObject
static Q_REQUIRED_RESULT constexpr bool isNodeType (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isLight (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isCamera (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isMaterial (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isTexture (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isRenderable (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isResource (Type type) Q_DECL_NOTHROW
 
static constexpr bool isExtension (Type type) noexcept
 
static Q_REQUIRED_RESULT constexpr bool hasGraphicsResources (Type type) Q_DECL_NOTHROW
 
static const char * asString (QSSGRenderGraphObject::Type type)
 
static QDebug debugPrintImpl (QDebug stream, QSSGRenderGraphObject::Type type)
 

Public Attributes

QVector3D pivot
 
int staticFlags = 0
 
float localOpacity = 1.0f
 
FlagT flags { FlagT(DirtyFlag::GlobalValuesDirty) | FlagT(LocalState::Active) }
 
QMatrix4x4 localTransform
 
QMatrix4x4 globalTransform
 
QMatrix4x4 localInstanceTransform
 
QMatrix4x4 globalInstanceTransform
 
float globalOpacity = 1.0f
 
QSSGRenderNodeparent = nullptr
 
QSSGRenderNodenextSibling = nullptr
 
QSSGRenderNodepreviousSibling = nullptr
 
QSSGRenderNodeinstanceRoot = nullptr
 
quint32 dfsIndex = 0
 
ChildList children
 
QString debugObjectName
 
- Public Attributes inherited from QSSGRenderGraphObject
Type type
 

Static Public Attributes

static constexpr QVector3D initScale { 1.0f, 1.0f, 1.0f }
 

Detailed Description

Definition at line 36 of file qssgrendernode_p.h.

Member Typedef Documentation

◆ ChildList

◆ FlagT

using QSSGRenderNode::FlagT = std::underlying_type_t<DirtyFlag>

Definition at line 61 of file qssgrendernode_p.h.

Member Enumeration Documentation

◆ DirtyFlag

enum class QSSGRenderNode::DirtyFlag : quint32
strong
Enumerator
TransformDirty 
OpacityDirty 
ActiveDirty 
PickableDirty 
SubNodeDirty 
GlobalValuesDirty 
DirtyMask 

Definition at line 50 of file qssgrendernode_p.h.

◆ GlobalState

enum class QSSGRenderNode::GlobalState : quint8
strong
Enumerator
Active 
Pickable 

Definition at line 44 of file qssgrendernode_p.h.

◆ LocalState

enum class QSSGRenderNode::LocalState : quint8
strong
Enumerator
Active 
Pickable 

Definition at line 38 of file qssgrendernode_p.h.

Constructor & Destructor Documentation

◆ QSSGRenderNode() [1/2]

QT_BEGIN_NAMESPACE QSSGRenderNode::QSSGRenderNode ( )

Definition at line 18 of file qssgrendernode.cpp.

Referenced by QSSGRenderLayer::setImportScene().

+ Here is the caller graph for this function:

◆ QSSGRenderNode() [2/2]

QSSGRenderNode::QSSGRenderNode ( Type  type)
explicit

Definition at line 23 of file qssgrendernode.cpp.

References calculateTransformMatrix(), globalTransform, initScale, and localTransform.

+ Here is the call graph for this function:

◆ ~QSSGRenderNode()

QSSGRenderNode::~QSSGRenderNode ( )
overridedefault

Member Function Documentation

◆ addChild()

void QSSGRenderNode::addChild ( QSSGRenderNode inChild)

Definition at line 164 of file qssgrendernode.cpp.

References children, GlobalValuesDirty, markDirty(), parent, QSSGInvasiveLinkedList< T, Previous, Next >::push_back(), and removeChild().

Referenced by QQuick3DSceneManager::updateDirtySpatialNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateGlobalVariables()

bool QSSGRenderNode::calculateGlobalVariables ( )

Definition at line 72 of file qssgrendernode.cpp.

References Active, calculateGlobalVariables(), clearDirty(), QMatrix4x4::data(), getGlobalState(), getLocalState(), globalInstanceTransform, globalOpacity, globalTransform, GlobalValuesDirty, instanceRoot, isDirty(), localInstanceTransform, localOpacity, localTransform, parent, Pickable, QMatrix4x4::translate(), and QSSGRenderGraphObject::type.

Referenced by calculateGlobalVariables(), QSSGRenderCamera::calculateGlobalVariables(), collectBoneTransforms(), and maybeQueueNodeForRender().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateMVPAndNormalMatrix()

void QSSGRenderNode::calculateMVPAndNormalMatrix ( const QMatrix4x4 inViewProjection,
QMatrix4x4 outMVP,
QMatrix3x3 outNormalMatrix 
) const

Definition at line 263 of file qssgrendernode.cpp.

References calculateNormalMatrix(), and globalTransform.

Referenced by QSSGModelContext::QSSGModelContext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateNormalMatrix()

QMatrix3x3 QSSGRenderNode::calculateNormalMatrix ( ) const

Definition at line 269 of file qssgrendernode.cpp.

References globalTransform, and QMatrix4x4::normalMatrix().

Referenced by calculateMVPAndNormalMatrix(), and QSSGRenderCamera::unproject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateTransformMatrix()

QMatrix4x4 QSSGRenderNode::calculateTransformMatrix ( QVector3D  position,
QVector3D  scale,
QVector3D  pivot,
QQuaternion  rotation 
)
static

Definition at line 136 of file qssgrendernode.cpp.

References pivot, position(), and QQuaternion::toRotationMatrix().

Referenced by QSSGRenderNode(), QQuick3DNodePrivate::calculateGlobalVariables(), calculateKinematicNodeTransform(), QSSGRenderCamera::lookAt(), setupCameraForShadowMap(), setupCubeReflectionCameras(), setupCubeShadowCameras(), and QQuick3DNode::updateSpatialNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearDirty()

void QSSGRenderNode::clearDirty ( DirtyFlag  dirtyFlag)

Definition at line 44 of file qssgrendernode.cpp.

Referenced by calculateGlobalVariables(), QSSGRenderCamera::clearDirty(), and QSSGRenderLight::clearDirty().

+ Here is the caller graph for this function:

◆ getBounds()

QSSGBounds3 QSSGRenderNode::getBounds ( QSSGBufferManager inManager,
bool  inIncludeChildren = true 
) const

Definition at line 202 of file qssgrendernode.cpp.

References getChildBounds(), QSSGBufferManager::getModelBounds(), QSSGBounds3::include(), and model.

+ Here is the call graph for this function:

◆ getChildBounds()

QSSGBounds3 QSSGRenderNode::getChildBounds ( QSSGBufferManager inManager) const

Definition at line 216 of file qssgrendernode.cpp.

References child, children, QSSGBounds3::include(), QSSGBounds3::isEmpty(), and QSSGBounds3::transform().

Referenced by getBounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDirection()

QVector3D QSSGRenderNode::getDirection ( ) const

Definition at line 231 of file qssgrendernode.cpp.

References QMatrix4x4::data(), globalTransform, and QVector3D::normalize().

Referenced by QSSGRenderer::intersectRayWithItem2D(), setupCameraForShadowMap(), and QSSGRenderCamera::unprojectToPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalPivot()

QVector3D QSSGRenderNode::getGlobalPivot ( ) const

Definition at line 249 of file qssgrendernode.cpp.

References direction, mat44::getPosition(), globalTransform, localTransform, parent, QVector3D::setZ(), QSSGRenderGraphObject::type, QVector3D::x(), QVector3D::y(), and QVector3D::z().

+ Here is the call graph for this function:

◆ getGlobalPos()

◆ getGlobalState()

constexpr bool QSSGRenderNode::getGlobalState ( GlobalState  stateFlag) const
inlineconstexpr

Definition at line 108 of file qssgrendernode_p.h.

Referenced by calculateGlobalVariables(), maybeQueueNodeForRender(), and QSSGLayerRenderData::prepareForRender().

+ Here is the caller graph for this function:

◆ getLocalState()

constexpr bool QSSGRenderNode::getLocalState ( LocalState  stateFlag) const
inlineconstexpr

Definition at line 107 of file qssgrendernode_p.h.

Referenced by calculateGlobalVariables(), and setState().

+ Here is the caller graph for this function:

◆ getScalingCorrectDirection()

QVector3D QSSGRenderNode::getScalingCorrectDirection ( ) const

Definition at line 239 of file qssgrendernode.cpp.

References globalTransform, QVector3D::normalize(), QMatrix4x4::normalMatrix(), and mat33::transform().

Referenced by QSSGRenderCamera::lookAt(), QSSGLayerRenderData::prepareForRender(), QSSGLayerRenderData::prepareModelsForRender(), and RenderHelpers::rhiPrepareRenderable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDirty()

constexpr bool QSSGRenderNode::isDirty ( DirtyFlag  dirtyFlag = DirtyFlag::DirtyMask) const
inlineconstexpr

Definition at line 105 of file qssgrendernode_p.h.

Referenced by calculateGlobalVariables(), hasDirtyNonJointNodes(), QSSGRenderCamera::isDirty(), QSSGRenderLight::isDirty(), and maybeQueueNodeForRender().

+ Here is the caller graph for this function:

◆ markDirty()

void QSSGRenderNode::markDirty ( DirtyFlag  dirtyFlag)

Definition at line 32 of file qssgrendernode.cpp.

References children, and GlobalValuesDirty.

Referenced by addChild(), QSSGRenderCamera::lookAt(), QSSGRenderCamera::markDirty(), QSSGRenderLight::markDirty(), removeChild(), setState(), and QQuick3DModel::updateSpatialNode().

+ Here is the caller graph for this function:

◆ removeChild()

void QSSGRenderNode::removeChild ( QSSGRenderNode inChild)

Definition at line 177 of file qssgrendernode.cpp.

References children, GlobalValuesDirty, markDirty(), parent, Q_ASSERT, Q_UNLIKELY, and QSSGInvasiveLinkedList< T, Previous, Next >::remove().

Referenced by addChild(), removeFromGraph(), and QQuick3DSceneManager::updateDirtySpatialNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeFromGraph()

void QSSGRenderNode::removeFromGraph ( )

Definition at line 189 of file qssgrendernode.cpp.

References QSSGInvasiveLinkedList< T, Previous, Next >::begin(), children, QSSGInvasiveLinkedList< T, Previous, Next >::end(), it, parent, QSSGInvasiveLinkedList< T, Previous, Next >::remove(), and removeChild().

Referenced by QQuick3DSceneManager::cleanupNodes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setState()

void QSSGRenderNode::setState ( LocalState  state,
bool  on = true 
)

Definition at line 49 of file qssgrendernode.cpp.

References Active, ActiveDirty, getLocalState(), markDirty(), Pickable, PickableDirty, and state.

+ Here is the call graph for this function:

◆ signedSquared()

static float QSSGRenderNode::signedSquared ( float  val)
inlinestatic

Definition at line 152 of file qssgrendernode_p.h.

References sign().

Referenced by QQuick3DParticleSpriteParticle::updateParticleNode(), and QQuick3DModel::updateSpatialNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ children

◆ debugObjectName

QString QSSGRenderNode::debugObjectName

Definition at line 95 of file qssgrendernode_p.h.

Referenced by QSSGRenderReflectionMap::addReflectionMapEntry().

◆ dfsIndex

quint32 QSSGRenderNode::dfsIndex = 0

Definition at line 90 of file qssgrendernode_p.h.

Referenced by maybeQueueNodeForRender().

◆ flags

Definition at line 75 of file qssgrendernode_p.h.

◆ globalInstanceTransform

QMatrix4x4 QSSGRenderNode::globalInstanceTransform

Definition at line 80 of file qssgrendernode_p.h.

Referenced by calculateGlobalVariables().

◆ globalOpacity

float QSSGRenderNode::globalOpacity = 1.0f

◆ globalTransform

◆ initScale

constexpr QVector3D QSSGRenderNode::initScale { 1.0f, 1.0f, 1.0f }
staticconstexpr

◆ instanceRoot

QSSGRenderNode* QSSGRenderNode::instanceRoot = nullptr

◆ localInstanceTransform

QMatrix4x4 QSSGRenderNode::localInstanceTransform

Definition at line 79 of file qssgrendernode_p.h.

Referenced by calculateGlobalVariables().

◆ localOpacity

float QSSGRenderNode::localOpacity = 1.0f

Definition at line 72 of file qssgrendernode_p.h.

Referenced by calculateGlobalVariables().

◆ localTransform

◆ nextSibling

QSSGRenderNode* QSSGRenderNode::nextSibling = nullptr

Definition at line 85 of file qssgrendernode_p.h.

◆ parent

◆ pivot

◆ previousSibling

QSSGRenderNode* QSSGRenderNode::previousSibling = nullptr

Definition at line 86 of file qssgrendernode_p.h.

◆ staticFlags

int QSSGRenderNode::staticFlags = 0

Definition at line 68 of file qssgrendernode_p.h.


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