From 2cdb0385476477b63d60d597474cb6f8901a9367 Mon Sep 17 00:00:00 2001
From: Kevin Lee <klee@mozilla.com>
Date: Thu, 15 Feb 2018 22:12:27 -0600
Subject: [PATCH] update to use aframe-physics-system 3.0.0

---
 package.json                          |  2 +-
 src/components/remote-dynamic-body.js |  6 +++---
 src/components/super-spawner.js       |  4 ++--
 src/room.js                           |  2 +-
 yarn.lock                             | 12 ++++--------
 5 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/package.json b/package.json
index 5a356d082..97926d61d 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
     "aframe-extras": "^3.12.4",
     "aframe-input-mapping-component": "https://github.com/johnshaughnessy/aframe-input-mapping-component#23e2855",
     "aframe-physics-extras": "^0.1.2",
-    "aframe-physics-system": "https://github.com/infinitelee/aframe-physics-system#feature/dynamic-body-change-mass",
+    "aframe-physics-system": "https://github.com/infinitelee/aframe-physics-system#fix/constraint-dependency",
     "aframe-teleport-controls": "https://github.com/netpro2k/aframe-teleport-controls#feature/teleport-origin",
     "extract-text-webpack-plugin": "^3.0.2",
     "material-design-lite": "^1.3.0",
diff --git a/src/components/remote-dynamic-body.js b/src/components/remote-dynamic-body.js
index b43b77250..65b055775 100644
--- a/src/components/remote-dynamic-body.js
+++ b/src/components/remote-dynamic-body.js
@@ -15,7 +15,7 @@ AFRAME.registerComponent("remote-dynamic-body", {
     this.networked = this.networkedEl.components.networked;
 
     if (!this._isMine()) {
-      this.networkedEl.setAttribute("dynamic-body", "mass: 0;");
+      this.networkedEl.setAttribute("body", "mass: 0;");
       if (this.data.grabbable)
         this.networkedEl.setAttribute("grabbable", "");
       if (this.data.stretchable)
@@ -36,7 +36,7 @@ AFRAME.registerComponent("remote-dynamic-body", {
   tick: function(t) {
     if (this.wasMine && !this._isMine()) {
       this.wasMine = false;
-      this.networkedEl.components["dynamic-body"].updateMass(0);
+      this.networkedEl.setAttribute("body", "mass: 0;");
       this.networkedEl.emit("grab-end", {hand: this.hand})
       this.hand = null;
       this.counter.deregister(this.networkedEl);
@@ -49,7 +49,7 @@ AFRAME.registerComponent("remote-dynamic-body", {
     this.hand = e.detail.hand;
     if (!this._isMine()) {
       if (this.networked.takeOwnership()) {
-        this.networkedEl.components["dynamic-body"].updateMass(this.data.mass);
+        this.networkedEl.setAttribute("body", `mass: ${this.data.mass};`);
         this.wasMine = true;
         this.counter.register(this.networkedEl);
         this.el.setAttribute("color", "green")
diff --git a/src/components/super-spawner.js b/src/components/super-spawner.js
index 5d5bfd1d1..bb5873db9 100644
--- a/src/components/super-spawner.js
+++ b/src/components/super-spawner.js
@@ -8,7 +8,7 @@ AFRAME.registerComponent("super-spawner", {
   },
 
   init: function() {
-    this.el.setAttribute("dynamic-body", "mass: 0;");
+    this.el.setAttribute("body", "mass: 0; type: 'static';");
 
     this.el.addEventListener("grab-start", e => {
       this._onGrabStart(e);
@@ -19,7 +19,7 @@ AFRAME.registerComponent("super-spawner", {
     const sceneEl = document.querySelector("a-scene");
     const entity = document.createElement("a-entity");
 
-    entity.setAttribute("dynamic-body", `mass: ${this.data.mass};`);
+    entity.setAttribute("body", `mass: ${this.data.mass};`);
 
     if (this.data.grabbable) {
       entity.setAttribute("grabbable", "");
diff --git a/src/room.js b/src/room.js
index 42a80bd2c..bc8627901 100644
--- a/src/room.js
+++ b/src/room.js
@@ -86,7 +86,7 @@ function shareScreen() {
 function spawnNetworkedCube(e) {
   const sceneEl = document.querySelector("a-scene");
   const entity = document.createElement("a-entity");
-  entity.setAttribute("dynamic-body", "mass: 1;");
+  entity.setAttribute("body", "mass: 1;");
   entity.setAttribute("grabbable", "");
   entity.setAttribute("stretchable", "");
   if (e.target && e.target != sceneEl) {
diff --git a/yarn.lock b/yarn.lock
index 76ed7730c..6d5e3ab1d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -83,9 +83,9 @@ aframe-physics-system@^1.4.3:
     cannon "github:donmccurdy/cannon.js#v0.6.2-dev1"
     three-to-cannon "^1.1.1"
 
-"aframe-physics-system@https://github.com/infinitelee/aframe-physics-system#feature/dynamic-body-change-mass":
-  version "2.1.1"
-  resolved "https://github.com/infinitelee/aframe-physics-system#f8ed2e344e31d557a58819a99e60798277a1a17e"
+"aframe-physics-system@https://github.com/infinitelee/aframe-physics-system#fix/constraint-dependency":
+  version "3.0.0"
+  resolved "https://github.com/infinitelee/aframe-physics-system#d9e7894c4f826ec7326eec67bdfc3e27a14c8773"
   dependencies:
     browserify "^14.3.0"
     budo "^10.0.3"
@@ -6088,11 +6088,7 @@ three-pathfinding@^0.2.2:
   version "0.2.3"
   resolved "https://registry.yarnpkg.com/three-pathfinding/-/three-pathfinding-0.2.3.tgz#469bb26fb6b331f536c9ec88fde78e9c9219f637"
 
-three-to-cannon@^1.1.1:
-  version "1.1.2"
-  resolved "https://registry.yarnpkg.com/three-to-cannon/-/three-to-cannon-1.1.2.tgz#b0040b893b2fa5f0e8a0aedf58bc90fc07f137aa"
-
-three-to-cannon@^1.2.0:
+three-to-cannon@^1.1.1, three-to-cannon@^1.2.0:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/three-to-cannon/-/three-to-cannon-1.2.0.tgz#92b9a756a270851aa98c3058c51ef15891507c01"
 
-- 
GitLab