diff --git a/package.json b/package.json index 5a356d08277b86acc4ec8b044e3e39a49461f751..97926d61d59520881fbccd38ff4b3e8e8acfb137 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 b43b77250cbbe2cec5e9233692f0a8227560e83f..65b055775b26bcadc3012c474944c574ed099f3e 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 5d5bfd1d1db6385939434f3227ad0d8df39eea9d..bb5873db9a256530f8822978b930f778145ae77c 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 42a80bd2c2d0c74aede7454e3e5088377cd20af3..bc8627901438d6e222b5ae61c3998fe881e940cb 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 76ed7730cb76baa636f20b92426f12390383000a..6d5e3ab1dfa7b08588e39cadc69cd4153bea1a7a 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"