瀏覽代碼

Make restitution an option

Change-Id: If4c56d20a56e33a7e0af631fc4f361d4311eb662
Donald Carr 9 年之前
父節點
當前提交
22d0633974
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 1
      qml/ArtDelegate.qml
  2. 2 0
      qml/main.qml

+ 1 - 1
qml/ArtDelegate.qml

@@ -13,7 +13,7 @@ ImageBoxBody {
 
     density: 1.0
     friction: 0
-    restitution: 0.1
+    restitution: settings.restitution
 
     fixedRotation: parent.fixedRotation
     bodyType: Body.Dynamic

+ 2 - 0
qml/main.qml

@@ -18,6 +18,8 @@ Window {
         property double pace: 1.0
         property bool viewItemCount: false
         property bool globalWorld: false
+        // Very computationally heavy: 40% vs 20% for 0.1 vs 0
+        property double restitution: 0.1
     }
 
     Rectangle {