30 Q_PROPERTY(
float x READ x WRITE setX NOTIFY xChanged)
31 Q_PROPERTY(
float y READ y WRITE setY NOTIFY yChanged)
32 Q_PROPERTY(
float z READ z WRITE setZ NOTIFY zChanged)
33 Q_PROPERTY(QQuaternion rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
34 Q_PROPERTY(QVector3D eulerRotation READ eulerRotation WRITE setEulerRotation NOTIFY eulerRotationChanged)
35 Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY positionChanged)
36 Q_PROPERTY(QVector3D scale READ scale WRITE setScale NOTIFY scaleChanged)
37 Q_PROPERTY(QVector3D pivot READ pivot WRITE setPivot NOTIFY pivotChanged)
38 Q_PROPERTY(
float opacity READ localOpacity WRITE setLocalOpacity NOTIFY localOpacityChanged)
39 Q_PROPERTY(
bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
40 Q_PROPERTY(QVector3D forward READ forward NOTIFY forwardChanged)
41 Q_PROPERTY(QVector3D up READ up NOTIFY upChanged)
42 Q_PROPERTY(QVector3D right READ right NOTIFY rightChanged)
43 Q_PROPERTY(QVector3D scenePosition READ scenePosition NOTIFY scenePositionChanged)
44 Q_PROPERTY(QQuaternion sceneRotation READ sceneRotation NOTIFY sceneRotationChanged)
45 Q_PROPERTY(QVector3D sceneScale READ sceneScale NOTIFY sceneScaleChanged)
46 Q_PROPERTY(QMatrix4x4 sceneTransform READ sceneTransform NOTIFY sceneTransformChanged)
47 Q_PROPERTY(
int staticFlags READ staticFlags WRITE setStaticFlags NOTIFY staticFlagsChanged)
49 QML_NAMED_ELEMENT(Node)
57 Q_ENUM(TransformSpace)
64 explicit QQuick3DNode(QQuick3DNode *parent =
nullptr);
65 ~QQuick3DNode() override;
70 QQuaternion rotation()
const;
71 QVector3D eulerRotation()
const;
72 QVector3D position()
const;
73 QVector3D scale()
const;
74 QVector3D pivot()
const;
75 float localOpacity()
const;
77 int staticFlags()
const;
79 QQuick3DNode *parentNode()
const;
81 QVector3D forward()
const;
83 QVector3D right()
const;
85 QVector3D scenePosition()
const;
86 QQuaternion sceneRotation()
const;
87 QVector3D sceneScale()
const;
88 QMatrix4x4 sceneTransform()
const;
90 Q_INVOKABLE
void rotate(qreal degrees,
const QVector3D &axis, QQuick3DNode::TransformSpace space);
92 Q_INVOKABLE QVector3D mapPositionToScene(
const QVector3D &localPosition)
const;
93 Q_INVOKABLE QVector3D mapPositionFromScene(
const QVector3D &scenePosition)
const;
94 Q_INVOKABLE QVector3D mapPositionToNode(
const QQuick3DNode *node,
const QVector3D &localPosition)
const;
95 Q_INVOKABLE QVector3D mapPositionFromNode(
const QQuick3DNode *node,
const QVector3D &localPosition)
const;
96 Q_INVOKABLE QVector3D mapDirectionToScene(
const QVector3D &localDirection)
const;
97 Q_INVOKABLE QVector3D mapDirectionFromScene(
const QVector3D &sceneDirection)
const;
98 Q_INVOKABLE QVector3D mapDirectionToNode(
const QQuick3DNode *node,
const QVector3D &localDirection)
const;
99 Q_INVOKABLE QVector3D mapDirectionFromNode(
const QQuick3DNode *node,
const QVector3D &localDirection)
const;
101 void markAllDirty() override;
104 void connectNotify(
const QMetaMethod &signal) override;
105 void disconnectNotify(
const QMetaMethod &signal) override;
106 void componentComplete() override;
112 void setRotation(
const QQuaternion &rotation);
113 void setEulerRotation(
const QVector3D &eulerRotation);
114 void setPosition(
const QVector3D &position);
115 void setScale(
const QVector3D &scale);
116 void setPivot(
const QVector3D &pivot);
117 void setLocalOpacity(
float opacity);
118 void setVisible(
bool visible);
119 void setStaticFlags(
int staticFlags);
125 void rotationChanged();
126 void eulerRotationChanged();
127 void positionChanged();
130 void localOpacityChanged();
131 void visibleChanged();
132 void forwardChanged();
135 void sceneTransformChanged();
136 void scenePositionChanged();
137 void sceneRotationChanged();
138 void sceneScaleChanged();
139 void staticFlagsChanged();
142 QQuick3DNode(QQuick3DNodePrivate &dd, QQuick3DNode *parent =
nullptr);
143 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
144 virtual void itemChange(ItemChange,
const ItemChangeData &) override;
147 friend QQuick3DSceneManager;
148 Q_DISABLE_COPY(QQuick3DNode)
149 Q_DECLARE_PRIVATE(QQuick3DNode)