Kaynağa Gözat

Add density and friction to settings for experimentation

Change-Id: Ic9b2ae4986cbdeccbbdb05294c4700e15fb84194
Donald Carr 8 yıl önce
ebeveyn
işleme
5a979da82a
2 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 2 2
      qml/physics/ArtDelegate.qml
  2. 2 0
      qml/physics/Physics.qml

+ 2 - 2
qml/physics/ArtDelegate.qml

@@ -14,8 +14,8 @@ ImageBoxBody {
         }
     }
 
-    density: 1.0
-    friction: 0
+    density: physicsSettings.density
+    friction: physicsSettings.friction
     restitution: physicsSettings.restitution
 
     fixedRotation: physicsSettings.fixedRotation

+ 2 - 0
qml/physics/Physics.qml

@@ -23,6 +23,8 @@ View {
         // 0 is abutting
         property int verticalOffset: 5
         property real pace: 3
+        property real density: 1.0
+        property real friction: 1.0
         property bool globalWorld: false
         property bool fixedRotation: true
         // Very computationally heavy: 40% vs 20% for 0.1 vs 0