7#include <QtQuick3DRuntimeRender/private/qssgrenderreflectionprobe_p.h>
8#include <QtQuick3DUtils/private/qssgutils_p.h>
32 const QQuick3DObject::ItemChangeData &
value)
34 if (change == QQuick3DObject::ItemSceneChange)
35 updateSceneManager(
value.sceneManager);
117 return m_timeSlicing;
132 return m_parallaxCorrection;
200void QQuick3DReflectionProbe::scheduleUpdate()
208 if (m_quality == reflectionQuality)
211 m_quality = reflectionQuality;
229 if (m_refreshMode == newRefreshMode)
231 m_refreshMode = newRefreshMode;
239 if (m_timeSlicing == newTimeSlicing)
241 m_timeSlicing = newTimeSlicing;
269void QQuick3DReflectionProbe::setDebugView(
bool debugView)
274 emit debugViewChanged();
279void QQuick3DReflectionProbe::setBoxOffset(
const QVector3D &boxOffset)
285 emit boxOffsetChanged();
293 if (m_texture == newTexture)
296 m_texture = newTexture;
298 emit textureChanged();
325 switch (m_refreshMode) {
338 switch (m_timeSlicing) {
384void QQuick3DReflectionProbe::findSceneView()
387 if (m_sceneView !=
nullptr)
398 while (!
queue.empty()) {
399 auto node =
queue.takeFirst();
400 if (
auto converted = qobject_cast<QQuick3DViewport *>(node); converted !=
nullptr) {
401 m_sceneView = converted;
404 queue.append(node->children());
408void QQuick3DReflectionProbe::createDebugView()
414 qWarning() <<
"ReflectionProbe: Can not create debug view. A root View3D could not be found.";
418 if (!m_debugViewGeometry)
421 m_debugViewGeometry->
clear();
466 vertexData.
resize(m_vertices.
size() * 3 *
sizeof(
float));
467 float *
data =
reinterpret_cast<float *
>(vertexData.
data());
468 for (
int i = 0;
i < m_vertices.
size();
i++) {
469 data[0] = m_vertices[
i].x();
470 data[1] = m_vertices[
i].y();
471 data[2] = m_vertices[
i].z();
476 m_debugViewGeometry->
update();
478 if (!m_debugViewModel) {
483 m_debugViewModel->setCastsReflections(
false);
484 m_debugViewModel->
setGeometry(m_debugViewGeometry);
487 if (!m_debugViewMaterial) {
490 m_debugViewMaterial->
setParent(m_debugViewModel);
495 materialsRef.append(m_debugViewMaterial);
498 if (m_debugViewModel) {
499 delete m_debugViewModel;
500 m_debugViewModel =
nullptr;
501 m_debugViewMaterial =
nullptr;
504 if (m_debugViewGeometry) {
505 delete m_debugViewGeometry;
506 m_debugViewGeometry =
nullptr;
511void QQuick3DReflectionProbe::updateDebugView()
513 if (m_debugViewModel) {
515 m_debugViewModel->
setScale(m_boxSize);
519quint32 QQuick3DReflectionProbe::mapToReflectionResolution(ReflectionQuality quality)
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
The QColor class provides colors based on RGB, HSV or CMYK values.
qsizetype size() const noexcept
void append(parameter_type t)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void setParent(QObject *parent)
Makes the object a child of parent.
The QQmlListReference class allows the manipulation of QQmlListProperty properties.
void setLighting(QQuick3DDefaultMaterial::Lighting lighting)
void setDiffuseColor(QColor diffuseColor)
\qmltype Geometry \inherits Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DGeometry
void setPrimitiveType(PrimitiveType type)
Sets the primitive type used for rendering to type.
void setStride(int stride)
Sets the stride of the vertex buffer to stride, measured in bytes.
void addAttribute(Attribute::Semantic semantic, int offset, Attribute::ComponentType componentType)
Adds vertex attribute description.
void setVertexData(const QByteArray &data)
Sets the vertex buffer data.
void clear()
Resets the geometry to its initial state, clearing previously set vertex and index data as well as at...
void setCullMode(QQuick3DMaterial::CullMode cullMode)
void setCastsShadows(bool castsShadows)
void setGeometry(QQuick3DGeometry *geometry)
void setScale(const QVector3D &scale)
void markAllDirty() override
void setPosition(const QVector3D &position)
void scenePositionChanged()
QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node) override
void refSceneManager(QQuick3DSceneManager &)
static void attachWatcher(Context *context, Setter setter, Object3D *newO, Object3D *oldO)
Attach a object-destroyed-watcher to an object that's not owned.
QQuick3DObject * parent
\qmlproperty Object3D QtQuick3D::Object3D::parent This property holds the parent of the Object3D in a...
void setParentItem(QQuick3DObject *parentItem)
void markAllDirty() override
QQuick3DCubeMapTexture * texture
\qmlproperty CubeMapTexture ReflectionProbe::texture
void itemChange(ItemChange, const ItemChangeData &) override
void timeSlicingChanged()
@ ParallaxCorrectionDirty
QVector3D boxOffset
\qmlproperty vector3d ReflectionProbe::boxOffset
void setQuality(ReflectionQuality reflectionQuality)
void setParallaxCorrection(bool parallaxCorrection)
bool debugView
\qmlproperty bool ReflectionProbe::debugView
ReflectionQuality quality
void refreshModeChanged()
void setRefreshMode(ReflectionRefreshMode newRefreshMode)
QQuick3DReflectionProbe(QQuick3DNode *parent=nullptr)
\qmltype ReflectionProbe \inherits Node \inqmlmodule QtQuick3D
ReflectionRefreshMode refreshMode
void setTimeSlicing(ReflectionTimeSlicing newTimeSlicing)
ReflectionTimeSlicing timeSlicing
QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node) override
void setBoxSize(const QVector3D &newBoxSize)
void parallaxCorrectionChanged()
void setClearColor(const QColor &clearColor)
QSSGRenderImage * getRenderImage()
The QVector3D class represents a vector or vertex in 3D space.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QSSGRenderImage * texture
ReflectionTimeSlicing timeSlicing
ReflectionRefreshMode refreshMode
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent