mirror of https://github.com/qt/qt3d.git
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I3a0df1d21f3556afc9f26eab13fcc525cf584e7e
This commit is contained in:
commit
00dc70ae70
|
|
@ -0,0 +1,20 @@
|
|||
Qt 5.13.2 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.13.0 through 5.13.1.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.13 series is binary compatible with the 5.12.x series.
|
||||
Applications compiled for 5.12 will continue to run with 5.13.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
- This release contains only minor code improvements.
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
Advanced custom material example shows more complex shaders, and demonstrates controlling your
|
||||
shader properties with QtQuick user interface and Animation. Water is a 3D mesh, that is
|
||||
modeled and uv mapped inside Blender, and then brought into Scene 3D as an \c {.obj} file.
|
||||
Shader properties that user can control, are defined in \l {advancedcustommaterial/WaterMaterial.qml}{WaterMaterial}.
|
||||
Shader properties that user can control, are defined in \c {advancedcustommaterial/WaterMaterial.qml}.
|
||||
|
||||
\section1 Controls
|
||||
\section2 Texture scale slider
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
\section2 Texture speed slider
|
||||
|
||||
Offsets values for texture coordinates which are animated in
|
||||
\l {advancedcustommaterial/Water.qml}{Water.qml} and then passed to vertex shader.
|
||||
\c {advancedcustommaterial/Water.qml} and then passed to vertex shader.
|
||||
Creates the effect of textures scrolling over the surface.
|
||||
|
||||
\section2 Specularity
|
||||
|
|
@ -80,5 +80,5 @@
|
|||
|
||||
\section2 Mesh rotation
|
||||
|
||||
Rotates the water mesh in \l {advancedcustommaterial/Water.qml}{Water.qml}.
|
||||
Rotates the water mesh in \c {advancedcustommaterial/Water.qml}.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
\section1 Qt Quick 2D Implementation
|
||||
|
||||
The Qt Quick Implementation \l{audio-visualizer-qml/main.qml}{main.qml} of the example uses
|
||||
The Qt Quick Implementation in \c {audio-visualizer-qml/main.qml} of the example uses
|
||||
\c{MediaPlayer} to play audio content.
|
||||
|
||||
\snippet audio-visualizer-qml/main.qml 0
|
||||
|
|
@ -57,8 +57,8 @@
|
|||
|
||||
\section1 Qt 3D Implementation
|
||||
|
||||
The 3D elements of the example are created in the
|
||||
\l{audio-visualizer-qml/Visualizer.qml}{Visualizer.qml}. The camera is set to a fixed position
|
||||
The 3D elements of the example are created in
|
||||
\c {audio-visualizer-qml/Visualizer.qml}. The camera is set to a fixed position
|
||||
to show the visualized bars from a correct angle.
|
||||
|
||||
\snippet audio-visualizer-qml/Visualizer.qml 0
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
\snippet audio-visualizer-qml/Visualizer.qml 2
|
||||
|
||||
In \l{audio-visualizer-qml/BarEntity.qml}{BarEntity.qml} there are animations for rotating the
|
||||
In \c {audio-visualizer-qml/BarEntity.qml} there are animations for rotating the
|
||||
bars and changing the bar color. The bars are rotated on a level following a ring form. At the
|
||||
same time the color of the bars is animated.
|
||||
|
||||
|
|
|
|||
|
|
@ -50,14 +50,14 @@
|
|||
|
||||
\section1 Qt Quick 2D Implementation
|
||||
|
||||
The Qt Quick Implementation \l{planets-qml/PlanetsMain.qml}{PlanetsMain.qml} of the
|
||||
The Qt Quick Implementation in \c {planets-qml/PlanetsMain.qml} of the
|
||||
example renders the 3D content using the \c Scene3D type.
|
||||
|
||||
\snippet planets-qml/PlanetsMain.qml 0
|
||||
|
||||
The planet related information is stored into a \c{ListModel}. The selection buttons for the
|
||||
planets and the information sheet are created based on the model. The 2D elements, selection
|
||||
buttons and sliders, are implemented in the \l{planets-qml/PlanetsMain.qml}{PlanetsMain.qml}.
|
||||
buttons and sliders, are implemented in \c {planets-qml/PlanetsMain.qml}.
|
||||
|
||||
The selection buttons change the \c{focusedPlanet} property of the \c{mainview}. As the property
|
||||
changes, the planet information is updated, and the camera is animated to the new position.
|
||||
|
|
@ -65,14 +65,14 @@
|
|||
\snippet planets-qml/PlanetsMain.qml 1
|
||||
|
||||
The camera position and the camera look at point are updated based on values that are animated
|
||||
in the \l{planets-qml/SolarSystem.qml}{SolarSystem.qml}, triggered from the
|
||||
in \c {planets-qml/SolarSystem.qml}, triggered from the
|
||||
\c{changePlanetFocus()} function.
|
||||
|
||||
\snippet planets-qml/SolarSystem.qml 0
|
||||
|
||||
The sliders are used to adjust the rotation speed, the planet size, and the viewing distance.
|
||||
When a slider value changes, a JavaScript function in \l{planets-qml/SolarSystem.qml}
|
||||
{SolarSystem.qml} is called to adjust the given property. For example, changing the value of
|
||||
When a slider value changes, a JavaScript function in \c {planets-qml/SolarSystem.qml}
|
||||
is called to adjust the given property. For example, changing the value of
|
||||
the \e{Viewing Distance} slider calls the \c{changeCameraDistance()} method.
|
||||
|
||||
\snippet planets-qml/PlanetsMain.qml 2
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
\section1 Qt 3D Implementation
|
||||
|
||||
The main part of the implementation, including the movement and rotation maths for the planets,
|
||||
is done in the \l{planets-qml/SolarSystem.qml}{SolarSystem.qml}.
|
||||
is done in \c {planets-qml/SolarSystem.qml}.
|
||||
|
||||
First, a \c Camera, a \c{Light}, and a \c Configuration are added, followed by \c{Effect}s for
|
||||
the planet \c{Material}s, and finally the planets themselves. For example, Earth is constructed
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
\snippet planets-qml/SolarSystem.qml 1
|
||||
|
||||
Planet data, which is needed for the movement and rotation calculations, among other things, is
|
||||
constructed with JavaScript in \l{planets-qml/planets.js}{planets.js} by calling
|
||||
constructed with JavaScript in \c {planets-qml/planets.js} by calling
|
||||
\c{loadPlanetData()} as the component completes. Other initializations, such as inserting the
|
||||
planets into an array for easier handling, calculating the ring radii for Saturn and Uranus
|
||||
rings, and setting the default scale, speed, and camera offset, are done as well:
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
\section1 Specifying the Material
|
||||
|
||||
The material is specified in \l{simplecustommaterial/SimpleMaterial.qml}{SimpleMaterial.qml}
|
||||
The material is specified in \c {simplecustommaterial/SimpleMaterial.qml}
|
||||
using \l Material type. First the material specifies parameters,
|
||||
which are mapped to the corresponding uniforms in the shaders so that they can be
|
||||
changed from the qml.
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ void QAbstractAnimationClipPrivate::setDuration(float duration)
|
|||
animator->setRunning(true);
|
||||
\endcode
|
||||
|
||||
\sa QAnimationClip, QAnimationClipLoader
|
||||
\sa Qt3DAnimation::QAnimationClip, Qt3DAnimation::QAnimationClipLoader
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\class Qt3DAnimation::QAnimationCallback
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Represents an animation callback object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum Qt3DAnimation::QAnimationCallback::Flag
|
||||
|
||||
Flags to indicate how the valueChanged() function is called.
|
||||
|
||||
\value OnOwningThread
|
||||
Callback function is called on the owning (GUI or main) thread.
|
||||
\value OnThreadPool
|
||||
Callback function is called on the thread pool's worker thread.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn Qt3DAnimation::QAnimationCallback::valueChanged(const QVariant &value)
|
||||
|
||||
Callback function that is triggered for changes in the animated \a value.
|
||||
|
||||
\sa QCallbackMapping::setCallback()
|
||||
*/
|
||||
|
|
@ -51,8 +51,8 @@ QAnimationClipPrivate::QAnimationClipPrivate()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QAnimationClip
|
||||
\inherits QAbstractAnimationClip
|
||||
\class Qt3DAnimation::QAnimationClip
|
||||
\inherits Qt3dAnimation::QAbstractAnimationClip
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Specifies key frame animation data.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public:
|
|||
};
|
||||
|
||||
/*!
|
||||
\class QAnimationClipData
|
||||
\class Qt3DAnimation::QAnimationClipData
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Class containing the animation data.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ QCallbackMappingPrivate::QCallbackMappingPrivate()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QCallbackMapping
|
||||
\class Qt3DAnimation::QCallbackMapping
|
||||
\inherits Qt3DCore::QAbstractChannelMapping
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Allows to map the channels within the clip onto an invocation
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
};
|
||||
|
||||
/*!
|
||||
\class QChannel
|
||||
\class Qt3DAnimation::QChannel
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Defines a channel for a QAnimationClipData.
|
||||
The animation system interpolates each channel component independently
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ QChannelMapperPrivate::QChannelMapperPrivate()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QChannelMapper
|
||||
\class Qt3DAnimation::QChannelMapper
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Allows to map the channels within the clip onto properties of
|
||||
objects in the application.
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ void QChannelMappingPrivate::updatePropertyNameTypeAndComponentCount()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QChannelMapping
|
||||
\class Qt3DAnimation::QChannelMapping
|
||||
\inherits Qt3DCore::QNode
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Allows to map the channels within the clip onto properties of
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ bool QClipAnimatorPrivate::canPlay() const
|
|||
The properties for controlling the animator are provided by the QAbstractClipAnimator base
|
||||
class.
|
||||
|
||||
\sa QAbstractClipAnimator, QAbstractAnimationClip, QChannelMapper, QBlendedClipAnimator
|
||||
\sa Qt3DAnimation::QAbstractClipAnimator, Qt3DAnimation::QAbstractAnimationClip,
|
||||
Qt3DAnimation::QChannelMapper, Qt3DAnimation::QBlendedClipAnimator
|
||||
*/
|
||||
|
||||
QClipAnimator::QClipAnimator(Qt3DCore::QNode *parent)
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ QClipBlendValuePrivate::QClipBlendValuePrivate()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QClipBlendValue
|
||||
\class Qt3DAnimation::QClipBlendValue
|
||||
\inherits Qt3DAnimation::QAbstractClipBlendNode
|
||||
\inmodule Qt3DAnimation
|
||||
\brief Class used for including a clip in a blend tree.
|
||||
*/
|
||||
/*!
|
||||
\qmltype ClipBlendValue
|
||||
\instantiates QClipBlendValue
|
||||
\instantiates Qt3DAnimation::QClipBlendValue
|
||||
\inqmlmodule Qt3D.Animation
|
||||
\brief Type used for including a clip in a blend tree.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ namespace Qt3DAnimation {
|
|||
*/
|
||||
/*!
|
||||
\qmlmethod MorphTarget Qt3D.Animation::MorphTarget::fromGeometry(geometry, stringList)
|
||||
Returns a morph target based on the attributes defined by the given stringList from
|
||||
the given geometry.
|
||||
Returns a morph target based on the attributes defined by the given \a stringList from
|
||||
the given \a geometry.
|
||||
*/
|
||||
|
||||
QMorphTargetPrivate::QMorphTargetPrivate()
|
||||
|
|
|
|||
|
|
@ -508,6 +508,11 @@ QVector<QAspectJobPtr> QAbstractAspectPrivate::jobsToExecute(qint64 time)
|
|||
return res;
|
||||
}
|
||||
|
||||
void QAbstractAspectPrivate::jobsDone()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* Called in the context of the aspect thread once the aspect has been registered.
|
||||
* This provides an opportunity for the aspect to do any initialization tasks that
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ public:
|
|||
QAbstractAspectJobManager *jobManager() const;
|
||||
|
||||
QVector<QAspectJobPtr> jobsToExecute(qint64 time) override;
|
||||
void jobsDone() override;
|
||||
|
||||
QBackendNode *createBackendNode(const NodeTreeChange &change) const;
|
||||
void clearBackendNode(const NodeTreeChange &change) const;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ public:
|
|||
|
||||
private:
|
||||
virtual QVector<QAspectJobPtr> jobsToExecute(qint64 time) = 0;
|
||||
virtual void jobsDone() = 0;
|
||||
|
||||
friend class QScheduler;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Qt3DCore {
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename T> QVector<T *> QEntity::componentsOfType() const
|
||||
\fn template<typename T> QVector<T *> Qt3DCore::QEntity::componentsOfType() const
|
||||
|
||||
Returns all the components added to this entity that can be cast to
|
||||
type T or an empty vector if there are no such components.
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ void QScheduler::scheduleAndWaitForFrameAspectJobs(qint64 time)
|
|||
|
||||
for (auto &job : qAsConst(jobQueue))
|
||||
QAspectJobPrivate::get(job.data())->postFrame(m_aspectManager);
|
||||
|
||||
for (QAbstractAspect *aspect : aspects)
|
||||
QAbstractAspectPrivate::get(aspect)->jobsDone();
|
||||
}
|
||||
|
||||
} // namespace Qt3DCore
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ QAbstractSpriteSheet::~QAbstractSpriteSheet()
|
|||
}
|
||||
|
||||
/*!
|
||||
\property QAbstractSpriteSheet::texture
|
||||
\property Qt3DExtras::QAbstractSpriteSheet::texture
|
||||
|
||||
Holds the current texture used by the material.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ QAbstractPhysicalDevice *QActionInput::sourceDevice() const
|
|||
/*!
|
||||
\qmlsignal Qt3D.Input::ActionInput::buttonsChanged(const QVector<int> &buttons)
|
||||
|
||||
This signal is emitted when the buttons associated with the action input is changed.
|
||||
This signal is emitted when the \a buttons associated with the action input is changed.
|
||||
|
||||
The corresponding handler is \c onbuttonsChanged
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ QKeyEvent::~QKeyEvent()
|
|||
/*!
|
||||
\qmlmethod bool Qt3D.Input::KeyEvent::matches(StandardKey key)
|
||||
|
||||
Returns \c true if the key event matches the given standard key; otherwise
|
||||
Returns \c true if the key event matches the given standard \a key; otherwise
|
||||
returns \c false.
|
||||
|
||||
\sa QKeySequence::StandardKey
|
||||
|
|
@ -174,7 +174,7 @@ QKeyEvent::~QKeyEvent()
|
|||
|
||||
See \l [CPP] {Qt::Key}{Qt.Key} for the list of keyboard codes.
|
||||
|
||||
\sa {QKeyEvent::key}
|
||||
\b {See also} \l [QtGui] {QKeyEvent::key()}.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
@ -194,7 +194,7 @@ QKeyEvent::~QKeyEvent()
|
|||
This property holds the keyboard modifier flags that existed immediately
|
||||
before the event occurred.
|
||||
|
||||
\sa {QKeyEvent::modifiers}
|
||||
\b {See also} \l [QtGui] {QKeyEvent::modifiers()}.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -197,21 +197,21 @@ void QMouseHandlerPrivate::mouseEvent(const QMouseEventPtr &event)
|
|||
\qmlsignal Qt3D.Input::MouseHandler::wheel(MouseEvent mouse)
|
||||
|
||||
This signal is emitted when the mouse wheel is used with the event details
|
||||
being contained within \a wheel
|
||||
being contained within \a mouse.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn Qt3DInput::QMouseHandler::clicked(Qt3DInput::QMouseEvent *mouse)
|
||||
|
||||
This signal is emitted when a mouse button is clicked with the event details
|
||||
being contained within \a mouse
|
||||
being contained within \a mouse.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn Qt3DInput::QMouseHandler::doubleClicked(Qt3DInput::QMouseEvent *mouse)
|
||||
|
||||
This signal is emitted when a mouse button is double clicked with the event
|
||||
details being contained within \a mouse
|
||||
details being contained within \a mouse.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ QPhysicalDeviceCreatedChangeBasePrivate::QPhysicalDeviceCreatedChangeBasePrivate
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QPhysicalDeviceCreatedChangeBase
|
||||
\class Qt3DInput::QPhysicalDeviceCreatedChangeBase
|
||||
\inmodule Qt3DInput
|
||||
\brief Base class for handling changes in physical devices.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ void Scene3DItem::setWindowSurface(QObject *rootObject)
|
|||
/*!
|
||||
\qmlmethod void Scene3D::setItemAreaAndDevicePixelRatio(size area, real devicePixelRatio)
|
||||
|
||||
\brief \TODO
|
||||
Sets the item area to \a area and the pixel ratio to \a devicePixelRatio.
|
||||
*/
|
||||
void Scene3DItem::setItemAreaAndDevicePixelRatio(QSize area, qreal devicePixelRatio)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ namespace Qt3DRender {
|
|||
|
||||
namespace Quick {
|
||||
|
||||
/*!
|
||||
\namespace Qt3DRender::Quick
|
||||
\inmodule Qt3DScene2D
|
||||
\brief Internal namespace to import QML types.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class Qt3DRender::Quick::QScene2D
|
||||
\inheaderfile Qt3DQuickScene2D/QScene2D
|
||||
|
|
|
|||
|
|
@ -51,11 +51,6 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
namespace Qt3DRender {
|
||||
|
||||
/*!
|
||||
\namespace Qt3DRender::Quick
|
||||
|
||||
\brief Internal namespace to import QML types.
|
||||
*/
|
||||
namespace Quick {
|
||||
|
||||
class QScene2DPrivate;
|
||||
|
|
|
|||
|
|
@ -248,10 +248,10 @@ QJsonObject parameterPackToJson(const Render::ShaderParameterPack &pack)
|
|||
|
||||
const Render::PackUniformHash &uniforms = pack.uniforms();
|
||||
QJsonArray uniformsArray;
|
||||
for (auto it = uniforms.cbegin(), end = uniforms.cend(); it != end; ++it) {
|
||||
for (int i = 0, m = uniforms.keys.size(); i < m; ++i) {
|
||||
QJsonObject uniformObj;
|
||||
uniformObj.insert(QLatin1String("name"), Render::StringToInt::lookupString(it.key()));
|
||||
const Render::UniformValue::ValueType type = it.value().valueType();
|
||||
uniformObj.insert(QLatin1String("name"), Render::StringToInt::lookupString(uniforms.keys.at(i)));
|
||||
const Render::UniformValue::ValueType type = uniforms.values.at(i).valueType();
|
||||
uniformObj.insert(QLatin1String("type"),
|
||||
type == Render::UniformValue::ScalarValue
|
||||
? QLatin1String("value")
|
||||
|
|
|
|||
|
|
@ -227,9 +227,9 @@ public:
|
|||
return !(*this == other);
|
||||
}
|
||||
private:
|
||||
// Allocate 4 floats on stack
|
||||
// Allocate 16 floats on stack
|
||||
// For larger elements, heap allocation will be used
|
||||
QVarLengthArray<float, 4> m_data;
|
||||
QVarLengthArray<float, 16> m_data;
|
||||
|
||||
ValueType m_valueType = ScalarValue;
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ namespace Qt3DRender {
|
|||
|
||||
Specifies the interpolation applied if the image is stretched.
|
||||
|
||||
\value Nearest
|
||||
Nearest-neighbor interpolation.
|
||||
\value Linear
|
||||
Linear interpolation.
|
||||
*/
|
||||
/*!
|
||||
\property Qt3DRender::QBlitFramebuffer::destination
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ QSetFencePrivate::QSetFencePrivate()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QSetFence
|
||||
\class Qt3DRender::QSetFence
|
||||
\inmodule Qt3DRender
|
||||
\brief FrameGraphNode used to insert a fence in the graphics command stream.
|
||||
|
||||
Fence allow to synchronosize GPU and CPU workloads. GPU commands usually
|
||||
|
|
@ -100,7 +101,7 @@ QSetFence::QSetFence(QSetFencePrivate &dd, Qt3DCore::QNode *parent)
|
|||
are supported.
|
||||
*/
|
||||
/*!
|
||||
\property QSetFence::handleType
|
||||
\property Qt3DRender::QSetFence::handleType
|
||||
|
||||
Specifies the type of handle being used. Currently only OpenGL Fence ids
|
||||
are supported.
|
||||
|
|
@ -123,12 +124,12 @@ void QSetFencePrivate::setHandleType(QSetFence::HandleType type)
|
|||
}
|
||||
|
||||
/*!
|
||||
\qmlproperty variant AbstractFence::handle
|
||||
\qmlproperty variant SetFence::handle
|
||||
|
||||
Holds the underlying fence handle wrapped in a variant.
|
||||
*/
|
||||
/*!
|
||||
\property QAbstractFence::handle
|
||||
\property Qt3DRender::QSetFence::handle
|
||||
|
||||
Holds the underlying fence handle wrapped in a QVariant.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ QWaitFencePrivate::QWaitFencePrivate()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QWaitFence
|
||||
|
||||
\class Qt3DRender::QWaitFence
|
||||
\inmodule Qt3DRender
|
||||
\brief FrameGraphNode used to wait for a fence in the graphics command
|
||||
stream to become signaled.
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ QWaitFence::~QWaitFence()
|
|||
become signaled. This is false by default.
|
||||
*/
|
||||
/*!
|
||||
\property QWaitFence::waitOnCPU
|
||||
\property Qt3DRender::QWaitFence::waitOnCPU
|
||||
|
||||
Specifies whether the CPU should be block while waiting for the fence to
|
||||
become signaled. This is false by default.
|
||||
|
|
@ -125,7 +125,7 @@ void QWaitFence::setWaitOnCPU(bool waitOnCPU)
|
|||
to become signaled.
|
||||
*/
|
||||
/*!
|
||||
\property QWaitFence::timeout
|
||||
\property Qt3DRender::QWaitFence::timeout
|
||||
|
||||
Specifies the maximum amount of time in nanoseconds to wait for the fence
|
||||
to become signaled.
|
||||
|
|
@ -157,7 +157,7 @@ QWaitFence::QWaitFence(QWaitFencePrivate &dd, Qt3DCore::QNode *parent)
|
|||
are supported.
|
||||
*/
|
||||
/*!
|
||||
\property QWaitFence::handleType
|
||||
\property Qt3DRender::QWaitFence::handleType
|
||||
|
||||
Specifies the type of handle being used. Currently only OpenGL Fence ids
|
||||
are supported.
|
||||
|
|
@ -183,7 +183,7 @@ void QWaitFence::setHandleType(QWaitFence::HandleType type)
|
|||
Holds the underlying fence handle wrapped in a variant.
|
||||
*/
|
||||
/*!
|
||||
\property QWaitFence::handle
|
||||
\property Qt3DRender::QWaitFence::handle
|
||||
|
||||
Holds the underlying fence handle wrapped in a QVariant.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ void QCameraPrivate::updateViewMatrixAndTransform(bool doEmit)
|
|||
* \qmlmethod void Qt3D.Render::Camera::viewEntity(Entity entity)
|
||||
*
|
||||
* Rotates and moves the camera so that it's viewCenter is the center of the entity's bounding volume
|
||||
* and the entire entity fits in the view port.
|
||||
* and the entire \a entity fits in the view port.
|
||||
*
|
||||
* \note Only works if the lens is in perspective projection mode.
|
||||
* \sa Qt3D.Render::Camera::projectionType
|
||||
|
|
|
|||
|
|
@ -92,15 +92,15 @@ namespace Qt3DRender {
|
|||
*/
|
||||
|
||||
/*!
|
||||
\qmlproperty QComputeCommand::runType
|
||||
\qmlproperty enumeration ComputeCommand::runType
|
||||
|
||||
Specifies whether the compute command should be performed every frame or
|
||||
manually triggered.
|
||||
|
||||
\value Continuous Compute command is executed everyframe. This is the
|
||||
\value ComputeCommand.Continuous Compute command is executed everyframe. This is the
|
||||
default.
|
||||
|
||||
\value Manual CompouteCommand is executed for a given number of frames and
|
||||
\value ComputeCommand.Manual CompouteCommand is executed for a given number of frames and
|
||||
then the component disables itself.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -170,10 +170,8 @@
|
|||
#include <Qt3DCore/QAspectEngine>
|
||||
#include <Qt3DCore/private/qservicelocator_p.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QOffscreenSurface>
|
||||
#include <QThread>
|
||||
#include <QWindow>
|
||||
#include <QOpenGLContext>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -202,11 +200,16 @@ QRenderAspectPrivate::QRenderAspectPrivate(QRenderAspect::RenderType type)
|
|||
, m_nodeManagers(nullptr)
|
||||
, m_renderer(nullptr)
|
||||
, m_initialized(false)
|
||||
, m_renderAfterJobs(false)
|
||||
, m_renderType(type)
|
||||
, m_offscreenHelper(nullptr)
|
||||
{
|
||||
m_instances.append(this);
|
||||
loadSceneParsers();
|
||||
if (m_renderType == QRenderAspect::Threaded && !QOpenGLContext::supportsThreadedOpenGL()) {
|
||||
m_renderType = QRenderAspect::Synchronous;
|
||||
m_renderAfterJobs = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*! \internal */
|
||||
|
|
@ -239,6 +242,12 @@ void QRenderAspectPrivate::syncDirtyFrontEndNode(QNode *node, QBackendNode *back
|
|||
renderBackend->syncFromFrontEnd(node, firstTime);
|
||||
}
|
||||
|
||||
void QRenderAspectPrivate::jobsDone()
|
||||
{
|
||||
if (m_renderAfterJobs)
|
||||
m_renderer->doRender(true);
|
||||
}
|
||||
|
||||
/*! \internal */
|
||||
void QRenderAspectPrivate::registerBackendTypes()
|
||||
{
|
||||
|
|
@ -539,6 +548,8 @@ QVariant QRenderAspect::executeCommand(const QStringList &args)
|
|||
void QRenderAspect::onEngineStartup()
|
||||
{
|
||||
Q_D(QRenderAspect);
|
||||
if (d->m_renderAfterJobs) // synchronous rendering but using QWindow
|
||||
d->m_renderer->initialize();
|
||||
Render::NodeManagers *managers = d->m_renderer->nodeManagers();
|
||||
Render::Entity *rootEntity = managers->lookupResource<Render::Entity, Render::EntityManager>(rootEntityId());
|
||||
Q_ASSERT(rootEntity);
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ public:
|
|||
static QRenderAspectPrivate* findPrivate(Qt3DCore::QAspectEngine *engine);
|
||||
|
||||
void syncDirtyFrontEndNode(Qt3DCore::QNode *node, Qt3DCore::QBackendNode *backend, bool firstTime) const override;
|
||||
void jobsDone() override;
|
||||
|
||||
void registerBackendTypes();
|
||||
void unregisterBackendTypes();
|
||||
|
|
@ -101,6 +102,7 @@ public:
|
|||
Render::AbstractRenderer *m_renderer;
|
||||
|
||||
bool m_initialized;
|
||||
bool m_renderAfterJobs;
|
||||
QList<QSceneImporter *> m_sceneImporter;
|
||||
QVector<QString> m_loadedPlugins;
|
||||
QVector<Render::QRenderPlugin *> m_renderPlugins;
|
||||
|
|
|
|||
|
|
@ -147,17 +147,6 @@ void QMeshPrivate::setStatus(QMesh::Status status)
|
|||
* \sa QRegularExpression
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum QMesh::Status
|
||||
|
||||
This enum identifies the status of shader used.
|
||||
|
||||
\value None A source mesh hasn't been assigned a source yet
|
||||
\value Loading The mesh geometry is loading
|
||||
\value Ready The mesh geometry was successfully loaded
|
||||
\value Error An error occurred while loading the mesh
|
||||
*/
|
||||
|
||||
/*!
|
||||
\qmlproperty enumeration Mesh::status
|
||||
|
||||
|
|
@ -196,6 +185,17 @@ void QMeshPrivate::setStatus(QMesh::Status status)
|
|||
* \sa Qt3DRender::QSceneLoader
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum Qt3DRender::QMesh::Status
|
||||
|
||||
This enum identifies the status of shader used.
|
||||
|
||||
\value None A source mesh hasn't been assigned a source yet
|
||||
\value Loading The mesh geometry is loading
|
||||
\value Ready The mesh geometry was successfully loaded
|
||||
\value Error An error occurred while loading the mesh
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Constructs a new QMesh with \a parent.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ QStringList QSceneLoader::entityNames() const
|
|||
|
||||
/*!
|
||||
\qmlmethod Entity SceneLoader::component(string entityName, enumeration componentType)
|
||||
Returns a component matching \a componentType of a loaded entity with an \a objectName matching
|
||||
Returns a component matching \a componentType of a loaded entity with an \e objectName matching
|
||||
the \a entityName.
|
||||
If the entity has multiple matching components, the first match in the component list of
|
||||
the entity is returned.
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ void FilterProximityDistanceJob::run()
|
|||
// Fill m_filteredEntities
|
||||
// If no filtering needs to be done, this will be the output value
|
||||
// otherwise it will be used as the base list of entities to filter
|
||||
selectAllEntities();
|
||||
|
||||
if (hasProximityFilter()) {
|
||||
selectAllEntities();
|
||||
QVector<Entity *> entitiesToFilter = std::move(m_filteredEntities);
|
||||
FrameGraphManager *frameGraphManager = m_manager->frameGraphManager();
|
||||
EntityManager *entityManager = m_manager->renderNodesManager();
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ QShaderImagePrivate::~QShaderImagePrivate()
|
|||
*/
|
||||
|
||||
/*!
|
||||
\qmlproperty Qt3DRender::QShaderImage::mipLevel
|
||||
\qmlproperty int Qt3D.Render::ShaderImage::mipLevel
|
||||
|
||||
Holds which mipLevel out of the referenced texture should be used for the
|
||||
ShaderImage.
|
||||
|
|
@ -351,7 +351,7 @@ QShaderImagePrivate::~QShaderImagePrivate()
|
|||
*/
|
||||
|
||||
/*!
|
||||
\qmlproperty Qt3DRender::QShaderImage::layer
|
||||
\qmlproperty int Qt3D.Render::ShaderImage::layer
|
||||
|
||||
Holds which layer out of the referenced texture should be used for the
|
||||
ShaderImage. This property does nothing if \a layered is set to true or if
|
||||
|
|
@ -365,11 +365,11 @@ QShaderImagePrivate::~QShaderImagePrivate()
|
|||
cubeMapFace = layer - (cubeMapLayer * 6)
|
||||
\endcode
|
||||
|
||||
\default 0
|
||||
Default value is 0.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \qmlproperty Qt3DRender::QShaderImage::layered
|
||||
* \qmlproperty bool Qt3D.Render::ShaderImage::layered
|
||||
|
||||
If set to true, if the referenced texture is a one-dimensional array,
|
||||
two-dimensional array, three-dimensional, cube map, cube map array, or
|
||||
|
|
@ -377,21 +377,28 @@ QShaderImagePrivate::~QShaderImagePrivate()
|
|||
for all layers. If set to false, only the single layer specified by the \a
|
||||
layer property will be bound.
|
||||
|
||||
\default false
|
||||
Default value is \c false.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\qmlproperty Qt3DRender::QShaderImage::access
|
||||
\qmlproperty enumeration Qt3D.Render::ShaderImage::access
|
||||
|
||||
Specifies the type of access we want to allow from our shader instances to
|
||||
the image. If a shader tries to write or read from an image that has
|
||||
incompatible access, the behavior is undefined.
|
||||
|
||||
\default ShaderImage.ReadWrite
|
||||
\value ShaderImage.ReadOnly
|
||||
Read-only access.
|
||||
\value ShaderImage.WriteOnly
|
||||
Write-only access.
|
||||
\value ShaderImage.ReadWrite
|
||||
Read-write access.
|
||||
|
||||
Default value is ShaderImage.ReadWrite.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\qmlproperty Qt3DRender::QShaderImage::format
|
||||
\qmlproperty enumeration Qt3D.Render::ShaderImage::format
|
||||
|
||||
Specifies the image format, which is essentially important when storing values
|
||||
in the ShaderImage from a shader.
|
||||
|
|
@ -407,7 +414,7 @@ QShaderImagePrivate::~QShaderImagePrivate()
|
|||
By default Qt3D will try to set the image format to match that of the
|
||||
referenced texture.
|
||||
|
||||
\default ShaderImage.Automatic
|
||||
Default value is ShaderImage.Automatic.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -244,13 +244,13 @@ void Shader::prepareUniforms(ShaderParameterPack &pack)
|
|||
{
|
||||
const PackUniformHash &values = pack.uniforms();
|
||||
|
||||
auto it = values.cbegin();
|
||||
const auto end = values.cend();
|
||||
auto it = values.keys.cbegin();
|
||||
const auto end = values.keys.cend();
|
||||
|
||||
while (it != end) {
|
||||
// Find if there's a uniform with the same name id
|
||||
for (const ShaderUniform &uniform : qAsConst(m_uniforms)) {
|
||||
if (uniform.m_nameId == it.key()) {
|
||||
if (uniform.m_nameId == *it) {
|
||||
pack.setSubmissionUniform(uniform);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,10 +58,6 @@ QAbstractRayCasterPrivate::QAbstractRayCasterPrivate()
|
|||
m_shareable = false;
|
||||
}
|
||||
|
||||
/*!
|
||||
\property Qt3DRender::QAbstractRayCaster::Hits
|
||||
*/
|
||||
|
||||
QAbstractRayCasterPrivate *QAbstractRayCasterPrivate::get(QAbstractRayCaster *obj)
|
||||
{
|
||||
return obj->d_func();
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ namespace Qt3DRender {
|
|||
|
||||
This signal is emitted when the bounding volume defined by the
|
||||
pickAttribute property intersects with a ray on a mouse click. Intersection
|
||||
information are accessible through the pick \a parameter.
|
||||
information are accessible through the \a pick parameter.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -1171,7 +1171,7 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack)
|
|||
if (uniformValues.contains(namedTex.glslNameId)) {
|
||||
GLTexture *t = manager->glTextureManager()->lookupResource(namedTex.nodeId);
|
||||
if (t != nullptr) {
|
||||
UniformValue &texUniform = uniformValues[namedTex.glslNameId];
|
||||
UniformValue &texUniform = uniformValues.value(namedTex.glslNameId);
|
||||
if (texUniform.valueType() == UniformValue::TextureValue) {
|
||||
const int texUnit = m_textureContext.activateTexture(TextureSubmissionContext::TextureScopeMaterial, m_gl, t);
|
||||
texUniform.data<int>()[namedTex.uniformArrayIndex] = texUnit;
|
||||
|
|
@ -1201,7 +1201,7 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack)
|
|||
qCWarning(Backend) << "Shader Image referencing invalid texture";
|
||||
continue;
|
||||
} else {
|
||||
UniformValue &imgUniform = uniformValues[namedTex.glslNameId];
|
||||
UniformValue &imgUniform = uniformValues.value(namedTex.glslNameId);
|
||||
if (imgUniform.valueType() == UniformValue::ShaderImageValue) {
|
||||
const int imgUnit = m_imageContext.activateImage(img, t);
|
||||
imgUniform.data<int>()[namedTex.uniformArrayIndex] = imgUnit;
|
||||
|
|
@ -1260,7 +1260,7 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack)
|
|||
for (const ShaderUniform &uniform : activeUniforms) {
|
||||
// We can use [] as we are sure the the uniform wouldn't
|
||||
// be un activeUniforms if there wasn't a matching value
|
||||
const UniformValue &v = values[uniform.m_nameId];
|
||||
const UniformValue &v = values.value(uniform.m_nameId);
|
||||
|
||||
// skip invalid textures/images
|
||||
if ((v.valueType() == UniformValue::TextureValue ||
|
||||
|
|
|
|||
|
|
@ -552,10 +552,8 @@ void RenderView::sort()
|
|||
// We need the reference here as we are modifying the original container
|
||||
// not the copy
|
||||
PackUniformHash &uniforms = m_commands[j].m_parameterPack.m_uniforms;
|
||||
PackUniformHash::iterator it = uniforms.begin();
|
||||
const PackUniformHash::iterator end = uniforms.end();
|
||||
|
||||
while (it != end) {
|
||||
for (int u = 0; u < uniforms.keys.size();) {
|
||||
// We are comparing the values:
|
||||
// - raw uniform values
|
||||
// - the texture Node id if the uniform represents a texture
|
||||
|
|
@ -563,15 +561,17 @@ void RenderView::sort()
|
|||
// sharing the same material (shader) are rendered, we can't have the case
|
||||
// where two uniforms, referencing the same texture eventually have 2 different
|
||||
// texture unit values
|
||||
const UniformValue refValue = cachedUniforms.value(it.key());
|
||||
if (it.value() == refValue) {
|
||||
it = uniforms.erase(it);
|
||||
const int uniformNameId = uniforms.keys.at(u);
|
||||
const UniformValue &refValue = cachedUniforms.value(uniformNameId);
|
||||
const UniformValue &newValue = uniforms.values.at(u);
|
||||
if (newValue == refValue) {
|
||||
uniforms.erase(u);
|
||||
} else {
|
||||
// Record updated value so that subsequent comparison
|
||||
// for the next command will be made againts latest
|
||||
// uniform value
|
||||
cachedUniforms.insert(it.key(), it.value());
|
||||
++it;
|
||||
cachedUniforms.insert(uniformNameId, newValue);
|
||||
++u;
|
||||
}
|
||||
}
|
||||
++j;
|
||||
|
|
|
|||
|
|
@ -310,7 +310,8 @@ public:
|
|||
if (rv->frustumCulling())
|
||||
renderableEntities = RenderViewBuilder::entitiesInSubset(renderableEntities, m_frustumCullingJob->visibleEntities());
|
||||
// Filter out entities which didn't satisfy proximity filtering
|
||||
renderableEntities = RenderViewBuilder::entitiesInSubset(renderableEntities, m_filterProximityJob->filteredEntities());
|
||||
if (!rv->proximityFilterIds().empty())
|
||||
renderableEntities = RenderViewBuilder::entitiesInSubset(renderableEntities, m_filterProximityJob->filteredEntities());
|
||||
}
|
||||
|
||||
// Filter out Render commands for which the Entity wasn't selected because
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ namespace Render {
|
|||
|
||||
ShaderParameterPack::~ShaderParameterPack()
|
||||
{
|
||||
m_uniforms.clear();
|
||||
}
|
||||
|
||||
void ShaderParameterPack::setUniform(const int glslNameId, const UniformValue &val)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,56 @@ struct BlockToSSBO {
|
|||
QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, BlockToSSBO, Q_PRIMITIVE_TYPE)
|
||||
|
||||
|
||||
typedef QHash<int, UniformValue> PackUniformHash;
|
||||
struct PackUniformHash
|
||||
{
|
||||
QVector<int> keys;
|
||||
QVector<UniformValue> values;
|
||||
|
||||
PackUniformHash()
|
||||
{
|
||||
keys.reserve(10);
|
||||
values.reserve(10);
|
||||
}
|
||||
|
||||
void insert(int key, const UniformValue &value)
|
||||
{
|
||||
const int idx = keys.indexOf(key);
|
||||
if (idx != -1) {
|
||||
values[idx] = value;
|
||||
} else {
|
||||
keys.push_back(key);
|
||||
values.push_back(value);
|
||||
}
|
||||
}
|
||||
|
||||
UniformValue value(int key) const
|
||||
{
|
||||
const int idx = keys.indexOf(key);
|
||||
if (idx != -1)
|
||||
return values.at(idx);
|
||||
return UniformValue();
|
||||
}
|
||||
|
||||
UniformValue& value(int key)
|
||||
{
|
||||
const int idx = keys.indexOf(key);
|
||||
if (idx != -1)
|
||||
return values[idx];
|
||||
insert(key, UniformValue());
|
||||
return value(key);
|
||||
}
|
||||
|
||||
void erase(int idx)
|
||||
{
|
||||
keys.removeAt(idx);
|
||||
values.removeAt(idx);
|
||||
}
|
||||
|
||||
bool contains(int key) const
|
||||
{
|
||||
return keys.contains(key);
|
||||
}
|
||||
};
|
||||
|
||||
class Q_AUTOTEST_EXPORT ShaderParameterPack
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace Qt3DRender {
|
|||
/*!
|
||||
\class Qt3DRender::QRasterMode
|
||||
\brief The QRasterMode render state allows to control the type of
|
||||
rasterization to be performed
|
||||
rasterization to be performed.
|
||||
\since 5.14
|
||||
\inmodule Qt3DRender
|
||||
\ingroup renderstates
|
||||
|
|
@ -65,7 +65,7 @@ namespace Qt3DRender {
|
|||
/*!
|
||||
\qmltype RasterMode
|
||||
\brief The RasterMode render state allows to control the type of
|
||||
rasterization to be performed
|
||||
rasterization to be performed.
|
||||
\since 5.14
|
||||
\inqmlmodule Qt3D.Render
|
||||
\inherits RenderState
|
||||
|
|
|
|||
|
|
@ -977,7 +977,7 @@ float QAbstractTexture::maximumAnisotropy() const
|
|||
}
|
||||
|
||||
/*!
|
||||
\property Qt3DRender::QAbstractTexture::ComparisonFunction
|
||||
\property Qt3DRender::QAbstractTexture::comparisonFunction
|
||||
|
||||
Holds the comparison function of the texture provider.
|
||||
*/
|
||||
|
|
@ -1008,7 +1008,7 @@ QAbstractTexture::ComparisonFunction QAbstractTexture::comparisonFunction() cons
|
|||
}
|
||||
|
||||
/*!
|
||||
\property Qt3DRender::QAbstractTexture::ComparisonMode
|
||||
\property Qt3DRender::QAbstractTexture::comparisonMode
|
||||
|
||||
Holds the comparison mode of the texture provider.
|
||||
*/
|
||||
|
|
@ -1055,9 +1055,12 @@ QTextureGeneratorPtr QAbstractTexture::dataGenerator() const
|
|||
*/
|
||||
|
||||
/*!
|
||||
* \qmlproperty handleType
|
||||
* \qmlproperty enumeration AbstractTexture::handleType
|
||||
*
|
||||
* Holds the current texture handle type.
|
||||
*
|
||||
* \value AbstractTexture.NoHandle
|
||||
* \value AbstractTexture.OpenGLTextureId
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
@ -1070,7 +1073,6 @@ QAbstractTexture::HandleType QAbstractTexture::handleType() const
|
|||
return d->m_handleType;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* \property Qt3DRender::QAbstractTexture::handle
|
||||
*
|
||||
|
|
@ -1079,7 +1081,7 @@ QAbstractTexture::HandleType QAbstractTexture::handleType() const
|
|||
*/
|
||||
|
||||
/*!
|
||||
* \qmlproperty handle
|
||||
* \qmlproperty var AbstractTexture::handle
|
||||
*
|
||||
* Holds the current texture handle, if Qt 3D is using the OpenGL renderer,
|
||||
* handle is a texture id integer.
|
||||
|
|
@ -1098,8 +1100,8 @@ QVariant QAbstractTexture::handle() const
|
|||
}
|
||||
|
||||
/*!
|
||||
* Allow to update a sub region of the texture without having to change the data
|
||||
* generator or rely on adding or removing texture images.
|
||||
* Updates a sub region of the texture, defined by \a update, without having
|
||||
* to change the data generator or rely on adding or removing texture images.
|
||||
* \since 5.14
|
||||
*/
|
||||
void QAbstractTexture::updateData(const QTextureDataUpdate &update)
|
||||
|
|
@ -1135,7 +1137,7 @@ Qt3DCore::QNodeCreatedChangeBasePtr QAbstractTexture::createNodeCreationChange()
|
|||
data.dataFunctor = d->m_dataFunctor;
|
||||
data.sharedTextureId = d->m_sharedTextureId;
|
||||
data.initialDataUpdates = d->m_pendingDataUpdates;
|
||||
return std::move(creationChange);
|
||||
return creationChange;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -131,8 +131,8 @@ QTextureImageDataGeneratorPtr QAbstractTextureImagePrivate::dataGenerator() cons
|
|||
/*!
|
||||
\fn Qt3DRender::QTextureImageDataGeneratorPtr Qt3DRender::QAbstractTextureImage::dataGenerator() const
|
||||
|
||||
Implement this method to return the \l QTextureImageDataGeneratorPtr, which will
|
||||
provide the data for the texture image.
|
||||
Implement this method to return the QTextureImageDataGeneratorPtr instance,
|
||||
which will provide the data for the texture image.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ QTextureGenerator::~QTextureGenerator()
|
|||
}
|
||||
|
||||
/*!
|
||||
\class QTextureGenerator
|
||||
\inherits QAbstractFunctor
|
||||
\class Qt3DRender::QTextureGenerator
|
||||
\inmodule Qt3DRender
|
||||
\brief Provides the image data for a texture.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -117,14 +117,20 @@ private Q_SLOTS:
|
|||
|
||||
{
|
||||
Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity();
|
||||
Qt3DCore::QEntity *childEntity1 = new Qt3DCore::QEntity(rootEntity);
|
||||
Qt3DCore::QEntity *childEntity2 = new Qt3DCore::QEntity(rootEntity);
|
||||
Qt3DCore::QEntity *childEntity3 = new Qt3DCore::QEntity(rootEntity);
|
||||
Qt3DCore::QEntity *targetEntity = new Qt3DCore::QEntity(rootEntity);
|
||||
Qt3DCore::QEntity *childEntity1 = buildEntityAtDistance(50.0f, rootEntity);
|
||||
Qt3DCore::QEntity *childEntity2 = buildEntityAtDistance(25.0f, rootEntity);
|
||||
Qt3DCore::QEntity *childEntity3 = buildEntityAtDistance(75.0f, rootEntity);
|
||||
|
||||
Qt3DRender::QProximityFilter *proximityFilter = new Qt3DRender::QProximityFilter(rootEntity);
|
||||
proximityFilter->setDistanceThreshold(200.0f);
|
||||
proximityFilter->setEntity(targetEntity);
|
||||
|
||||
QTest::newRow("ShouldSelectAll") << rootEntity
|
||||
<< Qt3DCore::QNodeIdVector()
|
||||
<< (Qt3DCore::QNodeIdVector() << proximityFilter->id())
|
||||
<< (Qt3DCore::QNodeIdVector()
|
||||
<< rootEntity->id()
|
||||
<< targetEntity->id()
|
||||
<< childEntity1->id()
|
||||
<< childEntity2->id()
|
||||
<< childEntity3->id()
|
||||
|
|
|
|||
|
|
@ -51,16 +51,11 @@ void compareShaderParameterPacks(const ShaderParameterPack &t1,
|
|||
const PackUniformHash hash1 = t1.uniforms();
|
||||
const PackUniformHash hash2 = t2.uniforms();
|
||||
|
||||
QCOMPARE(hash1.size(), hash2.size());
|
||||
QCOMPARE(hash1.keys.size(), hash2.keys.size());
|
||||
|
||||
auto it = hash1.constBegin();
|
||||
const auto end = hash1.constEnd();
|
||||
|
||||
while (it != end) {
|
||||
const auto h2It = hash2.find(it.key());
|
||||
QVERIFY(h2It != hash2.cend());
|
||||
QCOMPARE(it.value(), h2It.value());
|
||||
++it;
|
||||
for (int i = 0, m = hash1.keys.size(); i < m; ++i) {
|
||||
const int key = hash1.keys.at(i);
|
||||
QCOMPARE(hash1.value(key), hash2.value(key));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ private Q_SLOTS:
|
|||
QCOMPARE(v.constData<float>()[0], 572.0f);
|
||||
QCOMPARE(v.constData<float>()[1], 355.0f);
|
||||
QCOMPARE(v.constData<float>()[2], 383.0f);
|
||||
QCOMPARE(v.constData<float>()[4], 0.0f);
|
||||
QCOMPARE(v.constData<float>()[3], 0.0f);
|
||||
}
|
||||
{
|
||||
// GIVEN
|
||||
|
|
|
|||
Loading…
Reference in New Issue