get particle explorer working, again

This commit is contained in:
Seth Alves 2017-02-15 15:00:25 -08:00
parent 3ea0f6d2d2
commit 076b0ed3ab
5 changed files with 25 additions and 33 deletions

View file

@ -1924,12 +1924,17 @@ entityListTool.webView.webEventReceived.connect(function (data) {
selectedParticleEntity = ids[0];
particleExplorerTool.setActiveParticleEntity(ids[0]);
particleExplorerTool.webView.webEventReceived.connect(function (data) {
data = JSON.parse(data);
if (data.messageType === "page_loaded") {
particleExplorerTool.webView.emitScriptEvent(JSON.stringify(particleData));
}
});
if (Settings.getValue("HUDUIEnabled")) {
particleExplorerTool.webView.webEventReceived.connect(function (data) {
data = JSON.parse(data);
if (data.messageType === "page_loaded") {
particleExplorerTool.webView.emitScriptEvent(JSON.stringify(particleData));
}
});
} else {
// in the tablet version, the page was loaded earlier
particleExplorerTool.webView.emitScriptEvent(JSON.stringify(particleData));
}
} else {
selectedParticleEntity = 0;
particleExplorerTool.destroyWebView();

View file

@ -1034,30 +1034,13 @@ SelectionDisplay = (function() {
that.triggered = true;
if (activeHand !== hand) {
// No switching while the other is already triggered, so no need to release.
activeHand = (activeHand === Controller.Standard.RightHand) ? Controller.Standard.LeftHand : Controller.Standard.RightHand;
activeHand = (activeHand === Controller.Standard.RightHand) ?
Controller.Standard.LeftHand : Controller.Standard.RightHand;
}
if (Reticle.pointingAtSystemOverlay || Overlays.getOverlayAtPoint(Reticle.position)) {
return;
}
var eventResult = that.mousePressEvent({});
// if (!eventResult || (eventResult === 'selectionBox')) {
// var pickRay = controllerComputePickRay();
// if (pickRay) {
// var entityIntersection = Entities.findRayIntersection(pickRay, true);
// var overlayIntersection = Overlays.findRayIntersection(pickRay);
// if (entityIntersection.intersects &&
// (!overlayIntersection.intersects || (entityIntersection.distance < overlayIntersection.distance))) {
// if (HMD.tabletID === entityIntersection.entityID) {
// return;
// }
// selectionManager.setSelections([entityIntersection.entityID]);
// }
// }
// }
that.mousePressEvent({});
} else if (that.triggered && (value < that.TRIGGER_OFF_VALUE)) {
that.triggered = false;
that.mouseReleaseEvent({});
@ -2065,7 +2048,7 @@ SelectionDisplay = (function() {
Overlays.editOverlay(grabberPointLightL, {
visible: false
});
Overlays.editOverlay(grabberPointLightR, {
Overlays.editOverlay(grabberPointLightR, {
visible: false
});
Overlays.editOverlay(grabberPointLightF, {

View file

@ -76,4 +76,4 @@ body{
</div>
</body>
</html>
</html>

View file

@ -358,9 +358,12 @@ function listenForSettingsUpdates() {
settings[key] = value;
});
loadGUI();
if (gui) {
manuallyUpdateDisplay();
} else {
loadGUI();
}
}
});
}
@ -505,4 +508,4 @@ function registerDOMElementsForListenerBlocking() {
});
});
});
}
}

View file

@ -58,8 +58,9 @@ ParticleExplorerTool = function() {
that.activeParticleEntity = id;
}
if (Settings.getValue("HUDUIEnabled")) {
that.createWebView();
}
return that;
};