diff --git a/scripts/system/controllers/handControllerPointer.js b/scripts/system/controllers/handControllerPointer.js index 5e8c0cb6ba..0623ddf100 100644 --- a/scripts/system/controllers/handControllerPointer.js +++ b/scripts/system/controllers/handControllerPointer.js @@ -489,9 +489,11 @@ function setColoredLaser() { // answer trigger state if lasers supported, else f var color = (activeTrigger.state === 'full') ? LASER_TRIGGER_COLOR_XYZW : LASER_SEARCH_COLOR_XYZW; if (!HMD.isHandControllerAvailable()) { - var position = MyAvatar.getHeadPosition(); - var direction = Quat.getUp(Quat.multiply(MyAvatar.headOrientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 }))); - return HMD.setExtraLaser(position, true, color, direction); + // NOTE: keep this offset in sync with scripts/system/librarires/controllers.js:57 + var VERTICAL_HEAD_LASER_OFFSET = 0.1; + var position = Vec3.sum(HMD.position, Vec3.multiplyQbyV(HMD.orientation, {x: 0, y: VERTICAL_HEAD_LASER_OFFSET, z: 0})); + var orientation = Quat.multiply(HMD.orientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 })); + return HMD.setExtraLaser(position, true, color, Quat.getUp(orientation)); } return HMD.setHandLasers(activeHudLaser, true, color, SYSTEM_LASER_DIRECTION) && activeTrigger.state; diff --git a/scripts/system/libraries/controllers.js b/scripts/system/libraries/controllers.js index 2e3a4a1e57..75bca34ed6 100644 --- a/scripts/system/libraries/controllers.js +++ b/scripts/system/libraries/controllers.js @@ -52,8 +52,10 @@ getControllerWorldLocation = function (handController, doOffset) { } } else if (!HMD.isHandControllerAvailable()) { - position = MyAvatar.getHeadPosition(); - orientation = Quat.multiply(MyAvatar.headOrientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 })); + // NOTE: keep this offset in sync with scripts/system/controllers/handControllerPointer.js:493 + var VERTICAL_HEAD_LASER_OFFSET = 0.1; + position = Vec3.sum(Camera.position, Vec3.multiplyQbyV(Camera.orientation, {x: 0, y: VERTICAL_HEAD_LASER_OFFSET, z: 0})); + orientation = Quat.multiply(Camera.orientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 })); valid = true; }