Browse Source

Chaos should be settable

Change-Id: Ie96edce33c3686482db2c045f2f2cbb90f37116d
Donald Carr 8 năm trước cách đây
mục cha
commit
73f018bb5a
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 1 1
      qml/physics/ArtDelegate.qml
  2. 2 2
      qml/physics/Physics.qml

+ 1 - 1
qml/physics/ArtDelegate.qml

@@ -18,7 +18,7 @@ ImageBoxBody {
     friction: 0
     restitution: physicsSettings.restitution
 
-    fixedRotation: parent.fixedRotation
+    fixedRotation: physicsSettings.fixedRotation
     bodyType: Body.Dynamic
 
     source: imageModel.randomPicture()

+ 2 - 2
qml/physics/Physics.qml

@@ -25,6 +25,7 @@ View {
         property int verticalOffset: 1
         property real pace: 1
         property bool globalWorld: false
+        property bool fixedRotation: true
         // Very computationally heavy: 40% vs 20% for 0.1 vs 0
         property real restitution: 0
     }
@@ -55,7 +56,6 @@ View {
             property bool full: false
             property int xOffset: width * index
             property var pictureArray: []
-            property bool fixedRotation: true
 
             function considerImage() {
                 if (stackHeight < (1.3 + 1/globalSettings.columnCount)*root.height) {
@@ -153,7 +153,7 @@ View {
                 target: root
                 onTogglePause: d.paused = !d.paused
                 onNext: deathTimer.triggered()
-                onToggleChaos: fixedRotation = !fixedRotation
+                onToggleChaos: physicsSettings.fixedRotation = !physicsSettings.fixedRotation
             }
         }
     }