Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qt6-quick3dphysics for openSUSE:Factory checked in at 2025-10-13 17:26:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qt6-quick3dphysics (Old) and /work/SRC/openSUSE:Factory/.qt6-quick3dphysics.new.18484 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qt6-quick3dphysics" Mon Oct 13 17:26:57 2025 rev:24 rq:1310357 version:6.10.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qt6-quick3dphysics/qt6-quick3dphysics.changes 2025-08-29 18:36:59.674643617 +0200 +++ /work/SRC/openSUSE:Factory/.qt6-quick3dphysics.new.18484/qt6-quick3dphysics.changes 2025-10-13 17:33:18.390285603 +0200 @@ -1,0 +2,6 @@ +Tue Oct 7 08:53:27 UTC 2025 - Christophe Marin <[email protected]> + +- Update to 6.10.0 + * https://www.qt.io/blog/qt-6.10-released + +------------------------------------------------------------------- Old: ---- qtquick3dphysics-everywhere-src-6.9.2.tar.xz New: ---- qtquick3dphysics-everywhere-src-6.10.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qt6-quick3dphysics.spec ++++++ --- /var/tmp/diff_new_pack.AewLhE/_old 2025-10-13 17:33:19.014311922 +0200 +++ /var/tmp/diff_new_pack.AewLhE/_new 2025-10-13 17:33:19.018312091 +0200 @@ -16,8 +16,8 @@ # -%define real_version 6.9.2 -%define short_version 6.9 +%define real_version 6.10.0 +%define short_version 6.10 %define tar_name qtquick3dphysics-everywhere-src %define tar_suffix %{nil} # @@ -27,7 +27,7 @@ %endif # Name: qt6-quick3dphysics%{?pkg_suffix} -Version: 6.9.2 +Version: 6.10.0 Release: 0 Summary: Qt 6 Quick3D Physics Extensions License: GPL-3.0-only @@ -177,7 +177,7 @@ %{_qt6_includedir}/QtQuick3DPhysics/ %{_qt6_libdir}/libQt6Quick3DPhysics.prl %{_qt6_libdir}/libQt6Quick3DPhysics.so -%{_qt6_metatypesdir}/qt6quick3dphysics_*_metatypes.json +%{_qt6_metatypesdir}/qt6quick3dphysics_metatypes.json %{_qt6_mkspecsdir}/modules/qt_lib_quick3dphysics.pri %{_qt6_pkgconfigdir}/Qt6Quick3DPhysics.pc %exclude %{_qt6_includedir}/QtQuick3DPhysics/%{real_version} @@ -199,7 +199,7 @@ %{_qt6_includedir}/QtQuick3DPhysicsHelpers/ %{_qt6_libdir}/libQt6Quick3DPhysicsHelpers.prl %{_qt6_libdir}/libQt6Quick3DPhysicsHelpers.so -%{_qt6_metatypesdir}/qt6quick3dphysicshelpers_*_metatypes.json +%{_qt6_metatypesdir}/qt6quick3dphysicshelpers_metatypes.json %{_qt6_mkspecsdir}/modules/qt_lib_quick3dphysicshelpers.pri %{_qt6_mkspecsdir}/modules/qt_lib_quick3dphysicshelpers_private.pri %{_qt6_pkgconfigdir}/Qt6Quick3DPhysicsHelpers.pc ++++++ qtquick3dphysics-everywhere-src-6.9.2.tar.xz -> qtquick3dphysics-everywhere-src-6.10.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/.cmake.conf new/qtquick3dphysics-everywhere-src-6.10.0/.cmake.conf --- old/qtquick3dphysics-everywhere-src-6.9.2/.cmake.conf 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/.cmake.conf 2025-10-02 02:56:07.000000000 +0200 @@ -1,4 +1,4 @@ -set(QT_REPO_MODULE_VERSION "6.9.2") +set(QT_REPO_MODULE_VERSION "6.10.0") set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1") list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1") list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_CONTEXTLESS_CONNECT=1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/.tag new/qtquick3dphysics-everywhere-src-6.10.0/.tag --- old/qtquick3dphysics-everywhere-src-6.9.2/.tag 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/.tag 2025-10-02 02:56:07.000000000 +0200 @@ -1 +1 @@ -08477af8c59fde102a0dd430598f646464b85ba5 +272129cfeb29502a5d1a38ec0f0012a81e9968dd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/dependencies.yaml new/qtquick3dphysics-everywhere-src-6.10.0/dependencies.yaml --- old/qtquick3dphysics-everywhere-src-6.9.2/dependencies.yaml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/dependencies.yaml 2025-10-02 02:56:07.000000000 +0200 @@ -1,13 +1,13 @@ dependencies: ../qtbase: - ref: 6f0d27d2e4ba5fa6562f738aaaf8eaf98ebf51e7 + ref: 5a8637e4516bc48a0b3f4b5ec3b18618b92e7222 required: true ../qtdeclarative: - ref: b653aebb2175203d86199b1d320fd10f939df3fc + ref: 7e0ab1d98c159c9f4c9afab78b43e7c70f449e41 required: true ../qtquick3d: - ref: c0e283245d524cde9be26ac8db1621b50e6833ab + ref: ede89c1c2d4d423c702692b645c52eca9cbfaa4c required: true ../qtshadertools: - ref: e8d800aa5ac2234f493d038591a69b99f2a55ebc + ref: 7b064b6e4fb2e57a6f78666532382bbb5e38be91 required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/charactercontroller/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/charactercontroller/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/charactercontroller/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/charactercontroller/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -5,7 +5,6 @@ import QtQuick3D import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers as Helpers Window { width: 1280 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/mass/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/mass/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/mass/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/mass/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -4,7 +4,6 @@ import QtQuick3D import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers Window { width: 640 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/simple/doc/src/qtquick3dphysics-examples-simple.qdoc new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/simple/doc/src/qtquick3dphysics-examples-simple.qdoc --- old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/simple/doc/src/qtquick3dphysics-examples-simple.qdoc 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/simple/doc/src/qtquick3dphysics-examples-simple.qdoc 2025-10-02 02:56:07.000000000 +0200 @@ -84,5 +84,5 @@ \snippet simple/main.qml capsule We create a capsule by making a DynamicRigidBody node and a single CapsuleShape in \l {PhysicsNode::} {collisionShapes}. - We build a capsule model by using the built-in CapsuleGeometry provided by Qt Quick 3D Physics. + We build a capsule model by using the built-in CapsuleGeometry provided by Qt Quick 3D. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/simple/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/simple/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/examples/quick3dphysics/simple/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/examples/quick3dphysics/simple/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -2,8 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause import QtQuick import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers Window { width: 640 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/helpers/qcapsulegeometry.cpp new/qtquick3dphysics-everywhere-src-6.10.0/src/helpers/qcapsulegeometry.cpp --- old/qtquick3dphysics-everywhere-src-6.9.2/src/helpers/qcapsulegeometry.cpp 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/helpers/qcapsulegeometry.cpp 2025-10-02 02:56:07.000000000 +0200 @@ -16,6 +16,9 @@ \inherits Geometry \since 6.4 \brief A geometry for generating a capsule model. + \deprecated [6.10] + + Deprecated, use \l{QtQuick3D.Helpers.CapsuleGeometry}. A geometry for generating a capsule model. */ @@ -62,12 +65,12 @@ Diameter on the xz plane. */ -CapsuleGeometry::CapsuleGeometry() +CapsuleGeometryPhysics::CapsuleGeometryPhysics() { updateData(); } -void CapsuleGeometry::setEnableNormals(bool enable) +void CapsuleGeometryPhysics::setEnableNormals(bool enable) { if (m_enableNormals == enable) return; @@ -78,7 +81,7 @@ update(); } -void CapsuleGeometry::setEnableUV(bool enable) +void CapsuleGeometryPhysics::setEnableUV(bool enable) { if (m_enableUV == enable) return; @@ -89,7 +92,7 @@ update(); } -void CapsuleGeometry::setLongitudes(int longitudes) +void CapsuleGeometryPhysics::setLongitudes(int longitudes) { if (m_longitudes == longitudes) return; @@ -100,7 +103,7 @@ update(); } -void CapsuleGeometry::setLatitudes(int latitudes) +void CapsuleGeometryPhysics::setLatitudes(int latitudes) { if (m_latitudes == latitudes) return; @@ -111,7 +114,7 @@ update(); } -void CapsuleGeometry::setRings(int rings) +void CapsuleGeometryPhysics::setRings(int rings) { if (m_rings == rings) return; @@ -122,7 +125,7 @@ update(); } -void CapsuleGeometry::setHeight(float height) +void CapsuleGeometryPhysics::setHeight(float height) { if (m_height == height) return; @@ -133,7 +136,7 @@ update(); } -void CapsuleGeometry::setDiameter(float diameter) +void CapsuleGeometryPhysics::setDiameter(float diameter) { if (m_diameter == diameter) return; @@ -154,7 +157,7 @@ uint32_t normalIdx = 0; }; -void CapsuleGeometry::updateData() +void CapsuleGeometryPhysics::updateData() { clear(); @@ -292,13 +295,13 @@ // Determine UV aspect ratio from the profile. float vtAspectRatio = 0.f; switch (m_uvProfile) { - case CapsuleGeometry::UvProfile::Fixed: + case CapsuleGeometryPhysics::UvProfile::Fixed: vtAspectRatio = 0.33333333f; break; - case CapsuleGeometry::UvProfile::Aspect: + case CapsuleGeometryPhysics::UvProfile::Aspect: vtAspectRatio = verifRad / (verifDepth + verifRad + verifRad); break; - case CapsuleGeometry::UvProfile::Uniform: + case CapsuleGeometryPhysics::UvProfile::Uniform: vtAspectRatio = (float)halfLats / (verifRingsp1 + verifLats); break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/helpers/qcapsulegeometry_p.h new/qtquick3dphysics-everywhere-src-6.10.0/src/helpers/qcapsulegeometry_p.h --- old/qtquick3dphysics-everywhere-src-6.9.2/src/helpers/qcapsulegeometry_p.h 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/helpers/qcapsulegeometry_p.h 2025-10-02 02:56:07.000000000 +0200 @@ -19,7 +19,7 @@ QT_BEGIN_NAMESPACE -class CapsuleGeometry : public QQuick3DGeometry +class CapsuleGeometryPhysics : public QQuick3DGeometry { Q_OBJECT QML_NAMED_ELEMENT(CapsuleGeometry) @@ -34,7 +34,7 @@ Q_PROPERTY(float diameter READ diameter WRITE setDiameter NOTIFY diameterChanged) public: - CapsuleGeometry(); + CapsuleGeometryPhysics(); bool enableNormals() const { return m_enableNormals; } void setEnableNormals(bool enable); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/doc/src/qtquick3dphysics-index.qdoc new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/doc/src/qtquick3dphysics-index.qdoc --- old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/doc/src/qtquick3dphysics-index.qdoc 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/doc/src/qtquick3dphysics-index.qdoc 2025-10-02 02:56:07.000000000 +0200 @@ -70,6 +70,6 @@ Furthermore Qt Quick 3D Physics contains third party modules under the following permissive licenses: -\generatelist{groupsbymodule attributions-qtquick3dphysics} +\annotatedlist attributions-qtquick3dphysics */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qmeshshape.cpp new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qmeshshape.cpp --- old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qmeshshape.cpp 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qmeshshape.cpp 2025-10-02 02:56:07.000000000 +0200 @@ -4,8 +4,6 @@ #include "qcacheutils_p.h" #include "qmeshshape_p.h" -#include <QFile> -#include <QFileInfo> #include <QtQuick3D/QQuick3DGeometry> #include <extensions/PxExtensionsAPI.h> @@ -14,10 +12,10 @@ #include "extensions/PxDefaultStreams.h" #include <QtQml/qqml.h> -#include <QtQml/QQmlFile> #include <QtQml/qqmlcontext.h> #include <QtQuick3DUtils/private/qssgmesh_p.h> +#include <QtQuick3DRuntimeRender/private/qssgrenderbuffermanager_p.h> #include <QtQuick3D/QQuick3DGeometry> #include "qmeshshape_p.h" @@ -300,18 +298,16 @@ if (m_ssgMesh.isValid()) return; + // A bit ugly to use QSSGRenderPath here but it is just a wrapper for + // a QString and its hash. + // Security note: m_meshPath is a user provided file but QSSGBufferManager::loadMeshData is + // assumed to handle invalid meshes + m_ssgMesh = QSSGBufferManager::loadMeshData(QSSGRenderPath(m_meshPath)); + static const char *compTypes[] = { "Null", "UnsignedInt8", "Int8", "UnsignedInt16", "Int16", "UnsignedInt32", "Int32", "UnsignedInt64", "Int64", "Float16", "Float32", "Float64" }; - // Security note: m_meshPath is a user provided file but QSSGMesh::Mesh::loadMesh is - // assumed to handle invalid meshes - QFileInfo fileInfo = QFileInfo(m_meshPath); - if (fileInfo.exists()) { - QFile file(fileInfo.absoluteFilePath()); - if (file.open(QFile::ReadOnly)) - m_ssgMesh = QSSGMesh::Mesh::loadMesh(&file); - } qCDebug(lcQuick3dPhysics) << "Loaded SSG mesh from" << m_meshPath << m_ssgMesh.isValid() << "draw" << int(m_ssgMesh.drawMode()) << "wind" << int(m_ssgMesh.winding()) << "subs" << m_ssgMesh.subsets().count() @@ -365,12 +361,9 @@ qCWarning(lcQuick3dPhysics) << "Could not read mesh from" << m_meshPath; } -QQuick3DPhysicsMesh *QQuick3DPhysicsMeshManager::getMesh(const QUrl &source, - const QObject *contextObject) +QQuick3DPhysicsMesh *QQuick3DPhysicsMeshManager::getMesh(const QUrl &source, QObject *contextObject) { - const QQmlContext *context = qmlContext(contextObject); - const auto resolvedUrl = context ? context->resolvedUrl(source) : source; - const auto qmlSource = QQmlFile::urlToLocalFileOrQrc(resolvedUrl); + const QString qmlSource = QQuick3DModel::translateMeshSource(source, contextObject); auto *mesh = sourceMeshHash.value(qmlSource); if (!mesh) { mesh = new QQuick3DPhysicsMesh(qmlSource); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qphysicsmeshutils_p_p.h new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qphysicsmeshutils_p_p.h --- old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qphysicsmeshutils_p_p.h 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qphysicsmeshutils_p_p.h 2025-10-02 02:56:07.000000000 +0200 @@ -77,7 +77,7 @@ class QQuick3DPhysicsMeshManager { public: - static QQuick3DPhysicsMesh *getMesh(const QUrl &source, const QObject *contextObject); + static QQuick3DPhysicsMesh *getMesh(const QUrl &source, QObject *contextObject); static QQuick3DPhysicsMesh *getMesh(QQuick3DGeometry *source); static void releaseMesh(QQuick3DPhysicsMesh *mesh); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qphysicsworld.cpp new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qphysicsworld.cpp --- old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qphysicsworld.cpp 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qphysicsworld.cpp 2025-10-02 02:56:07.000000000 +0200 @@ -21,10 +21,11 @@ #include "PxPhysicsAPI.h" #include "cooking/PxCooking.h" +#include <QtQuick/private/qquickframeanimation_p.h> #include <QtQuick3D/private/qquick3dobject_p.h> #include <QtQuick3D/private/qquick3dnode_p.h> #include <QtQuick3D/private/qquick3dmodel_p.h> -#include <QtQuick3D/private/qquick3ddefaultmaterial_p.h> +#include <QtQuick3D/private/qquick3dprincipledmaterial_p.h> #include <QtQuick3DUtils/private/qssgutils_p.h> #include <QtGui/qquaternion.h> @@ -118,17 +119,27 @@ /*! \qmlproperty real PhysicsWorld::minimumTimestep This property defines the minimum simulation timestep in milliseconds. The default value is - \c 16.667 which corresponds to \c 60 frames per second. + \c{1}. Range: \c{[0, maximumTimestep]} + + \note The simulation timestep works in lockstep with the rendering, + meaning a new simulation frame will only be started after a rendered frame + has completed. This means that at most one simulation frame will run per + rendered frame. */ /*! \qmlproperty real PhysicsWorld::maximumTimestep This property defines the maximum simulation timestep in milliseconds. The default value is - \c 33.333 which corresponds to \c 30 frames per second. + \c{33.333}. Range: \c{[0, inf]} + + \note The simulation timestep works in lockstep with the rendering, + meaning a new simulation frame will only be started after a rendered frame + has completed. This means that at most one simulation frame will run per + rendered frame. */ /*! @@ -228,60 +239,16 @@ ///////////////////////////////////////////////////////////////////////////// -class SimulationWorker : public QObject +class FrameAnimator : public QQuickFrameAnimation { Q_OBJECT public: - SimulationWorker(QPhysXWorld *physx) : m_physx(physx) { } - QList<float> m_frameTimings; -public slots: - void simulateFrame(float minTimestep, float maxTimestep) + FrameAnimator() : QQuickFrameAnimation() { - if (!m_physx->isRunning) { - m_timer.start(); - m_physx->isRunning = true; - } - - // Assuming: 0 <= minTimestep <= maxTimestep - - constexpr auto MILLIONTH = 0.000001; - - // If not enough time has elapsed we sleep until it has - auto deltaMS = m_timer.nsecsElapsed() * MILLIONTH; - while (deltaMS < minTimestep) { - auto sleepUSecs = (minTimestep - deltaMS) * 1000.f; - QThread::usleep(sleepUSecs); - deltaMS = m_timer.nsecsElapsed() * MILLIONTH; - } - m_timer.restart(); - - auto deltaSecs = qMin(float(deltaMS), maxTimestep) * 0.001f; - m_physx->scene->simulate(deltaSecs); - m_physx->scene->fetchResults(true); - - if (Q_UNLIKELY(!qtPhysicsTimingsFile.isEmpty())) { - m_frameTimings.append(m_timer.nsecsElapsed() * MILLIONTH); - } - - emit frameDone(deltaSecs); - } - - void simulateFrameDesignStudio(float minTimestep, float maxTimestep) - { - Q_UNUSED(minTimestep); - Q_UNUSED(maxTimestep); - auto sleepUSecs = 16 * 1000.f; // 16 ms - QThread::usleep(sleepUSecs); - emit frameDoneDesignStudio(); + // Needed to start the frame animation + classBegin(); + componentComplete(); } - -signals: - void frameDone(float deltaTime); - void frameDoneDesignStudio(); - -private: - QPhysXWorld *m_physx = nullptr; - QElapsedTimer m_timer; }; ///////////////////////////////////////////////////////////////////////////// @@ -431,12 +398,22 @@ worldManager.worlds.push_back(this); matchOrphanNodes(); + + m_frameAnimator = new FrameAnimator; + connect(m_frameAnimator, &QQuickFrameAnimation::triggered, this, + &QPhysicsWorld::simulateFrame); } QPhysicsWorld::~QPhysicsWorld() { - m_workerThread.quit(); - m_workerThread.wait(); + if (m_frameAnimator) { + m_frameAnimator->stop(); + delete m_frameAnimator; + } + + if (m_physx->scene) + m_physx->scene->fetchResults(true); + for (auto body : m_physXBodies) { body->cleanup(m_physx); delete body; @@ -446,12 +423,12 @@ worldManager.worlds.removeAll(this); if (!qtPhysicsTimingsFile.isEmpty()) { - if (!m_simulationWorker) { - qWarning() << "No simulation running, no timings saved."; + if (m_frameTimings.isEmpty()) { + qWarning() << "No frame timings saved."; } else if (auto csvFile = QFile(qtPhysicsTimingsFile); csvFile.open(QIODevice::WriteOnly)) { QTextStream out(&csvFile); - for (int i = 1; i < m_simulationWorker->m_frameTimings.size(); i++) { - out << i << "," << m_simulationWorker->m_frameTimings[i] << '\n'; + for (int i = 1; i < m_frameTimings.size(); i++) { + out << i << "," << m_frameTimings[i] << '\n'; } csvFile.close(); } else { @@ -467,7 +444,6 @@ if ((!m_running && !m_inDesignStudio) || m_physicsInitialized) return; initPhysics(); - emit simulateFrame(m_minTimestep, m_maxTimestep); } QVector3D QPhysicsWorld::gravity() const @@ -523,12 +499,14 @@ return; m_running = running; - if (!m_inDesignStudio) { - if (m_running && !m_physicsInitialized) - initPhysics(); - if (m_running) - emit simulateFrame(m_minTimestep, m_maxTimestep); - } + if (!m_inDesignStudio && m_running && !m_physicsInitialized) + initPhysics(); + + if (running) + m_frameAnimator->start(); + else + m_frameAnimator->stop(); + emit runningChanged(m_running); } @@ -626,12 +604,12 @@ for (auto color : { QColorConstants::Svg::chartreuse, QColorConstants::Svg::cyan, QColorConstants::Svg::lightsalmon, QColorConstants::Svg::red, QColorConstants::Svg::blueviolet, QColorConstants::Svg::black }) { - auto debugMaterial = new QQuick3DDefaultMaterial(); + auto debugMaterial = new QQuick3DPrincipledMaterial(); debugMaterial->setLineWidth(lineWidth); debugMaterial->setParentItem(sceneNode); debugMaterial->setParent(sceneNode); - debugMaterial->setDiffuseColor(color); - debugMaterial->setLighting(QQuick3DDefaultMaterial::NoLighting); + debugMaterial->setBaseColor(color); + debugMaterial->setLighting(QQuick3DPrincipledMaterial::NoLighting); debugMaterial->setCullMode(QQuick3DMaterial::NoCulling); m_debugMaterials.push_back(debugMaterial); } @@ -1208,8 +1186,6 @@ m_physXBodies.removeIf([this](QAbstractPhysXNode *body) { return body->cleanupIfRemoved(m_physx); }); - // We don't need to lock the mutex here since the simulation - // worker is waiting m_removedPhysicsNodes.clear(); } @@ -1219,25 +1195,53 @@ const unsigned int numThreads = m_numThreads >= 0 ? m_numThreads : qMax(0, QThread::idealThreadCount()); m_physx->createScene(m_typicalLength, m_typicalSpeed, m_gravity, m_enableCCD, this, numThreads); + m_frameAnimator->start(); + m_physicsInitialized = true; +} + +void QPhysicsWorld::simulateFrame() +{ + constexpr double MILLIONTH = 0.000001; + constexpr double THOUSANDTH = 0.001; - // Setup worker thread - Q_ASSERT(!m_simulationWorker); - m_simulationWorker = new SimulationWorker(m_physx); - m_simulationWorker->moveToThread(&m_workerThread); if (m_inDesignStudio) { - connect(this, &QPhysicsWorld::simulateFrame, m_simulationWorker, - &SimulationWorker::simulateFrameDesignStudio); - connect(m_simulationWorker, &SimulationWorker::frameDoneDesignStudio, this, - &QPhysicsWorld::frameFinishedDesignStudio); - } else { - connect(this, &QPhysicsWorld::simulateFrame, m_simulationWorker, - &SimulationWorker::simulateFrame); - connect(m_simulationWorker, &SimulationWorker::frameDone, this, - &QPhysicsWorld::frameFinished); + frameFinishedDesignStudio(); + return; } - m_workerThread.start(); - m_physicsInitialized = true; + if (!m_physx->isRunning) { + m_timer.start(); + m_physx->isRunning = true; + m_physx->scene->simulate(m_minTimestep); + m_currTimeStep = m_minTimestep; + return; + } + + // Frame not ready yet + if (!m_frameFetched && !m_physx->scene->checkResults()) { + return; + } + + // Frame ready, fetch and finish it + if (!m_frameFetched) { + m_physx->scene->fetchResults(true); + frameFinished(m_currTimeStep); + m_frameFetched = true; + if (Q_UNLIKELY(!qtPhysicsTimingsFile.isEmpty())) { + const double deltaMS = m_timer.nsecsElapsed() * MILLIONTH; + m_frameTimings.append(deltaMS); + } + } + + // Assuming: 0 <= minTimestep <= maxTimestep + const double deltaMS = m_timer.nsecsElapsed() * MILLIONTH; + if (deltaMS < m_minTimestep) + return; + const double deltaSecs = qMin<double>(deltaMS, m_maxTimestep) * THOUSANDTH; + m_timer.restart(); + m_physx->scene->simulate(deltaSecs); + m_frameFetched = false; + m_currTimeStep = deltaSecs; } void QPhysicsWorld::frameFinished(float deltaTime) @@ -1265,9 +1269,6 @@ } updateDebugDraw(); - - if (m_running) - emit simulateFrame(m_minTimestep, m_maxTimestep); emit frameDone(deltaTime * 1000); } @@ -1281,8 +1282,6 @@ m_newPhysicsNodes.clear(); updateDebugDrawDesignStudio(); - - emit simulateFrame(m_minTimestep, m_maxTimestep); } QPhysicsWorld *QPhysicsWorld::getWorld(QQuick3DNode *node) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qphysicsworld_p.h new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qphysicsworld_p.h --- old/qtquick3dphysics-everywhere-src-6.9.2/src/quick3dphysics/qphysicsworld_p.h 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/src/quick3dphysics/qphysicsworld_p.h 2025-10-02 02:56:07.000000000 +0200 @@ -51,9 +51,9 @@ class QAbstractPhysXNode; class QQuick3DModel; class QQuick3DGeometry; -class QQuick3DDefaultMaterial; +class QQuick3DPrincipledMaterial; class QPhysXWorld; -class SimulationWorker; +class FrameAnimator; class Q_QUICK3DPHYSICS_EXPORT QPhysicsWorld : public QObject, public QQmlParserStatus { @@ -154,7 +154,6 @@ Q_REVISION(6, 5) void viewportChanged(QQuick3DNode *viewport); Q_REVISION(6, 5) void minimumTimestepChanged(float minimumTimestep); Q_REVISION(6, 5) void maximumTimestepChanged(float maxTimestep); - void simulateFrame(float minTimestep, float maxTimestep); Q_REVISION(6, 5) void frameDone(float timestep); Q_REVISION(6, 5) void sceneChanged(); Q_REVISION(6, 7) void numThreadsChanged(); @@ -162,6 +161,7 @@ Q_REVISION(6, 7) void reportStaticKinematicCollisionsChanged(); private: + void simulateFrame(); void frameFinished(float deltaTime); void frameFinishedDesignStudio(); void initPhysics(); @@ -234,7 +234,7 @@ float m_typicalLength = 100.f; // 100 cm float m_typicalSpeed = 1000.f; // 1000 cm/s float m_defaultDensity = 0.001f; // 1 g/cm^3 - float m_minTimestep = 16.667f; // 60 fps + float m_minTimestep = 1.0f; // 1000 fps float m_maxTimestep = 33.333f; // 30 fps bool m_running = true; @@ -247,7 +247,7 @@ QPhysXWorld *m_physx = nullptr; QQuick3DNode *m_viewport = nullptr; - QVector<QQuick3DDefaultMaterial *> m_debugMaterials; + QVector<QQuick3DPrincipledMaterial *> m_debugMaterials; friend class QQuick3DPhysicsMesh; // TODO: better internal API friend class QTriangleMeshShape; //#### @@ -257,13 +257,16 @@ friend class ControllerCallback; static physx::PxPhysics *getPhysics(); static physx::PxCooking *getCooking(); - QThread m_workerThread; - SimulationWorker *m_simulationWorker = nullptr; + FrameAnimator *m_frameAnimator = nullptr; QQuick3DNode *m_scene = nullptr; bool m_inDesignStudio = false; int m_numThreads = -1; bool m_reportKinematicKinematicCollisions = false; bool m_reportStaticKinematicCollisions = false; + QElapsedTimer m_timer; + float m_currTimeStep = 0.f; + QList<float> m_frameTimings; + bool m_frameFetched = false; }; QT_END_NAMESPACE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/CMakeLists.txt new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/CMakeLists.txt --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/CMakeLists.txt 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/CMakeLists.txt 2025-10-02 02:56:07.000000000 +0200 @@ -8,6 +8,7 @@ add_subdirectory(enable_disable) add_subdirectory(filtering) add_subdirectory(geometry) +add_subdirectory(geometry_builtin) add_subdirectory(geometry_readd) add_subdirectory(geometry_source) add_subdirectory(geometry_update) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/callback/tst_callback.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/callback/tst_callback.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/callback/tst_callback.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/callback/tst_callback.qml 2025-10-02 02:56:07.000000000 +0200 @@ -26,8 +26,8 @@ import QtCore import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import QtQuick Item { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/callback/tst_callback_report.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/callback/tst_callback_report.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/callback/tst_callback_report.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/callback/tst_callback_report.qml 2025-10-02 02:56:07.000000000 +0200 @@ -14,8 +14,8 @@ import QtCore import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import QtQuick Item { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/callback_create_delete_node/tst_callback_create_delete_node.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/callback_create_delete_node/tst_callback_create_delete_node.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/callback_create_delete_node/tst_callback_create_delete_node.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/callback_create_delete_node/tst_callback_create_delete_node.qml 2025-10-02 02:56:07.000000000 +0200 @@ -7,8 +7,8 @@ import QtCore import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import QtQuick Item { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/character/tst_character.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/character/tst_character.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/character/tst_character.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/character/tst_character.qml 2025-10-02 02:56:07.000000000 +0200 @@ -6,8 +6,8 @@ import QtCore import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import QtQuick Item { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/character_remove/Character.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/character_remove/Character.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/character_remove/Character.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/character_remove/Character.qml 2025-10-02 02:56:07.000000000 +0200 @@ -2,8 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers CharacterController { collisionShapes: CapsuleShape { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/character_resize/tst_character_resize.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/character_resize/tst_character_resize.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/character_resize/tst_character_resize.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/character_resize/tst_character_resize.qml 2025-10-02 02:56:07.000000000 +0200 @@ -7,8 +7,8 @@ import QtCore import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import QtQuick Item { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/enable_disable/tst_enable_disable.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/enable_disable/tst_enable_disable.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/enable_disable/tst_enable_disable.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/enable_disable/tst_enable_disable.qml 2025-10-02 02:56:07.000000000 +0200 @@ -19,8 +19,8 @@ forceDebugDraw: true typicalLength: 1 typicalSpeed: 10 - minimumTimestep: 16.6667 - maximumTimestep: 16.6667 + minimumTimestep: 15 + maximumTimestep: 15 scene: viewport.scene property real elapsedTime: 0 } @@ -111,8 +111,8 @@ source: "#Cube" scale: Qt.vector3d(2, 1, 2).times(0.01) eulerRotation: Qt.vector3d(0, 90, 0) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } } receiveContactReports: true @@ -146,8 +146,8 @@ source: "#Cube" scale: Qt.vector3d(2, 1, 2).times(0.01) eulerRotation: Qt.vector3d(0, 90, 0) - materials: DefaultMaterial { - diffuseColor: "blue" + materials: PrincipledMaterial { + baseColor: "blue" } } } @@ -224,8 +224,8 @@ source: "#Cube" scale: Qt.vector3d(2, 1, 2).times(0.01) eulerRotation: Qt.vector3d(0, 90, 0) - materials: DefaultMaterial { - diffuseColor: "blue" + materials: PrincipledMaterial { + baseColor: "blue" } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry/tst_geometry.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry/tst_geometry.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry/tst_geometry.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry/tst_geometry.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import Geometry @@ -49,8 +49,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(10, 10, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_builtin/CMakeLists.txt new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_builtin/CMakeLists.txt --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_builtin/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_builtin/CMakeLists.txt 2025-10-02 02:56:07.000000000 +0200 @@ -0,0 +1,34 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +set(PROJECT_NAME "test_auto_geometry_builtin") + +qt_internal_add_test(${PROJECT_NAME} + GUI + QMLTEST + SOURCES + tst_geometry_builtin.cpp + LIBRARIES + Qt::Core + Qt::Qml + Qt::Gui + Qt::Quick3D + Qt::Quick3DPhysics + TESTDATA + tst_geometry_builtin.qml + BUILTIN_TESTDATA +) + +if(QT_BUILD_STANDALONE_TESTS) + qt_import_qml_plugins(${PROJECT_NAME}) +endif() + +qt_add_qml_module(${PROJECT_NAME} + URI Geometry + VERSION 1.0 + QML_FILES + tst_geometry_builtin.qml + RESOURCE_PREFIX "/qt/qml" + IMPORTS + QtQuick3D +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_builtin/tst_geometry_builtin.cpp new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_builtin/tst_geometry_builtin.cpp --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_builtin/tst_geometry_builtin.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_builtin/tst_geometry_builtin.cpp 2025-10-02 02:56:07.000000000 +0200 @@ -0,0 +1,24 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtQuickTest/quicktest.h> +#include "../shared/util.h" +class tst_geometry_source : public QObject +{ + Q_OBJECT +private slots: + void skiptest() { QSKIP("This test will fail, skipping."); }; +}; +int main(int argc, char **argv) +{ + QString message = needSkip(); + if (!message.isEmpty()) { + qWarning() << message; + tst_geometry_source skip; + return QTest::qExec(&skip, argc, argv); + } + QTEST_SET_MAIN_SOURCE_PATH + return quick_test_main(argc, argv, "tst_geometry_builtin", QUICK_TEST_SOURCE_DIR); +} + +#include "tst_geometry_builtin.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_builtin/tst_geometry_builtin.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_builtin/tst_geometry_builtin.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_builtin/tst_geometry_builtin.qml 1970-01-01 01:00:00.000000000 +0100 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_builtin/tst_geometry_builtin.qml 2025-10-02 02:56:07.000000000 +0200 @@ -0,0 +1,129 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +import QtQuick +import QtTest +import QtQuick3D +import QtQuick3D.Physics + +Item { + width: 640 + height: 480 + visible: true + + PhysicsWorld { + scene: viewport.scene + minimumTimestep: 15 + maximumTimestep: 15 + forceDebugDraw: true + } + + View3D { + id: viewport + anchors.fill: parent + + environment: SceneEnvironment { + clearColor: "#d6dbdf" + backgroundMode: SceneEnvironment.Color + } + + PerspectiveCamera { + position: Qt.vector3d(-200, 100, 500) + eulerRotation: Qt.vector3d(-20, -20, 0) + clipFar: 5000 + clipNear: 1 + } + + DirectionalLight { + eulerRotation.x: -45 + eulerRotation.y: 45 + castsShadow: true + brightness: 1 + shadowFactor: 100 + } + + DynamicRigidBody { + id: cube + property bool hit: false + position: Qt.vector3d(-100, 100, 0) + receiveContactReports: true + onBodyContact: (body, positions, impulses, normals) => hit = true + collisionShapes: ConvexMeshShape { + source: "#Cube" + } + Model { + source: "#Cube" + materials: PrincipledMaterial { + baseColor: "yellow" + } + } + } + + DynamicRigidBody { + id: sphere + property bool hit: false + position: Qt.vector3d(0, 100, 0) + receiveContactReports: true + onBodyContact: (body, positions, impulses, normals) => hit = true + collisionShapes: ConvexMeshShape { + source: "#Sphere" + } + Model { + source: "#Sphere" + materials: PrincipledMaterial { + baseColor: "yellow" + } + } + } + + DynamicRigidBody { + id: cone + property bool hit: false + position: Qt.vector3d(100, 100, 0) + receiveContactReports: true + onBodyContact: (body, positions, impulses, normals) => hit = true + collisionShapes: ConvexMeshShape { + source: "#Cone" + } + Model { + source: "#Cone" + materials: PrincipledMaterial { + baseColor: "yellow" + } + } + } + + StaticRigidBody { + position: Qt.vector3d(0, -100, 0) + eulerRotation: Qt.vector3d(-90, 0, 0) + collisionShapes: PlaneShape {} + sendContactReports: true + Model { + source: "#Rectangle" + scale: Qt.vector3d(10, 10, 1) + materials: DefaultMaterial { + diffuseColor: "green" + } + castsShadows: false + receivesShadows: true + } + } + } + + TestCase { + name: "scene" + when: cube.hit + function triggered() { } + } + + TestCase { + name: "scene" + when: sphere.hit + function triggered() { } + } + + TestCase { + name: "scene" + when: cone.hit + function triggered() { } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_readd/tst_geometry_readd.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_readd/tst_geometry_readd.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_readd/tst_geometry_readd.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_readd/tst_geometry_readd.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import Geometry // This test tries repeatedly adding and removing a static triangle mesh. @@ -17,8 +17,8 @@ PhysicsWorld { scene: viewport.scene - minimumTimestep: 16 - maximumTimestep: 16 + minimumTimestep: 15 + maximumTimestep: 15 forceDebugDraw: true } @@ -53,8 +53,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(10, 10, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true @@ -105,8 +105,8 @@ shape = Qt.createQmlObject(` import QtQuick import QtQuick3D + import QtQuick3D.Helpers import QtQuick3D.Physics - import QtQuick3D.Physics.Helpers import Geometry TriangleMeshShape { geometry: ExampleTriangleGeometry {} } `, @@ -122,8 +122,8 @@ shape = Qt.createQmlObject(` import QtQuick import QtQuick3D + import QtQuick3D.Helpers import QtQuick3D.Physics - import QtQuick3D.Physics.Helpers import Geometry TriangleMeshShape { geometry: ExampleTriangleGeometry {} } `, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_source/tst_geometry_source.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_source/tst_geometry_source.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_source/tst_geometry_source.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_source/tst_geometry_source.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import Geometry // This test tries repeatedly adding and removing a geometry from a triangle mesh. @@ -17,8 +17,8 @@ PhysicsWorld { scene: viewport.scene - minimumTimestep: 16 - maximumTimestep: 16 + minimumTimestep: 15 + maximumTimestep: 15 forceDebugDraw: true } @@ -53,8 +53,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(10, 10, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true @@ -111,8 +111,8 @@ let shape = Qt.createQmlObject(` import QtQuick import QtQuick3D + import QtQuick3D.Helpers import QtQuick3D.Physics - import QtQuick3D.Physics.Helpers import Geometry ExampleTriangleGeometry { } `, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_update/tst_geometry_update.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_update/tst_geometry_update.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/geometry_update/tst_geometry_update.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/geometry_update/tst_geometry_update.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers import TileGeometry // Drops two balls on two tiles. One tile with a hole and one without. @@ -18,8 +18,8 @@ PhysicsWorld { scene: viewport.scene - minimumTimestep: 16 - maximumTimestep: 16 + minimumTimestep: 15 + maximumTimestep: 15 forceDebugDraw: false } @@ -54,8 +54,8 @@ scale: Qt.vector3d(0.3, 0.3, 0.3) Model { source: "#Sphere" - materials: DefaultMaterial { - diffuseColor: "yellow" + materials: PrincipledMaterial { + baseColor: "yellow" } } collisionShapes: SphereShape {} @@ -69,8 +69,8 @@ scale: Qt.vector3d(0.3, 0.3, 0.3) Model { source: "#Sphere" - materials: DefaultMaterial { - diffuseColor: "yellow" + materials: PrincipledMaterial { + baseColor: "yellow" } } collisionShapes: SphereShape {} @@ -85,8 +85,8 @@ id: tileLeftGeometry hasHole: false } - materials: DefaultMaterial { - diffuseColor: "blue" + materials: PrincipledMaterial { + baseColor: "blue" } } @@ -110,8 +110,8 @@ id: tileRightGeometry hasHole: true } - materials: DefaultMaterial { - diffuseColor: "red" + materials: PrincipledMaterial { + baseColor: "red" } } collisionShapes: TriangleMeshShape { @@ -135,8 +135,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(10, 10, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/heightfield/tst_heightfield.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/heightfield/tst_heightfield.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/heightfield/tst_heightfield.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/heightfield/tst_heightfield.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers // Test loading a heightfield from both 'source' and 'image' property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/heightfield_readd/tst_heightfield_readd.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/heightfield_readd/tst_heightfield_readd.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/heightfield_readd/tst_heightfield_readd.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/heightfield_readd/tst_heightfield_readd.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtTest import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers // Test loading a heightfield from both 'source' and 'image' property @@ -16,8 +16,8 @@ PhysicsWorld { scene: viewport.scene forceDebugDraw: true - maximumTimestep: 16 - minimumTimestep: 16 + maximumTimestep: 15 + minimumTimestep: 15 } View3D { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/physicsscene/data/TestCube.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/physicsscene/data/TestCube.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/physicsscene/data/TestCube.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/physicsscene/data/TestCube.qml 2025-10-02 02:56:07.000000000 +0200 @@ -8,7 +8,7 @@ // TestBody is a DynamicRigidBody with a "stable" property DynamicRigidBody { - property alias color: cubemat.diffuseColor + property alias color: cubemat.baseColor massMode: DynamicRigidBody.CustomDensity density: 1000 collisionShapes: BoxShape { extents: Qt.vector3d(1, 1, 1) } @@ -16,9 +16,9 @@ source: "#Cube" scale: Qt.vector3d(1, 1, 1).times(0.01) eulerRotation: Qt.vector3d(0, 90, 0) - materials: DefaultMaterial { + materials: PrincipledMaterial { id: cubemat - diffuseColor: "red" + baseColor: "red" } } property bool stable: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/physicsscene/data/tst_physicsscene.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/physicsscene/data/tst_physicsscene.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/auto/physicsscene/data/tst_physicsscene.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/auto/physicsscene/data/tst_physicsscene.qml 2025-10-02 02:56:07.000000000 +0200 @@ -18,8 +18,8 @@ forceDebugDraw: true typicalLength: 1 typicalSpeed: 10 - minimumTimestep: 16.6667 - maximumTimestep: 16.6667 + minimumTimestep: 15 + maximumTimestep: 15 scene: viewport.scene } property bool simulationActuallyRunning: false @@ -59,8 +59,8 @@ source: "#Cube" scale: Qt.vector3d(2, 1, 2).times(0.01) eulerRotation: Qt.vector3d(0, 90, 0) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } } } @@ -127,17 +127,19 @@ source: "#Cube" scale: Qt.vector3d(2, 1, 2).times(0.01) eulerRotation: Qt.vector3d(0, 90, 0) - materials: DefaultMaterial { - diffuseColor: "red" + materials: PrincipledMaterial { + baseColor: "red" } } } + property int frame: 0; property var createdObject: null property bool createdObjectIsStable: createdObject ? createdObject.stable : false function checkStable() { - if (createdObject) + if (createdObject && frame > 10) createdObject.checkStable() + frame += 1 } Component { id: spawnComponent @@ -176,8 +178,8 @@ Model { source: "#Cube" scale: slide.extents.times(0.01) - materials: DefaultMaterial { - diffuseColor: "orange" + materials: PrincipledMaterial { + baseColor: "orange" } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/charactercontroller/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/charactercontroller/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/charactercontroller/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/charactercontroller/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -3,8 +3,8 @@ import QtQuick import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers as Helpers import QtQuick.Controls import QtQuick.Layouts @@ -211,7 +211,7 @@ Model { // not visible from the camera, but casts a shadow eulerRotation.z: 90 - geometry: Helpers.CapsuleGeometry {} + geometry: CapsuleGeometry {} materials: PrincipledMaterial { baseColor: "red" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/convexmesh/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/convexmesh/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/convexmesh/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/convexmesh/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -60,8 +60,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(0.3, 0.3, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true @@ -303,8 +303,8 @@ // Model { // id: tableModel // source: "#Cube" -// materials: DefaultMaterial { -// diffuseColor: "gray" +// materials: PrincipledMaterial { +// baseColor: "gray" // } // scale: Qt.vector3d(4, 1, 4) // } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/friction/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/friction/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/friction/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/friction/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -78,8 +78,8 @@ } Model { source: "#Rectangle" - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/kinematictree/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/kinematictree/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/kinematictree/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/kinematictree/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -55,8 +55,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(10, 10, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/scaling/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/scaling/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/scaling/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/scaling/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -4,8 +4,8 @@ import QtQuick.Layouts import QtQuick.Controls import QtQuick3D +import QtQuick3D.Helpers import QtQuick3D.Physics -import QtQuick3D.Physics.Helpers Window { width: 640 @@ -62,8 +62,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(5, 5, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/spawn/main.qml new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/spawn/main.qml --- old/qtquick3dphysics-everywhere-src-6.9.2/tests/manual/spawn/main.qml 2025-08-18 02:47:48.000000000 +0200 +++ new/qtquick3dphysics-everywhere-src-6.10.0/tests/manual/spawn/main.qml 2025-10-02 02:56:07.000000000 +0200 @@ -149,8 +149,8 @@ Model { source: "#Rectangle" scale: Qt.vector3d(5, 5, 1) - materials: DefaultMaterial { - diffuseColor: "green" + materials: PrincipledMaterial { + baseColor: "green" } castsShadows: false receivesShadows: true
