PhysicsNodeSection.qml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Copyright (C) 2023 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick 2.15
  4. import QtQuick.Layouts 1.15
  5. import HelperWidgets 2.0
  6. import StudioTheme 1.0 as StudioTheme
  7. Column {
  8. width: parent.width
  9. Section {
  10. width: parent.width
  11. caption: qsTr("Physics Node")
  12. SectionLayout {
  13. PropertyLabel {
  14. text: qsTr("Collision Shapes")
  15. Layout.alignment: Qt.AlignTop
  16. Layout.topMargin: 5
  17. }
  18. SecondColumnLayout {
  19. EditableListView {
  20. backendValue: backendValues.collisionShapes
  21. model: backendValues.collisionShapes.expressionAsList
  22. Layout.fillWidth: true
  23. typeFilter: "QtQuick3D.Physics.CollisionShape"
  24. onAdd: function(value) { backendValues.collisionShapes.idListAdd(value) }
  25. onRemove: function(idx) { backendValues.collisionShapes.idListRemove(idx) }
  26. onReplace: function (idx, value) { backendValues.collisionShapes.idListReplace(idx, value) }
  27. }
  28. ExpandingSpacer {}
  29. }
  30. PropertyLabel {
  31. text: qsTr("Receive Contact Reports")
  32. tooltip: qsTr("Determines whether this body will receive contact reports when colliding with other bodies.")
  33. }
  34. SecondColumnLayout {
  35. CheckBox {
  36. text: backendValues.receiveContactReports.valueToString
  37. backendValue: backendValues.receiveContactReports
  38. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  39. + StudioTheme.Values.actionIndicatorWidth
  40. }
  41. ExpandingSpacer {}
  42. }
  43. PropertyLabel {
  44. text: qsTr("Send Contact Reports")
  45. tooltip: qsTr("Determines whether this body will send contact reports when colliding with other bodies.")
  46. }
  47. SecondColumnLayout {
  48. CheckBox {
  49. text: backendValues.sendContactReports.valueToString
  50. backendValue: backendValues.sendContactReports
  51. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  52. + StudioTheme.Values.actionIndicatorWidth
  53. }
  54. ExpandingSpacer {}
  55. }
  56. PropertyLabel {
  57. text: qsTr("Receive Trigger Reports")
  58. tooltip: qsTr("Determines whether this body will receive reports when entering or leaving a trigger body.")
  59. }
  60. SecondColumnLayout {
  61. CheckBox {
  62. text: backendValues.receiveTriggerReports.valueToString
  63. backendValue: backendValues.receiveTriggerReports
  64. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  65. + StudioTheme.Values.actionIndicatorWidth
  66. }
  67. ExpandingSpacer {}
  68. }
  69. PropertyLabel {
  70. text: qsTr("Send Trigger Reports")
  71. tooltip: qsTr("Determines whether this body will send contact reports when colliding with other bodies.")
  72. }
  73. SecondColumnLayout {
  74. CheckBox {
  75. text: backendValues.sendTriggerReports.valueToString
  76. backendValue: backendValues.sendTriggerReports
  77. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  78. + StudioTheme.Values.actionIndicatorWidth
  79. }
  80. ExpandingSpacer {}
  81. }
  82. }
  83. }
  84. }