From 0f80a8b7af6991a5873fafd220fde1600f2b9d27 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Tue, 30 May 2017 16:51:04 +0200 Subject: [PATCH 1/4] On create button, switch Tablet to landscape mode --- scripts/system/edit.js | 6 +++++- scripts/system/tablet-ui/tabletUI.js | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index f39165f3df..79064a02df 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -564,6 +564,8 @@ var toolBar = (function () { enabled: active })); isActive = active; + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + if (!isActive) { entityListTool.setVisible(false); gridTool.setVisible(false); @@ -572,8 +574,8 @@ var toolBar = (function () { selectionManager.clearSelections(); cameraManager.disable(); selectionDisplay.triggerMapping.disable(); + tablet.landscape = false; } else { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); tablet.loadQMLSource("Edit.qml"); UserActivityLogger.enabledEdit(); entityListTool.setVisible(true); @@ -581,6 +583,8 @@ var toolBar = (function () { grid.setEnabled(true); propertiesTool.setVisible(true); selectionDisplay.triggerMapping.enable(); + print("starting tablet in landscape mode") + tablet.landscape = true; // Not sure what the following was meant to accomplish, but it currently causes // everybody else to think that Interface has lost focus overall. fogbugzid:558 // Window.setFocus(); diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index f83e8d9550..e45fc8d87b 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -191,16 +191,12 @@ gTablet.updateAudioBar(currentMicLevel); } - if (validCheckTime - now > MSECS_PER_SEC/4) { - //each 250ms should be just fine + if (now - validCheckTime > MSECS_PER_SEC) { + validCheckTime = now; updateTabletWidthFromSettings(); if (UIWebTablet) { UIWebTablet.setLandscape(landscape); } - } - - if (validCheckTime - now > MSECS_PER_SEC) { - validCheckTime = now; if (tabletRezzed && UIWebTablet && !tabletIsValid()) { // when we switch domains, the tablet entity gets destroyed and recreated. this causes // the overlay to be deleted, but not recreated. If the overlay is deleted for this or any From b0e4b752d5c58208b2a8d0028177727d3a70af69 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Thu, 1 Jun 2017 19:07:17 +0200 Subject: [PATCH 2/4] Implements landscape mode for tablet as rotation instead of stretching --- scripts/system/libraries/WebTablet.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 757743accc..7545575127 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -22,7 +22,9 @@ var DEFAULT_WIDTH = 0.4375; var DEFAULT_VERTICAL_FIELD_OF_VIEW = 45; // degrees var SENSOR_TO_ROOM_MATRIX = -2; var CAMERA_MATRIX = -7; -var ROT_Y_180 = {x: 0, y: 1, z: 0, w: 0}; +var ROT_Y_180 = {x: 0.0, y: 1.0, z: 0, w: 0}; +var ROT_LANDSCAPE = {x: 1.0, y: 1.0, z: 0, w: 0}; +var ROT_LANDSCAPE_WINDOW = {x: 0.0, y: 0.0, z: 0.0, w: 0}; var ROT_IDENT = {x: 0, y: 0, z: 0, w: 1}; var TABLET_TEXTURE_RESOLUTION = { x: 480, y: 706 }; var INCHES_TO_METERS = 1 / 39.3701; @@ -243,29 +245,30 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) { }; WebTablet.prototype.getDimensions = function() { - if (this.landscape) { - return { x: this.width * 2, y: this.height, z: this.depth }; - } else { - return { x: this.width, y: this.height, z: this.depth }; - } + return { x: this.width, y: this.height, z: this.depth }; }; WebTablet.prototype.getTabletTextureResolution = function() { if (this.landscape) { - return { x: TABLET_TEXTURE_RESOLUTION.x * 2, y: TABLET_TEXTURE_RESOLUTION.y }; + return { x: TABLET_TEXTURE_RESOLUTION.y , y: TABLET_TEXTURE_RESOLUTION.x }; } else { return TABLET_TEXTURE_RESOLUTION; } }; WebTablet.prototype.setLandscape = function(newLandscapeValue) { - if (this.landscape == newLandscapeValue) { + if (this.landscape === newLandscapeValue) { return; } + + var tabletProperties = {}; + tabletProperties.visible = true; this.landscape = newLandscapeValue; - Overlays.editOverlay(this.tabletEntityID, { dimensions: this.getDimensions() }); + this.calculateTabletAttachmentProperties(NO_HANDS, false, tabletProperties); + Overlays.editOverlay(this.tabletEntityID, tabletProperties); Overlays.editOverlay(this.webOverlayID, { - resolution: this.getTabletTextureResolution() + resolution: this.getTabletTextureResolution(), + rotation: Quat.multiply(Camera.orientation, ROT_LANDSCAPE_WINDOW) }); }; @@ -407,7 +410,7 @@ WebTablet.prototype.calculateWorldAttitudeRelativeToCamera = function (windowPos return { position: worldMousePosition, - rotation: Quat.multiply(Camera.orientation, ROT_Y_180) + rotation: this.landscape ? Quat.multiply(Camera.orientation, ROT_LANDSCAPE) : Quat.multiply(Camera.orientation, ROT_Y_180) }; }; From 8068e7201d764986b4633ae1148610d45c02db3d Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Fri, 2 Jun 2017 18:58:18 +0200 Subject: [PATCH 3/4] Fix position after rotation. May be fix rotation in HMD mode --- scripts/system/libraries/WebTablet.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 7545575127..8c3f5d03bb 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -261,11 +261,10 @@ WebTablet.prototype.setLandscape = function(newLandscapeValue) { return; } - var tabletProperties = {}; - tabletProperties.visible = true; this.landscape = newLandscapeValue; - this.calculateTabletAttachmentProperties(NO_HANDS, false, tabletProperties); - Overlays.editOverlay(this.tabletEntityID, tabletProperties); + Overlays.editOverlay(this.tabletEntityID, + { rotation: this.landscape ? Quat.multiply(Camera.orientation, ROT_LANDSCAPE) : + Quat.multiply(Camera.orientation, ROT_Y_180) }); Overlays.editOverlay(this.webOverlayID, { resolution: this.getTabletTextureResolution(), rotation: Quat.multiply(Camera.orientation, ROT_LANDSCAPE_WINDOW) From 58c4a2f12ad197631cb3f9424c9e03d35aaf59fc Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 3 Jun 2017 06:26:13 +1200 Subject: [PATCH 4/4] Fix icon for polylines in entities editor properties page --- interface/resources/fonts/hifi-glyphs.ttf | Bin 27612 -> 28852 bytes scripts/system/html/js/entityProperties.js | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/resources/fonts/hifi-glyphs.ttf b/interface/resources/fonts/hifi-glyphs.ttf index 93f6fe6d1329139d0eefec86a05fdaed09e80e5d..548f61e1dece1e94381000f4a84d4e9d379d94a2 100644 GIT binary patch delta 2418 zcmZuzYit}>89m>IgETRICb1JY zPSZS^E)^=RkSb7Dl>VTAf>a?=q0)p3BvgTrfFDJPkPs3rD6J4bqNplTLHuYbx@)6? z;I3BRHwS4E)h4%q=8(_QVr&g9f{S+KnUIq}EU%WC0?>El?+Q-23 z;==6IOziFZp8$9lK)A3lTb&X^bPu33fR2TwiWWxPX=0kmEfbZ%;C_H5tv9|ETr6leMT%EcwV_*LL+6QE7jncXRdYib!SYOS&iOW>=0t}^oRdZ?hSa0ETvV6FFAOu<-X1lLlSw`L4MF;lPC_s_ zB$=2|mPsMFR#oX!oXa7Nt9VEg>WP+^z)|`+y@C`5unBu`n6?9zf@4?0O6Ui^=Sy8W zc912@DW;2du}~>g!g6VloWKu!J+GS-SZT+u6h^2N_@1oP35p*0^}u%QO0^z3COIk! z>r|8U`rIhh!!?=$I0eggvdkHB>^8Ekg5}tbWxGr&kZ$QxH(8QA6?ro72gx6#k{|d% z*&p`H>Q@TNrErA8N-3-il`ErFs)Ut z7>j6(>jq;&6sp9Cn5HoyNC?4+OU?z8EG{&e)VQ9sbxoM2#-)r4bAuHZLW@TtRxDyjJR?@lx%B6=b$IE|WMf`~I>#3Uoqh!~S5Q~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