Merge branch 'master' of https://github.com/highfidelity/hifi into do-not-get-stuck-in-floor

This commit is contained in:
howard-stearns 2017-06-05 13:44:56 -07:00
commit 91fff7d54d
5 changed files with 22 additions and 19 deletions

View file

@ -642,6 +642,8 @@ var toolBar = (function () {
enabled: active enabled: active
})); }));
isActive = active; isActive = active;
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
if (!isActive) { if (!isActive) {
entityListTool.setVisible(false); entityListTool.setVisible(false);
gridTool.setVisible(false); gridTool.setVisible(false);
@ -650,8 +652,8 @@ var toolBar = (function () {
selectionManager.clearSelections(); selectionManager.clearSelections();
cameraManager.disable(); cameraManager.disable();
selectionDisplay.triggerMapping.disable(); selectionDisplay.triggerMapping.disable();
tablet.landscape = false;
} else { } else {
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
tablet.loadQMLSource("Edit.qml"); tablet.loadQMLSource("Edit.qml");
UserActivityLogger.enabledEdit(); UserActivityLogger.enabledEdit();
entityListTool.setVisible(true); entityListTool.setVisible(true);
@ -659,6 +661,8 @@ var toolBar = (function () {
grid.setEnabled(true); grid.setEnabled(true);
propertiesTool.setVisible(true); propertiesTool.setVisible(true);
selectionDisplay.triggerMapping.enable(); 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 // 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 // everybody else to think that Interface has lost focus overall. fogbugzid:558
// Window.setFocus(); // Window.setFocus();

View file

@ -20,7 +20,8 @@ var ICON_FOR_TYPE = {
Light: "p", Light: "p",
Zone: "o", Zone: "o",
PolyVox: "", PolyVox: "",
Multiple: "" Multiple: "",
PolyLine: ""
} }
var EDITOR_TIMEOUT_DURATION = 1500; var EDITOR_TIMEOUT_DURATION = 1500;

View file

@ -22,7 +22,9 @@ var DEFAULT_WIDTH = 0.4375;
var DEFAULT_VERTICAL_FIELD_OF_VIEW = 45; // degrees var DEFAULT_VERTICAL_FIELD_OF_VIEW = 45; // degrees
var SENSOR_TO_ROOM_MATRIX = -2; var SENSOR_TO_ROOM_MATRIX = -2;
var CAMERA_MATRIX = -7; 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 ROT_IDENT = {x: 0, y: 0, z: 0, w: 1};
var TABLET_TEXTURE_RESOLUTION = { x: 480, y: 706 }; var TABLET_TEXTURE_RESOLUTION = { x: 480, y: 706 };
var INCHES_TO_METERS = 1 / 39.3701; var INCHES_TO_METERS = 1 / 39.3701;
@ -243,29 +245,29 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) {
}; };
WebTablet.prototype.getDimensions = function() { 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() { WebTablet.prototype.getTabletTextureResolution = function() {
if (this.landscape) { 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 { } else {
return TABLET_TEXTURE_RESOLUTION; return TABLET_TEXTURE_RESOLUTION;
} }
}; };
WebTablet.prototype.setLandscape = function(newLandscapeValue) { WebTablet.prototype.setLandscape = function(newLandscapeValue) {
if (this.landscape == newLandscapeValue) { if (this.landscape === newLandscapeValue) {
return; return;
} }
this.landscape = newLandscapeValue; this.landscape = newLandscapeValue;
Overlays.editOverlay(this.tabletEntityID, { dimensions: this.getDimensions() }); Overlays.editOverlay(this.tabletEntityID,
{ rotation: this.landscape ? Quat.multiply(Camera.orientation, ROT_LANDSCAPE) :
Quat.multiply(Camera.orientation, ROT_Y_180) });
Overlays.editOverlay(this.webOverlayID, { Overlays.editOverlay(this.webOverlayID, {
resolution: this.getTabletTextureResolution() resolution: this.getTabletTextureResolution(),
rotation: Quat.multiply(Camera.orientation, ROT_LANDSCAPE_WINDOW)
}); });
}; };
@ -407,7 +409,7 @@ WebTablet.prototype.calculateWorldAttitudeRelativeToCamera = function (windowPos
return { return {
position: worldMousePosition, 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)
}; };
}; };

View file

@ -191,16 +191,12 @@
gTablet.updateAudioBar(currentMicLevel); gTablet.updateAudioBar(currentMicLevel);
} }
if (validCheckTime - now > MSECS_PER_SEC/4) { if (now - validCheckTime > MSECS_PER_SEC) {
//each 250ms should be just fine validCheckTime = now;
updateTabletWidthFromSettings(); updateTabletWidthFromSettings();
if (UIWebTablet) { if (UIWebTablet) {
UIWebTablet.setLandscape(landscape); UIWebTablet.setLandscape(landscape);
} }
}
if (validCheckTime - now > MSECS_PER_SEC) {
validCheckTime = now;
if (tabletRezzed && UIWebTablet && !tabletIsValid()) { if (tabletRezzed && UIWebTablet && !tabletIsValid()) {
// when we switch domains, the tablet entity gets destroyed and recreated. this causes // 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 // the overlay to be deleted, but not recreated. If the overlay is deleted for this or any