Skip to content
Snippets Groups Projects
Commit 1dbd414d authored by netpro2k's avatar netpro2k
Browse files

Hack to remove hand states and monkeypatch PannerNode - This should be

reverted before this lands on master
parent 4c557257
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,9 @@ import uuid from "uuid/v4"; ...@@ -4,8 +4,9 @@ import uuid from "uuid/v4";
import queryString from "query-string"; import queryString from "query-string";
import { Socket } from "phoenix"; import { Socket } from "phoenix";
import { patchWebGLRenderingContext } from "./utils/webgl"; import { patchWebGLRenderingContext, monkeyPatchPannerNode } from "./utils/webgl";
patchWebGLRenderingContext(); patchWebGLRenderingContext();
monkeyPatchPannerNode();
import "aframe-xr"; import "aframe-xr";
import "./vendor/GLTFLoader"; import "./vendor/GLTFLoader";
......
...@@ -9,16 +9,16 @@ function registerNetworkSchemas() { ...@@ -9,16 +9,16 @@ function registerNetworkSchemas() {
}, },
"scale", "scale",
"player-info", "player-info",
{ // {
selector: ".RootScene", // selector: ".RootScene",
component: "hand-pose__left", // component: "hand-pose__left",
property: "pose" // property: "pose"
}, // },
{ // {
selector: ".RootScene", // selector: ".RootScene",
component: "hand-pose__right", // component: "hand-pose__right",
property: "pose" // property: "pose"
}, // },
{ {
selector: ".camera", selector: ".camera",
component: "position" component: "position"
......
...@@ -33,3 +33,15 @@ export function patchWebGLRenderingContext() { ...@@ -33,3 +33,15 @@ export function patchWebGLRenderingContext() {
} }
WebGLRenderingContext.prototype.getExtension = patchedGetExtension; WebGLRenderingContext.prototype.getExtension = patchedGetExtension;
} }
// HACK: THIS SHOULD NOT GET MERGED TO MASTER
export function monkeyPatchPannerNode() {
const setPosition = PannerNode.prototype.setPosition;
PannerNode.prototype.setPosition = function(x, y, z) {
if (isNaN(x) || isNaN(y) || isNaN(z)) {
console.error("PannerNode.setPosition caled with invalid position", x, y, z);
} else {
setPosition.call(this, x, y, z);
}
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment