Make laser click in sky deselect entity

This commit is contained in:
David Rowe 2018-05-17 15:09:23 +12:00
parent b74f42dc23
commit 801a4b9aba
2 changed files with 10 additions and 4 deletions

View file

@ -52,6 +52,11 @@ Script.include("/~/system/libraries/utils.js");
if (controllerData.triggerClicks[this.hand]) {
if (!this.triggerClicked) {
this.selectedTarget = controllerData.rayPicks[this.hand];
if (!this.selectedTarget.intersects) {
Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({
method: "clearSelection"
}));
}
}
if (this.selectedTarget.type === Picks.INTERSECTED_ENTITY) {
Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({

View file

@ -56,6 +56,8 @@ SelectionManager = (function() {
print("setting selection to " + messageParsed.entityID);
}
that.setSelections([messageParsed.entityID]);
} else if (messageParsed.method === "clearSelection") {
that.clearSelections();
}
}
@ -574,7 +576,7 @@ SelectionDisplay = (function() {
handleScaleFREdge,
handleScaleFLEdge,
handleCloner,
selectionBox // Must be last overlay.
selectionBox
];
overlayNames[handleTranslateXCone] = "handleTranslateXCone";
@ -1391,9 +1393,8 @@ SelectionDisplay = (function() {
};
// FUNCTION: SET OVERLAYS VISIBLE
that.setOverlaysVisible = function (isVisible) {
// Don't set selectionBox (last) overlay's visibility.
for (var i = 0, length = allOverlays.length - 1; i < length; i++) {
that.setOverlaysVisible = function(isVisible) {
for (var i = 0, length = allOverlays.length; i < length; i++) {
Overlays.editOverlay(allOverlays[i], { visible: isVisible });
}
};