From 008a58f9d708e00ce4d8de9de1d9ff70805bb903 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Tue, 31 Jan 2017 18:03:48 -0800 Subject: [PATCH] Only reposition the tablet when camera mode changes, in HMD mode. --- scripts/system/libraries/WebTablet.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index edb637d9a2..52912337a1 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -379,14 +379,16 @@ WebTablet.prototype.mousePressEvent = function (event) { WebTablet.prototype.cameraModeChanged = function (newMode) { // reposition the tablet, after a small delay. // This allows HMD.position to reflect the new camera mode. - var self = this; - Script.setTimeout(function () { - var NO_HANDS = -1; - var tabletProperties = {}; - // compute position, rotation & parentJointIndex of the tablet - self.calculateTabletAttachmentProperties(NO_HANDS, tabletProperties); - Entities.editEntity(self.tabletEntityID, tabletProperties); - }, 10); + if (HMD.active) { + var self = this; + Script.setTimeout(function () { + var NO_HANDS = -1; + var tabletProperties = {}; + // compute position, rotation & parentJointIndex of the tablet + self.calculateTabletAttachmentProperties(NO_HANDS, tabletProperties); + Entities.editEntity(self.tabletEntityID, tabletProperties); + }, 10); + } }; function rayIntersectPlane(planePosition, planeNormal, rayStart, rayDirection) {