aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Add alt text for \image tags for qtquick3dphysicsEren Bursali2025-11-188-9/+16
| | | | | | | Adding alt texts that were needed for QDoc Change-Id: I2a51e2df3e0d6efd58a7ead1a313ff9c3bba8e48 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Deprecate CapsuleGeometryJonas Karlsson2025-06-064-4/+2
| | | | | | | | Use the one in QtQuick3D.Helpers instead. Pick-to: 6.10 Change-Id: I5b08fd588a741e6f136881ad61a4e879c51ba391 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Examples: Replace DefaultMaterial with PrincipledMaterialPaul Olav Tvete2024-11-294-8/+8
| | | | | | | DefaultMaterial is deprecated. Change-Id: Iff0a558d89e1d11f482fea7b8f8c233a1463c21f Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Adapt to Qt 6.8 shadowmap changesJonas Karlsson2024-06-057-11/+20
| | | | | | | | Fixes: QTBUG-124796 Task-number: QTBUG-116885 Pick-to: 6.8 Change-Id: I86127eb17ef7a660499f409218733daf66301199 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Change license for snippets and examples filesLucie Gérard2024-04-0410-10/+10
| | | | | | | | | | | | According to QUIP-18 [1], all examples and snippets files should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I6968e4eb45f07992114894a8371863b13934d909 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Move examples to '3D' categoryTopi Reinio2024-02-218-8/+8
| | | | | | | | Pick-to: 6.7 Task-number: QTBUG-122377 Change-Id: I714eaf8e739b597457f813071bc56c6afaa4d3b6 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
* Material example: don't let floor cast shadowsJonas Karlsson2024-01-251-0/+2
| | | | | | | | | It is impossible for the floor to shadow anything anyway and it gives some shadow acne on windows. Pick-to: 6.7 6.6 6.5 Change-Id: I789cb402fc43aa5f387ef57b1d4b7648fd6874f1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix crash in Cannon example on MSVCJonas Karlsson2023-12-141-2/+2
| | | | | | | | | | A QML list should be cleared by setting it to '[]', not '{}'. Fixes: QTBUG-120045 Pick-to: 6.7 6.6 6.5 Change-Id: Icd2650cd25082413f5d359346b32c47879bc7e83 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Inho Lee <inho.lee@qt.io>
* Add \examplecategory to the example docsVenugopal Shivashankar2023-07-238-0/+8
| | | | | | | | | | | Added example category to ensure that the examples could be organized according better in the documentation. Task-number: QTBUG-115442 Pick-to: 6.5 6.6 Change-Id: I7f3459609be054ba9e4b26633f2741d1d9f75f80 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* cannon: do not reset scene if already resettingJonas Karlsson2023-06-261-13/+14
| | | | | | | | | | | Hitting "reset scene" too quickly can cause the UI to hang because creating the stack of boxes takes too long. Instead, we now create the stack of boxes asynchronously then check if they are completed when trying to reset the scene later. Pick-to: 6.5 6.5.2 6.6 Change-Id: I3d810489c3de51e2394e10207d92cc2a20bb3021 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Always scale rectangle model's z-axis with 1Jonas Karlsson2023-04-244-4/+4
| | | | | | | | | Scaling with zero will cause rendering artifacts. Pick-to: 6.5 Task-number: QTBUG-112846 Change-Id: I551665075cc74d5fd7991a66319c0f0fc6d2cdc3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Polish examplesJonas Karlsson2023-02-2025-220/+219
| | | | | | | | | | | | | - Remove Qt < 6 version checks. - Format QML files. - Set proper titles for all examples. - cannon: rename Box.qml and Sphere.qml. - mass: rename Sphere.qml. Make sphere component a property. - compoundshapes: remove Wasdcontroller Pick-to: 6.5 Change-Id: Id82193bfd54e9e4ccda76535c0b139ad3dbc919b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Improve cannon exampleJonas Karlsson2023-02-201-6/+6
| | | | | | | | | | | | | | - Store the box and sphere components for faster creation. - Set 'collisionShapes' to the empty set when destroying the objects. This is a hack to avoid the issue of the boxes exploding upon recreation. The issue is that calling destroy on a qml object does not delete it immediately so sometimes old boxes are left when the new stacks are spawned leading to explosive collisions. Pick-to: 6.5 Change-Id: Ia842d69d99470c641d9fb73b495d6c695f141b94 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Turn linearVelocity into a methodJonas Karlsson2023-02-204-10/+8
| | | | | | | | | | | | | | | It makes more sense that setting linearVelocity is a method since it is something you want to set similar to applying an impulse or a force. At the moment it is also never updated from the actual velocity of the body so the property is broken in its current state. This also changes the impeller example to use linearVelocity instead of adding an impulse since that was buggy when running with low time steps. Pick-to: 6.5 Change-Id: Ibc8f9ad51ac75fafc4902c3720bdd9783650fce5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* docs: remove section in custom shapesJonas Karlsson2023-02-201-11/+9
| | | | | | | Pick-to: 6.5 Change-Id: I4cd88d05269d417782070e89b75d8e913449d2be Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Support multiple physics scenesJonas Karlsson2023-02-029-7/+18
| | | | | | | | | | - Rename sceneNode property to viewport. - Add scene property to specify the node/object where all physics nodes reside for this world. Pick-to: 6.5 Change-Id: I23ba426605028ee492485af518c00db3a64760c0 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Character controller examplePaul Olav Tvete2023-01-3023-0/+1220
| | | | | | | | An example that shows how to use the CharacterController type. Pick-to: 6.5 Change-Id: I83821ecccaea48da572287ebe7bdcc15c28aa6e5 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Add CustomDensity and DefaultDensity enumsJonas Karlsson2023-01-275-2/+5
| | | | | | | | | | When the 'massMode' enum is set to DefaultDensity a body will use the default scene density. When CustomDensity is set then a body will use its own density property. Pick-to: 6.5 Change-Id: I2db56badd59fad30fc0d6c672348abe75613d798 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix qml performance warningJonas Karlsson2023-01-261-1/+1
| | | | | | Pick-to: 6.5 Change-Id: Ia80985874bae1ccbbe90533a3d8486ba3aa97cf8 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Rename CollisionNode to PhysicsNodeJonas Karlsson2023-01-252-12/+12
| | | | | | | | | Since the subclasses of CollisionNode are not all colliding the name PhysicsNode is more sensible. Pick-to: 6.5 Change-Id: I7eb4e976f6e03354125979ad00bee91c249cb8d8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* More detailed documentation on shapes and bodiesPaul Olav Tvete2023-01-162-17/+13
| | | | | Change-Id: Ibc1536430c4c81e94f35950eec7b3f78d7a326d3 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Rename DynamicsWorld to PhysicsWorldJonas Karlsson2023-01-0613-17/+17
| | | | | | | Task-number: QTBUG-109824 Pick-to: 6.5 Change-Id: Ifc60fe4155a23efd1f2a42104cac2772fea936f6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Tweak compoundshapes timestepJonas Karlsson2023-01-061-0/+1
| | | | | | | | The rings could still fall out with a too big timestep. Pick-to: 6.5 Change-Id: I32c1d2bd99612c18715439230bdc0c5c9e0a00eb Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Rename DebugView to DebugDrawJonas Karlsson2023-01-061-1/+1
| | | | | | | Task-number: QTBUG-109824 Pick-to: 6.5 Change-Id: Ic0efc100910e28c845dfafcf317a793e0ada50c9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use send/receiveTriggerReports signalsJonas Karlsson2023-01-052-13/+14
| | | | | | | | | | | | This makes it symmetrical like 'receiveContactReports' and 'sendContactReports' and also makes it possible to receive a callback on the object entering a trigger body and not just the other way around. The 'impeller' example is updated to use this pattern. Task-number: QTBUG-109824 Pick-to: 6.5 Change-Id: Iafe655c738a3bac064ba61d8c916b1e777637fdb Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Spell out minimum/maximumJonas Karlsson2023-01-051-1/+1
| | | | | | | Task-number: QTBUG-109824 Pick-to: 6.5 Change-Id: Ie1d166f9c498ac810c56b61e7fc783946c3fd2cd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Rename heightMap/meshSource to sourceJonas Karlsson2023-01-052-21/+21
| | | | | | | | Task-number: QTBUG-109824 Pick-to: 6.5 Change-Id: I092cf0ca598c0c9dac1d2fdc41a06b3bfa71a680 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compoundshapes: use physics based animation timingJonas Karlsson2022-12-162-46/+66
| | | | | | Pick-to: 6.5 Change-Id: I6d3b9e24fa5f17db0ed629094354b96c9c822712 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Customshapes: use physics based animation timingJonas Karlsson2022-12-082-26/+44
| | | | | Change-Id: I9c5c00e846c355da5cdc25bb83284669dd1c91c3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add special properties for moving kinematic bodiesJonas Karlsson2022-12-083-16/+33
| | | | | | | | | | | | | | | | Adds kinematicPosition, kinematicRotation, kinematicEulerRoation and kinematicPivot properties which will be used for setting the position, rotation and pivot of kinematic bodies. The reason for adding these properties is to enforce a consistent state of the view and physics world. Previously, the physical object was updated from the visual object's position and rotation in the scene which would cause the physical body to be one or several frames behind the visual body. Now the visual body is updated from the physical body instead. Change-Id: Ibd9934d24020e8322f9003a638828af538955cb8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Tweak 'customshapes' exampleJonas Karlsson2022-09-013-57/+135
| | | | | | | | | | | - Add documentation - Tweak/reorder the QML - Enable the skybox - Remove startup Timer Pick-to: 6.4 Change-Id: I29ec8ff2dfc47f0362b251b81ca0281b142f77b9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-259-9/+9
| | | | | | | Task-number: QTBUG-105718 Change-Id: I3a3e4b2e401866094b1cc28074a3e12fa6eb1320 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Tweak customshapes exampleJonas Karlsson2022-07-211-2/+2
| | | | | | | | | | Set typicalLength to match dice sizes Spawn dices in a spiral pattern and closer to mug to avoid unnatural looking stacking Change-Id: I174d577bb211de504f10b7e317ea802e5b97c1ca Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Custom shapes examplePaul Olav Tvete2022-07-1419-0/+376
| | | | | | | | Shows off dynamic convex mesh, static heightmap, and kinematic triangle mesh. Needs documentation. Change-Id: I7fc58c4b0abf2e0e019ea96a3ce8bf8569175476 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-078-0/+24
| | | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: Ie7cc4e93db68c3e0b360d0ea87b8554cc4a82758 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Clean up CMakeLists.txt in examplesKai Köhne2022-06-296-66/+30
| | | | | | | | | | * Remove superfluous "CMAKE_INCLUDE_CURRENT_DIR ON" * Remove unneeded CMAKE_AUTOXXX variables * Combine multiple find_package(Qt6...) calls into one * Prefer unversioned CMake commands Change-Id: I7143b629ceebdfdb307fbf0e52b98fb397512396 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-2225-1087/+50
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: If1d6e552f38245dca442fd9e51c932c1c3fd6bf7 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* examples: support touch displaySamuli Piippo2022-06-071-0/+6
| | | | | | | | Add button to fire the cannon when using touch screens. Pick-to: 6.4 Change-Id: If8e1efac0c13f9d6ba301fbfeb17bb8b26f561b8 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Improve mass and density handlingJonas Karlsson2022-06-0111-1/+611
| | | | | | | | | | | | | - Fix missing inertia calculation with only mass - Add properties for setting custom center of mass and inertia tensor/matrix - Add MassMode enum for specifying how mass and inertia is calculated - Add mass example Change-Id: I7bf4da5a388113f2b041740c7b23677bbd728095 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Long live QtQuick3DPhysics!Jonas Karlsson2022-05-1261-0/+2639
Initial commit of the Qt Quick 3D Physics code base Task-number: QTBUG-98089 Change-Id: Ia79c279d3737118d9ebcf42f758b8c2cffcb038a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>