diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index c894642f80..09fe668080 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -22,24 +22,12 @@ var TABLET_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Tablet-Model-v1- // * position - position in front of the user // * rotation - rotation of entity so it faces the user. function calcSpawnInfo(hand) { - var pitchBackRotation = Quat.angleAxis(20.0, X_AXIS); - if (HMD.active) { - var handController = getControllerWorldLocation(hand, false); - var front = Quat.getFront(handController.orientation); - var up = Quat.getUp(handController.orientation); - var frontOffset = Vec3.sum(handController.position, Vec3.multiply(0.4, up)); - var finalOffset = Vec3.sum(frontOffset, Vec3.multiply(-0.3, front)); - return { - position: finalOffset, - rotation: Quat.lookAt(finalOffset, HMD.position, Y_AXIS) - }; - } else { - var front = Quat.getFront(MyAvatar.orientation); - return { - position: Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0}), - rotation: Quat.multiply(MyAvatar.orientation, pitchBackRotation) - }; - } + var front = Quat.getFront(MyAvatar.orientation); + var finalPosition = Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0}) + return { + position: finalPosition, + rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS) + }; } // ctor