mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 16:23:39 +02:00
Merge pull request #9460 from druiz17/touchUp
Tablet button clickable in desktop mode && correct icons for switch
This commit is contained in:
commit
2f08972578
2 changed files with 16 additions and 2 deletions
|
@ -42,6 +42,17 @@ var button;
|
|||
var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode'];
|
||||
function onHmdChanged(isHmd) {
|
||||
//TODO change button icon when the hmd changes
|
||||
if (isHmd) {
|
||||
button.editProperties({
|
||||
icon: "icons/tablet-icons/switch-a.svg",
|
||||
text: "DESKTOP"
|
||||
});
|
||||
} else {
|
||||
button.editProperties({
|
||||
icon: "icons/tablet-icons/switch-i.svg",
|
||||
text: "VR"
|
||||
});
|
||||
}
|
||||
desktopOnlyViews.forEach(function (view) {
|
||||
Menu.setMenuEnabled("View>" + view, !isHmd);
|
||||
});
|
||||
|
|
|
@ -204,7 +204,7 @@ WebTablet.prototype.getOverlayObject = function () {
|
|||
WebTablet.prototype.destroy = function () {
|
||||
Overlays.deleteOverlay(this.webOverlayID);
|
||||
Entities.deleteEntity(this.tabletEntityID);
|
||||
Overlays.deleteEntity(this.homeButtonEntity);
|
||||
Overlays.deleteOverlay(this.homeButtonEntity);
|
||||
HMD.displayModeChanged.disconnect(this.myOnHmdChanged);
|
||||
|
||||
if (!HMD.active) {
|
||||
|
@ -319,7 +319,10 @@ WebTablet.prototype.mousePressEvent = function (event) {
|
|||
var entityPickResults = Entities.findRayIntersection(pickRay, true); // non-accurate picking
|
||||
if (entityPickResults.intersects && entityPickResults.entityID === this.tabletEntityID) {
|
||||
var overlayPickResults = Overlays.findRayIntersection(pickRay);
|
||||
if (!overlayPickResults.intersects || !overlayPickResults.overlayID === this.webOverlayID) {
|
||||
if (overlayPickResults.intersects && overlayPickResults.overlayID === HMD.homeButtonID) {
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.gotoHomeScreen();
|
||||
} else if (!overlayPickResults.intersects || !overlayPickResults.overlayID === this.webOverlayID) {
|
||||
this.dragging = true;
|
||||
var invCameraXform = new Xform(Camera.orientation, Camera.position).inv();
|
||||
this.initialLocalIntersectionPoint = invCameraXform.xformPoint(entityPickResults.intersection);
|
||||
|
|
Loading…
Reference in a new issue