Fix Web tablet screen size

This commit is contained in:
David Rowe 2016-12-05 10:03:30 +13:00 committed by Seth Alves
parent e85bc50333
commit beddad5807

View file

@ -13,7 +13,7 @@ Script.include(Script.resolvePath("../libraries/utils.js"));
var RAD_TO_DEG = 180 / Math.PI;
var X_AXIS = {x: 1, y: 0, z: 0};
var Y_AXIS = {x: 0, y: 1, z: 0};
var DEFAULT_DPI = 32;
var DEFAULT_DPI = 30;
var DEFAULT_WIDTH = 0.5;
var TABLET_URL = "https://s3.amazonaws.com/hifi-public/tony/tablet.fbx";
@ -45,7 +45,8 @@ WebTablet = function (url, width, dpi, location, clientOnly) {
var _this = this;
var ASPECT = 4.0 / 3.0;
var WIDTH = width || DEFAULT_WIDTH;
var HEIGHT = WIDTH * ASPECT;
var TABLET_HEIGHT_SCALE = 640 / 680; // Screen size of tablet entity isn't quite the desired aspect.
var HEIGHT = WIDTH * ASPECT * TABLET_HEIGHT_SCALE;
var DEPTH = 0.025;
var DPI = dpi || DEFAULT_DPI;
@ -58,8 +59,8 @@ WebTablet = function (url, width, dpi, location, clientOnly) {
}),
dimensions: {x: WIDTH, y: HEIGHT, z: DEPTH},
parentID: MyAvatar.sessionUUID,
parentJointIndex: -2
}
parentJointIndex: -1
}, clientOnly);
if (location) {
tabletProperties.localPosition = location.localPosition;
@ -72,7 +73,6 @@ WebTablet = function (url, width, dpi, location, clientOnly) {
this.tabletEntityID = Entities.addEntity(tabletProperties, clientOnly);
var WEB_OVERLAY_SCALE_FACTOR = { x: 2, y: 1.6 };
var WEB_OVERLAY_Z_OFFSET = -0.01;
var HOME_BUTTON_Y_OFFSET = -0.32;
@ -81,10 +81,10 @@ WebTablet = function (url, width, dpi, location, clientOnly) {
this.webOverlayID = Overlays.addOverlay("web3d", {
url: url,
dimensions: { x: WIDTH * WEB_OVERLAY_SCALE_FACTOR.x, y: HEIGHT * WEB_OVERLAY_SCALE_FACTOR.y },
position: webOverlayPosition,
rotation: webOverlayRotation,
resolution: { x: 480, y: 640 },
dpi: DPI,
color: { red: 255, green: 255, blue: 255 },
parentID: this.tabletEntityID,
parentJointIndex: -1