From 5890503ec032ee31fa3f062fd8eefebebf2b555b Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 2 Feb 2017 10:56:56 -0800 Subject: [PATCH] Can now grab tablet in 2d mode even when it embedded in geometry --- scripts/system/libraries/WebTablet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 75ca2e514f..9a9c963a39 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -252,6 +252,7 @@ WebTablet.prototype.geometryChanged = function (geometry) { // calclulate the appropriate position of the tablet in world space, such that it fits in the center of the screen. // with a bit of padding on the top and bottom. WebTablet.prototype.calculateWorldAttitudeRelativeToCamera = function () { + var fov = (Settings.getValue('fieldOfView') || DEFAULT_VERTICAL_FIELD_OF_VIEW) * (Math.PI / 180); var MAX_PADDING_FACTOR = 2.2; var PADDING_FACTOR = Math.min(Window.innerHeight / TABLET_TEXTURE_RESOLUTION.y, MAX_PADDING_FACTOR); @@ -357,7 +358,7 @@ WebTablet.prototype.getPosition = function () { WebTablet.prototype.mousePressEvent = function (event) { var pickRay = Camera.computePickRay(event.x, event.y); - var entityPickResults = Entities.findRayIntersection(pickRay, true); // non-accurate picking + var entityPickResults = Entities.findRayIntersection(pickRay, true, [this.tabletEntityID]); // non-accurate picking if (entityPickResults.intersects && entityPickResults.entityID === this.tabletEntityID) { var overlayPickResults = Overlays.findRayIntersection(pickRay); if (overlayPickResults.intersects && overlayPickResults.overlayID === HMD.homeButtonID) {