From 6452e92ac9436b712a47c51aade2b656f5f4917e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 25 May 2017 11:28:26 +1200 Subject: [PATCH] Hand controller data may not be valid --- scripts/system/libraries/WebTablet.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index a3090f05e7..5168e2340d 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -51,14 +51,18 @@ function calcSpawnInfo(hand, tabletHeight) { hand = NO_HANDS; } + var handController = null; if (HMD.active && hand !== NO_HANDS) { + handController = getControllerWorldLocation(hand, true); + } + + if (handController && handController.valid) { // Orient tablet per hand orientation. // Angle it back similar to holding it like a book. // Make it horizontal. // Move tablet up so that hand is at bottom. // Move tablet back so that hand is in front. - var handController = getControllerWorldLocation(hand, true); var position = handController.position; var rotation = handController.rotation;