diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 5d9e54ffe8..5bea6d9923 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -23,23 +23,23 @@ var TABLET_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Tablet-Model-v1- // * rotation - rotation of entity so it faces the user. function calcSpawnInfo(hand) { if (HMD.active && hand) { - 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); - 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) - }; - } + 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); + 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 @@ -97,7 +97,6 @@ WebTablet = function (url, width, dpi, hand, clientOnly) { this.homeButtonEntity = Entities.addEntity({ name: "homeButton", type: "Sphere", - collisionless: true, localPosition: {x: 0, y: HOME_BUTTON_Y_OFFSET, z: 0}, dimensions: {x: 0.05, y: 0.05, z: 0.05}, parentID: this.tabletEntityID, @@ -172,8 +171,3 @@ WebTablet.unpickle = function (string) { tablet.__proto__ = WebTablet.prototype; return tablet; }; - -WebTablet.prototype.getPosition = function () { - return Overlays.getProperty(this.webOverlayID, "position"); -} -