From 1811a2edc7044faa20bb738bf1e0c344a8221fb9 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 21 Mar 2017 19:45:00 +0100 Subject: [PATCH] fixed third eye laser --- scripts/system/controllers/handControllerGrab.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 1693a6137a..0f2bf3346a 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1018,6 +1018,16 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp) { } }; +function getControllerJointIndex(hand) { + if (HMD.isHandControllerAvailable()) { + return MyAvatar.getJointIndex(hand === RIGHT_HAND ? + "_CONTROLLER_RIGHTHAND" : + "_CONTROLLER_LEFTHAND"); + } + + return MyAvatar.getJointIndex("Head"); +} + // global EquipHotspotBuddy instance var equipHotspotBuddy = new EquipHotspotBuddy(); @@ -1029,9 +1039,7 @@ function MyController(hand) { this.homeButtonTouched = false; this.editTriggered = false; - this.controllerJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? - "_CONTROLLER_RIGHTHAND" : - "_CONTROLLER_LEFTHAND"); + this.controllerJointIndex = getControllerJointIndex(this.hand); // Until there is some reliable way to keep track of a "stack" of parentIDs, we'll have problems // when more than one avatar does parenting grabs on things. This script tries to work