From 89b3a4d9872c4864af6501f7a56de959bca2bc35 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 12:17:10 -0800 Subject: [PATCH 01/12] Fix selection shadow not updating when grid moves --- examples/libraries/gridTool.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/libraries/gridTool.js b/examples/libraries/gridTool.js index de4fd7b8d4..aa412b1a76 100644 --- a/examples/libraries/gridTool.js +++ b/examples/libraries/gridTool.js @@ -177,6 +177,8 @@ Grid = function(opts) { color: gridColor, alpha: gridAlpha, }); + + that.emitUpdate(); } function cleanup() { @@ -207,6 +209,7 @@ GridTool = function(opts) { horizontalGrid.addListener(function(data) { webView.eventBridge.emitScriptEvent(JSON.stringify(data)); + selectionDisplay.updateHandles(); }); webView.eventBridge.webEventReceived.connect(function(data) { From 167ab05de4bf6a0fbf4ac104de6b0ab8086e3a8a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 15:19:51 -0800 Subject: [PATCH 02/12] Default 'Allow Select Large/Small Models' to true --- examples/newEditEntities.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index bc2d87259e..b013b40bce 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -51,8 +51,8 @@ var toolWidth = 50; var MIN_ANGULAR_SIZE = 2; var MAX_ANGULAR_SIZE = 45; -var allowLargeModels = false; -var allowSmallModels = false; +var allowLargeModels = true; +var allowSmallModels = true; var wantEntityGlow = false; var SPAWN_DISTANCE = 1; @@ -644,9 +644,9 @@ function setupModelMenus() { Menu.addMenuItem({ menuName: "Edit", menuItemName: "Model List...", afterItem: "Models" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Paste Models", shortcutKey: "CTRL+META+V", afterItem: "Edit Properties..." }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Allow Select Large Models", shortcutKey: "CTRL+META+L", - afterItem: "Paste Models", isCheckable: true }); + afterItem: "Paste Models", isCheckable: true, isChecked: true }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Allow Select Small Models", shortcutKey: "CTRL+META+S", - afterItem: "Allow Select Large Models", isCheckable: true }); + afterItem: "Allow Select Large Models", isCheckable: true, isChecked: true }); Menu.addMenuItem({ menuName: "File", menuItemName: "Models", isSeparator: true, beforeItem: "Settings" }); Menu.addMenuItem({ menuName: "File", menuItemName: "Export Models", shortcutKey: "CTRL+META+E", afterItem: "Models" }); From 77365ec2829150819debd02c1acf212708126440 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 15:49:45 -0800 Subject: [PATCH 03/12] Move entity selection to click event and add ability to deselect --- examples/libraries/entitySelectionTool.js | 12 +- examples/newEditEntities.js | 129 ++++++++++++---------- 2 files changed, 80 insertions(+), 61 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 1a43231f6f..8fffcf276f 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -89,11 +89,19 @@ SelectionManager = (function() { } } - that.addEntity = function(entityID) { + that.addEntity = function(entityID, toggleSelection) { if (entityID.isKnownID) { - var idx = that.selections.indexOf(entityID); + var idx = -1; + for (var i = 0; i < that.selections.length; i++) { + if (entityID.id == that.selections[i].id) { + idx = i; + break; + } + } if (idx == -1) { that.selections.push(entityID); + } else if (toggleSelection) { + that.selections.splice(idx, 1); } } else { var idx = that.pendingSelections.indexOf(entityID); diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index b013b40bce..db59944d57 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -485,74 +485,18 @@ function findClickedEntity(event) { return { pickRay: pickRay, entityID: foundEntity }; } +var mouseHasMovedSincePress = false; function mousePressEvent(event) { + mouseHasMovedSincePress = false; + if (toolBar.mousePressEvent(event) || progressDialog.mousePressEvent(event)) { return; } if (isActive) { - var entitySelected = false; if (cameraManager.mousePressEvent(event) || selectionDisplay.mousePressEvent(event)) { // Event handled; do nothing. return; - } else { - var result = findClickedEntity(event); - if (result === null) { - selectionManager.clearSelections(); - return; - } - var pickRay = result.pickRay; - var foundEntity = result.entityID; - - var properties = Entities.getEntityProperties(foundEntity); - if (isLocked(properties)) { - print("Model locked " + properties.id); - } else { - var halfDiagonal = Vec3.length(properties.dimensions) / 2.0; - - print("Checking properties: " + properties.id + " " + properties.isKnownID + " - Half Diagonal:" + halfDiagonal); - // P P - Model - // /| A - Palm - // / | d B - unit vector toward tip - // / | X - base of the perpendicular line - // A---X----->B d - distance fom axis - // x x - distance from A - // - // |X-A| = (P-A).B - // X == A + ((P-A).B)B - // d = |P-X| - - var A = pickRay.origin; - var B = Vec3.normalize(pickRay.direction); - var P = properties.position; - - var x = Vec3.dot(Vec3.subtract(P, A), B); - var X = Vec3.sum(A, Vec3.multiply(B, x)); - var d = Vec3.length(Vec3.subtract(P, X)); - var halfDiagonal = Vec3.length(properties.dimensions) / 2.0; - - var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), properties.position)) * 180 / 3.14; - - var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE) - && (allowSmallModels || angularSize > MIN_ANGULAR_SIZE); - - if (0 < x && sizeOK) { - entitySelected = true; - selectedEntityID = foundEntity; - orientation = MyAvatar.orientation; - intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation)); - - if (!event.isShifted) { - selectionManager.clearSelections(); - } - selectionManager.addEntity(foundEntity); - - print("Model selected: " + foundEntity.id); - } - } - } - if (entitySelected) { - selectionDisplay.select(selectedEntityID, event); } } else if (Menu.isOptionChecked(MENU_INSPECT_TOOL_ENABLED)) { var result = findClickedEntity(event); @@ -572,6 +516,7 @@ function mousePressEvent(event) { var highlightedEntityID = { isKnownID: false }; function mouseMoveEvent(event) { + mouseHasMovedSincePress = true; if (isActive) { // allow the selectionDisplay and cameraManager to handle the event first, if it doesn't handle it, then do our own thing if (selectionDisplay.mouseMoveEvent(event) || cameraManager.mouseMoveEvent(event)) { @@ -615,6 +560,72 @@ function mouseReleaseEvent(event) { } cameraManager.mouseReleaseEvent(event); + + if (!mouseHasMovedSincePress) { + mouseClickEvent(event); + } +} + +function mouseClickEvent(event) { + var result = findClickedEntity(event); + if (result === null) { + if (!event.isShifted) { + selectionManager.clearSelections(); + } + return; + } + var pickRay = result.pickRay; + var foundEntity = result.entityID; + + var properties = Entities.getEntityProperties(foundEntity); + if (isLocked(properties)) { + print("Model locked " + properties.id); + } else { + var halfDiagonal = Vec3.length(properties.dimensions) / 2.0; + + print("Checking properties: " + properties.id + " " + properties.isKnownID + " - Half Diagonal:" + halfDiagonal); + // P P - Model + // /| A - Palm + // / | d B - unit vector toward tip + // / | X - base of the perpendicular line + // A---X----->B d - distance fom axis + // x x - distance from A + // + // |X-A| = (P-A).B + // X == A + ((P-A).B)B + // d = |P-X| + + var A = pickRay.origin; + var B = Vec3.normalize(pickRay.direction); + var P = properties.position; + + var x = Vec3.dot(Vec3.subtract(P, A), B); + var X = Vec3.sum(A, Vec3.multiply(B, x)); + var d = Vec3.length(Vec3.subtract(P, X)); + var halfDiagonal = Vec3.length(properties.dimensions) / 2.0; + + var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), properties.position)) * 180 / 3.14; + + var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE) + && (allowSmallModels || angularSize > MIN_ANGULAR_SIZE); + + if (0 < x && sizeOK) { + entitySelected = true; + selectedEntityID = foundEntity; + orientation = MyAvatar.orientation; + intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation)); + + if (!event.isShifted) { + selectionManager.clearSelections(); + } + + var toggle = event.isShifted; + selectionManager.addEntity(foundEntity, toggle); + + print("Model selected: " + foundEntity.id); + selectionDisplay.select(selectedEntityID, event); + } + } } Controller.mousePressEvent.connect(mousePressEvent); From 2b5a4e4563249c20584ded8295613df882176fe0 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 15:56:43 -0800 Subject: [PATCH 04/12] Add selection boxes in multi-selection mode --- examples/libraries/entitySelectionTool.js | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 8fffcf276f..302c612f15 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -347,6 +347,8 @@ SelectionDisplay = (function () { lineWidth: 1.0, }); + var selectionBoxes = []; + var rotationDegreesDisplay = Overlays.addOverlay("text3d", { position: { x:0, y: 0, z: 0}, text: "", @@ -692,6 +694,9 @@ SelectionDisplay = (function () { for (var i = 0; i < allOverlays.length; i++) { Overlays.deleteOverlay(allOverlays[i]); } + for (var i = 0; i < selectionBoxes.length; i++) { + Overlays.deleteOverlay(selectionBoxes[i]); + } }; that.highlightSelectable = function(entityID) { @@ -1134,6 +1139,33 @@ SelectionDisplay = (function () { visible: !(mode == "ROTATE_YAW" || mode == "ROTATE_PITCH" || mode == "ROTATE_ROLL"), }); + // Create more selection box overlays if we don't have enough + var overlaysNeeded = selectionManager.selections.length - selectionBoxes.length; + for (var i = 0; i < overlaysNeeded; i++) { + selectionBoxes.push( + Overlays.addOverlay("cube", { + position: { x: 0, y: 0, z: 0 }, + size: 1, + color: { red: 255, green: 153, blue: 0 }, + alpha: 1, + solid: false, + visible: false, + dashed: false, + lineWidth: 1.0, + ignoreRayIntersection: true, + })); + } + + for (var i = 0; i < selectionManager.selections.length; i++) { + var properties = Entities.getEntityProperties(selectionManager.selections[i]); + Overlays.editOverlay(selectionBoxes[i], { + position: properties.position, + rotation: properties.rotation, + dimensions: properties.dimensions, + visible: true, + }); + } + Overlays.editOverlay(grabberEdgeTR, { visible: extendedStretchHandlesVisible, rotation: rotation, position: EdgeTR }); Overlays.editOverlay(grabberEdgeTL, { visible: extendedStretchHandlesVisible, rotation: rotation, position: EdgeTL }); Overlays.editOverlay(grabberEdgeTF, { visible: extendedStretchHandlesVisible, rotation: rotation, position: EdgeTF }); @@ -1157,6 +1189,10 @@ SelectionDisplay = (function () { for (var i = 0; i < length; i++) { Overlays.editOverlay(allOverlays[i], { visible: isVisible }); } + length = selectionBoxes.length; + for (var i = 0; i < length; i++) { + Overlays.editOverlay(selectionBoxes[i], { visible: isVisible }); + } }; that.unselect = function (entityID) { From 2f1ceb922a5a0a2d4ba92dd732b0a91e4d77842e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 15:59:56 -0800 Subject: [PATCH 05/12] Increase size of selection boxes --- examples/libraries/entitySelectionTool.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 302c612f15..92d432df1e 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -332,7 +332,7 @@ SelectionDisplay = (function () { solid: false, visible: false, dashed: true, - lineWidth: 1.0, + lineWidth: 2.0, ignoreRayIntersection: true // this never ray intersects }); @@ -344,7 +344,7 @@ SelectionDisplay = (function () { solid: false, visible: false, dashed: true, - lineWidth: 1.0, + lineWidth: 2.0, }); var selectionBoxes = []; From 0fb0169ff26266487935783e01f6ae5d8c8cd62c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 16:00:33 -0800 Subject: [PATCH 06/12] Move baseOfEntityProjectionOverlay update to updateHandles() --- examples/libraries/entitySelectionTool.js | 35 +++++++++++------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 92d432df1e..babf658f95 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -946,23 +946,6 @@ SelectionDisplay = (function () { var dimensions = selectionManager.worldDimensions; var position = selectionManager.worldPosition; - Overlays.editOverlay(baseOfEntityProjectionOverlay, - { - visible: mode != "ROTATE_YAW" && mode != "ROTATE_PITCH" && mode != "ROTATE_ROLL", - solid: true, - // lineWidth: 2.0, - position: { - x: position.x, - y: grid.getOrigin().y, - z: position.z - }, - dimensions: { - x: dimensions.x, - y: dimensions.z - }, - rotation: rotation, - }); - Overlays.editOverlay(rotateOverlayTarget, { visible: rotationOverlaysVisible }); Overlays.editOverlay(rotateZeroOverlay, { visible: rotationOverlaysVisible }); @@ -999,7 +982,6 @@ SelectionDisplay = (function () { return; } - that.updateRotationHandles(); that.highlightSelectable(); @@ -1182,6 +1164,23 @@ SelectionDisplay = (function () { var grabberMoveUpOffset = 0.1; grabberMoveUpPosition = { x: position.x, y: position.y + worldTop + grabberMoveUpOffset, z: position.z } Overlays.editOverlay(grabberMoveUp, { visible: activeTool == null || mode == "TRANSLATE_UP_DOWN" }); + + Overlays.editOverlay(baseOfEntityProjectionOverlay, { + visible: mode != "ROTATE_YAW" && mode != "ROTATE_PITCH" && mode != "ROTATE_ROLL", + solid: true, + position: { + x: selectionManager.worldPosition.x, + y: grid.getOrigin().y, + z: selectionManager.worldPosition.z + }, + dimensions: { + x: selectionManager.worldDimensions.x, + y: selectionManager.worldDimensions.z + }, + rotation: Quat.fromPitchYawRollDegrees(0, 0, 0), + }); + + }; that.setOverlaysVisible = function(isVisible) { From 30a7b609586192b3a137003cefbe1f00bd2cfa6f Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 16:01:09 -0800 Subject: [PATCH 07/12] Update checkMove to only update rotation handles instead of all handles --- examples/libraries/entitySelectionTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index babf658f95..f88a5c576f 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -2053,7 +2053,7 @@ SelectionDisplay = (function () { that.checkMove = function() { if (SelectionManager.hasSelection() && (!Vec3.equal(Camera.getPosition(), lastCameraPosition) || !Quat.equal(Camera.getOrientation(), lastCameraOrientation))){ - that.select(selectionManager.selections[0], false, false); + that.updateRotationHandles(); } }; From c4ca7e1b18df38381539da8bbf32b4eb6344bf05 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 16:01:40 -0800 Subject: [PATCH 08/12] Remove clearSelections from findClickedEntity - it shouldn't handle it --- examples/newEditEntities.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index db59944d57..92db9daab5 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -476,7 +476,6 @@ function findClickedEntity(event) { var identify = Entities.identifyEntity(foundEntity); if (!identify.isKnownID) { print("Unknown ID " + identify.id + " (update loop " + foundEntity.id + ")"); - selectionManager.clearSelections(); return null; } foundEntity = identify; From aa067bc15389c492baf51d279115e9222b3a707c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 17:49:25 -0800 Subject: [PATCH 09/12] Update UpDown translation to follow the mouse as other tools do --- examples/libraries/entitySelectionTool.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index f88a5c576f..5f2549a85c 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -1297,10 +1297,17 @@ SelectionDisplay = (function () { }; var lastXYPick = null + var upDownPickNormal = null; addGrabberTool(grabberMoveUp, { mode: "TRANSLATE_UP_DOWN", onBegin: function(event) { - lastXYPick = rayPlaneIntersection(pickRay, SelectionManager.worldPosition, Quat.getFront(lastCameraOrientation)); + pickRay = Camera.computePickRay(event.x, event.y); + + upDownPickNormal = Quat.getFront(lastCameraOrientation); + // Remove y component so the y-axis lies along the plane we picking on - this will + // give movements that follow the mouse. + upDownPickNormal.y = 0; + lastXYPick = rayPlaneIntersection(pickRay, SelectionManager.worldPosition, upDownPickNormal); SelectionManager.saveProperties(); @@ -1328,11 +1335,9 @@ SelectionDisplay = (function () { pickRay = Camera.computePickRay(event.x, event.y); // translate mode left/right based on view toward entity - var newIntersection = rayPlaneIntersection(pickRay, - SelectionManager.worldPosition, - Quat.getFront(lastCameraOrientation)); + var newIntersection = rayPlaneIntersection(pickRay, SelectionManager.worldPosition, upDownPickNormal); - var vector = Vec3.subtract(newIntersection, lastPlaneIntersection); + var vector = Vec3.subtract(newIntersection, lastXYPick); vector = grid.snapToGrid(vector); // we only care about the Y axis From f25d509363e0daf52fe83c4901dce70e9455ffef Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 17:50:34 -0800 Subject: [PATCH 10/12] Remove unused lastPlaneIntersection --- examples/libraries/entitySelectionTool.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 5f2549a85c..077c77f999 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -235,7 +235,6 @@ SelectionDisplay = (function () { var overlayNames = new Array(); var lastCameraPosition = Camera.getPosition(); var lastCameraOrientation = Camera.getOrientation(); - var lastPlaneIntersection; var handleHoverColor = { red: 224, green: 67, blue: 36 }; var handleHoverAlpha = 1.0; @@ -721,13 +720,11 @@ SelectionDisplay = (function () { if (event !== false) { pickRay = Camera.computePickRay(event.x, event.y); - lastPlaneIntersection = rayPlaneIntersection(pickRay, properties.position, Quat.getFront(lastCameraOrientation)); var wantDebug = false; if (wantDebug) { print("select() with EVENT...... "); print(" event.y:" + event.y); - Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection); Vec3.print(" current position:", properties.position); } @@ -1285,7 +1282,6 @@ SelectionDisplay = (function () { if (wantDebug) { print("translateXZ... "); - Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection); Vec3.print(" vector:", vector); Vec3.print(" newPosition:", properties.position); Vec3.print(" newPosition:", newPosition); @@ -1348,7 +1344,6 @@ SelectionDisplay = (function () { if (wantDebug) { print("translateUpDown... "); print(" event.y:" + event.y); - Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection); Vec3.print(" newIntersection:", newIntersection); Vec3.print(" vector:", vector); Vec3.print(" newPosition:", newPosition); @@ -1561,7 +1556,6 @@ SelectionDisplay = (function () { var wantDebug = false; if (wantDebug) { print(stretchMode); - Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection); Vec3.print(" newIntersection:", newIntersection); Vec3.print(" vector:", vector); Vec3.print(" oldPOS:", oldPOS); @@ -2310,11 +2304,8 @@ SelectionDisplay = (function () { if (somethingClicked) { pickRay = Camera.computePickRay(event.x, event.y); - lastPlaneIntersection = rayPlaneIntersection(pickRay, selectionManager.worldPosition, - Quat.getFront(lastCameraOrientation)); if (wantDebug) { - print("mousePressEvent()...... " + overlayNames[result.overlayID]); - Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection); + print("mousePressEvent()...... " + overlayNames[result.overlayID]); } } From 4e78003520504187bcb68b435a08f59b43a9a7ff Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 2 Dec 2014 18:03:00 -0800 Subject: [PATCH 11/12] Fix issue with selection boxes not being hidden --- examples/libraries/entitySelectionTool.js | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 077c77f999..fff1a54abd 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -1135,14 +1135,22 @@ SelectionDisplay = (function () { })); } - for (var i = 0; i < selectionManager.selections.length; i++) { - var properties = Entities.getEntityProperties(selectionManager.selections[i]); - Overlays.editOverlay(selectionBoxes[i], { - position: properties.position, - rotation: properties.rotation, - dimensions: properties.dimensions, - visible: true, - }); + var i = 0; + // Only show individual selections boxes if there is more than 1 selection + if (selectionManager.selections.length > 1) { + for (; i < selectionManager.selections.length; i++) { + var properties = Entities.getEntityProperties(selectionManager.selections[i]); + Overlays.editOverlay(selectionBoxes[i], { + position: properties.position, + rotation: properties.rotation, + dimensions: properties.dimensions, + visible: true, + }); + } + } + // Hide any remaining selection boxes + for (; i < selectionBoxes.length; i++) { + Overlays.editOverlay(selectionBoxes[i], { visible: false }); } Overlays.editOverlay(grabberEdgeTR, { visible: extendedStretchHandlesVisible, rotation: rotation, position: EdgeTR }); From d08337326ce9117eef95c8451354ab6f427475a5 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 3 Dec 2014 12:59:51 -0800 Subject: [PATCH 12/12] Update selection box color to red --- examples/libraries/entitySelectionTool.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index fff1a54abd..40b5b78a31 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -338,12 +338,12 @@ SelectionDisplay = (function () { var selectionBox = Overlays.addOverlay("cube", { position: { x:0, y: 0, z: 0}, size: 1, - color: { red: 60, green: 60, blue: 60}, + color: { red: 255, green: 0, blue: 0}, alpha: 1, solid: false, visible: false, - dashed: true, - lineWidth: 2.0, + dashed: false, + lineWidth: 1.0, }); var selectionBoxes = [];