From 96dd1eaf766c76cea4e85ac8734fbaa993b556c6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 3 Nov 2014 16:57:10 -0800 Subject: [PATCH 1/9] report restricted access state from domain-server in heartbeat --- domain-server/src/DomainServer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 131aa3fbe3..a2198370ce 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1109,6 +1109,14 @@ void DomainServer::sendHeartbeatToDataServer(const QString& networkAddress) { domainObject[AUTOMATIC_NETWORKING_KEY] = _automaticNetworkingSetting; + // add a flag to indicate if this domain uses restricted access - for now that will exclude it from listings + const QString RESTRICTED_ACCESS_FLAG = "restricted"; + + const QVariant* allowedUsersVariant = valueForKeyPath(_settingsManager.getSettingsMap(), + ALLOWED_USERS_SETTINGS_KEYPATH); + QStringList allowedUsers = allowedUsersVariant ? allowedUsersVariant->toStringList() : QStringList(); + domainObject[RESTRICTED_ACCESS_FLAG] = (allowedUsers.size() > 0); + // add the number of currently connected agent users int numConnectedAuthedUsers = 0; foreach(const SharedNodePointer& node, LimitedNodeList::getInstance()->getNodeHash()) { From 640c2c5fbfaf045d605c5205bd6deb5ccb981058 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 4 Nov 2014 08:30:10 -0800 Subject: [PATCH 2/9] Add optional orientation easing to entity camera --- examples/libraries/entityCameraTool.js | 56 +++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index d591d33b6d..48abffb01e 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -34,6 +34,13 @@ var EASING_MULTIPLIER = 8; var INITIAL_ZOOM_DISTANCE = 2; var INITIAL_ZOOM_DISTANCE_FIRST_PERSON = 3; +var easeOutCubic = function(t) { + t--; + return t * t * t + 1; +}; + +EASE_TIME = 0.5; + CameraManager = function() { var that = {}; @@ -51,6 +58,10 @@ CameraManager = function() { that.focalPoint = { x: 0, y: 0, z: 0 }; that.targetFocalPoint = { x: 0, y: 0, z: 0 }; + easing = false; + easingTime = 0; + startOrientation = Quat.fromPitchYawRollDegrees(0, 0, 0); + that.previousCameraMode = null; that.lastMousePosition = { x: 0, y: 0 }; @@ -100,13 +111,35 @@ CameraManager = function() { cameraTool.setVisible(false); } - that.focus = function() { - var dim = SelectionManager.worldDimensions; - var size = Math.max(dim.x, Math.max(dim.y, dim.z)); + that.focus = function(position, dimensions, easeOrientation) { + if (dimensions) { + var size = Math.max(dimensions.x, Math.max(dimensions.y, dimensions.z)); + that.targetZoomDistance = Math.max(size * FOCUS_ZOOM_SCALE, FOCUS_MIN_ZOOM); + } else { + that.targetZoomDistance = Vec3.length(Vec3.subtract(Camera.getPosition(), position)); + } - that.targetZoomDistance = Math.max(size * FOCUS_ZOOM_SCALE, FOCUS_MIN_ZOOM); + if (easeOrientation) { + // Do eased turning towards target + that.focalPoint = that.targetFocalPoint = position; - that.setFocalPoint(SelectionManager.worldPosition); + that.zoomDistance = that.targetZoomDistance = Vec3.length(Vec3.subtract(Camera.getPosition(), position)); + + var dPos = Vec3.subtract(that.focalPoint, Camera.getPosition()); + var xzDist = Math.sqrt(dPos.x * dPos.x + dPos.z * dPos.z); + + that.targetPitch = -Math.atan2(dPos.y, xzDist) * 180 / Math.PI; + that.targetYaw = Math.atan2(dPos.x, dPos.z) * 180 / Math.PI; + that.pitch = that.targetPitch; + that.yaw = that.targetYaw; + + startOrientation = Camera.getOrientation(); + + easing = true; + easingTime = 0; + } else { + that.setFocalPoint(position); + } that.updateCamera(); } @@ -255,6 +288,11 @@ CameraManager = function() { xRot = Quat.angleAxis(-that.pitch, { x: 1, y: 0, z: 0 }); q = Quat.multiply(yRot, xRot); + if (easing) { + var t = easeOutCubic(easingTime / EASE_TIME); + q = Quat.slerp(startOrientation, q, t); + } + Camera.setOrientation(q); } @@ -270,6 +308,10 @@ CameraManager = function() { return; } + if (easing) { + easingTime = Math.min(EASE_TIME, easingTime + dt); + } + var scale = Math.min(dt * EASING_MULTIPLIER, 1.0); var dYaw = that.targetYaw - that.yaw; @@ -292,6 +334,10 @@ CameraManager = function() { that.zoomDistance += scale * dZoom; that.updateCamera(); + + if (easingTime >= 1) { + easing = false; + } } // Last mode that was first or third person From 185b9ac5453a1d12b7cc7c6c7f95d5defb45d69a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 4 Nov 2014 08:32:21 -0800 Subject: [PATCH 3/9] Add Inspect tool to newEditEntities --- examples/libraries/entityCameraTool.js | 4 - examples/newEditEntities.js | 230 ++++++++++++++----------- 2 files changed, 127 insertions(+), 107 deletions(-) diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index 48abffb01e..2f03cb28c8 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -77,10 +77,6 @@ CameraManager = function() { var focalPoint = Vec3.sum(Camera.getPosition(), Vec3.multiply(that.zoomDistance, Quat.getFront(Camera.getOrientation()))); - if (Camera.getMode() == 'first person') { - that.targetZoomDistance = INITIAL_ZOOM_DISTANCE_FIRST_PERSON; - } - // Determine the correct yaw and pitch to keep the camera in the same location var dPos = Vec3.subtract(focalPoint, Camera.getPosition()); var xzDist = Math.sqrt(dPos.x * dPos.x + dPos.z * dPos.z); diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index d58f258e59..28d3eec660 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -51,6 +51,9 @@ var wantEntityGlow = false; var SPAWN_DISTANCE = 1; var DEFAULT_DIMENSION = 0.20; +var MENU_INSPECT_TOOL_ENABLED = 'Inspect Tool'; +var MENU_EASE_ON_FOCUS = 'Ease Orientation on Focus'; + var modelURLs = [ HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", HIFI_PUBLIC_BUCKET + "meshes/birarda/birarda_head.fbx", @@ -387,7 +390,6 @@ function isLocked(properties) { var selectedEntityID; -var mouseLastPosition; var orientation; var intersection; @@ -401,142 +403,154 @@ function rayPlaneIntersection(pickRay, point, normal) { return Vec3.sum(pickRay.origin, Vec3.multiply(pickRay.direction, t)); } +function findClickedEntity(event) { + var pickRay = Camera.computePickRay(event.x, event.y); + + var foundIntersection = Entities.findRayIntersection(pickRay); + + if (!foundIntersection.accurate) { + return null; + } + var foundEntity = foundIntersection.entityID; + + if (!foundEntity.isKnownID) { + var identify = Entities.identifyEntity(foundEntity); + if (!identify.isKnownID) { + print("Unknown ID " + identify.id + " (update loop " + foundEntity.id + ")"); + selectionManager.clearSelections(); + return null; + } + foundEntity = identify; + } + + return { pickRay: pickRay, entityID: foundEntity }; +} + function mousePressEvent(event) { - mouseLastPosition = { x: event.x, y: event.y }; - var clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y }); - - var entitySelected = false; - if (toolBar.mousePressEvent(event) || progressDialog.mousePressEvent(event) - || cameraManager.mousePressEvent(event) || selectionDisplay.mousePressEvent(event)) { - // Event handled; do nothing. + if (toolBar.mousePressEvent(event) || progressDialog.mousePressEvent(event)) { return; - } else { - - // If we aren't active and didn't click on an overlay: quit - if (!isActive) { + } + if (isActive) { + var entitySelected = false; + if (cameraManager.mousePressEvent(event) || selectionDisplay.mousePressEvent(event)) { + // Event handled; do nothing. return; - } - - var pickRay = Camera.computePickRay(event.x, event.y); - Vec3.print("[Mouse] Looking at: ", pickRay.origin); - var foundIntersection = Entities.findRayIntersection(pickRay); - - if(!foundIntersection.accurate) { - selectionManager.clearSelections(); - return; - } - var foundEntity = foundIntersection.entityID; - - if (!foundEntity.isKnownID) { - var identify = Entities.identifyEntity(foundEntity); - if (!identify.isKnownID) { - print("Unknown ID " + identify.id + " (update loop " + foundEntity.id + ")"); + } else { + var result = findClickedEntity(event); + if (result === null) { selectionManager.clearSelections(); return; } - foundEntity = identify; - } + 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; + 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| + 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 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 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 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); + 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 (0 < x && sizeOK) { + entitySelected = true; + selectedEntityID = foundEntity; + orientation = MyAvatar.orientation; + intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation)); - if (!event.isShifted) { - selectionManager.clearSelections(); + if (!event.isShifted) { + selectionManager.clearSelections(); + } + selectionManager.addEntity(foundEntity); + + print("Model selected: " + foundEntity.id); } - selectionManager.addEntity(foundEntity); - - print("Model selected: " + foundEntity.id); } } - } - if (entitySelected) { - selectionDisplay.select(selectedEntityID, event); + if (entitySelected) { + selectionDisplay.select(selectedEntityID, event); + } + } else if (Menu.isOptionChecked(MENU_INSPECT_TOOL_ENABLED)) { + var result = findClickedEntity(event); + if (result !== null && event.isRightButton) { + var currentProperties = Entities.getEntityProperties(result.entityID); + cameraManager.enable(); + cameraManager.focus(currentProperties.position, null, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + cameraManager.mousePressEvent(event); + } } } var highlightedEntityID = { isKnownID: false }; function mouseMoveEvent(event) { - if (!isActive) { - return; - } - - // 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)) { - return; - } - - var pickRay = Camera.computePickRay(event.x, event.y); - var entityIntersection = Entities.findRayIntersection(pickRay); - if (entityIntersection.accurate) { - if(highlightedEntityID.isKnownID && highlightedEntityID.id != entityIntersection.entityID.id) { - selectionDisplay.unhighlightSelectable(highlightedEntityID); - highlightedEntityID = { id: -1, isKnownID: false }; + 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)) { + return; } - var halfDiagonal = Vec3.length(entityIntersection.properties.dimensions) / 2.0; - - var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), - entityIntersection.properties.position)) * 180 / 3.14; - - var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE) - && (allowSmallModels || angularSize > MIN_ANGULAR_SIZE); - - if (entityIntersection.entityID.isKnownID && sizeOK) { - if (wantEntityGlow) { - Entities.editEntity(entityIntersection.entityID, { glowLevel: 0.25 }); + var pickRay = Camera.computePickRay(event.x, event.y); + var entityIntersection = Entities.findRayIntersection(pickRay); + if (entityIntersection.accurate) { + if(highlightedEntityID.isKnownID && highlightedEntityID.id != entityIntersection.entityID.id) { + selectionDisplay.unhighlightSelectable(highlightedEntityID); + highlightedEntityID = { id: -1, isKnownID: false }; } - highlightedEntityID = entityIntersection.entityID; - selectionDisplay.highlightSelectable(entityIntersection.entityID); - } + var halfDiagonal = Vec3.length(entityIntersection.properties.dimensions) / 2.0; + + var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), + entityIntersection.properties.position)) * 180 / 3.14; + + var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE) + && (allowSmallModels || angularSize > MIN_ANGULAR_SIZE); + + if (entityIntersection.entityID.isKnownID && sizeOK) { + if (wantEntityGlow) { + Entities.editEntity(entityIntersection.entityID, { glowLevel: 0.25 }); + } + highlightedEntityID = entityIntersection.entityID; + selectionDisplay.highlightSelectable(entityIntersection.entityID); + } + + } + } else { + cameraManager.mouseMoveEvent(event); } } function mouseReleaseEvent(event) { - if (!isActive) { - return; - } - if (selectionManager.hasSelection()) { + if (isActive && selectionManager.hasSelection()) { tooltip.show(false); } + cameraManager.mouseReleaseEvent(event); } @@ -574,6 +588,9 @@ function setupModelMenus() { Menu.addMenuItem({ menuName: "File", menuItemName: "Export Models", shortcutKey: "CTRL+META+E", afterItem: "Models" }); Menu.addMenuItem({ menuName: "File", menuItemName: "Import Models", shortcutKey: "CTRL+META+I", afterItem: "Export Models" }); Menu.addMenuItem({ menuName: "Developer", menuItemName: "Debug Ryans Rotation Problems", isCheckable: true }); + + Menu.addMenuItem({ menuName: "View", menuItemName: MENU_INSPECT_TOOL_ENABLED, afterItem: "Edit Entities Help...", isCheckable: true }); + Menu.addMenuItem({ menuName: "View", menuItemName: MENU_EASE_ON_FOCUS, afterItem: MENU_INSPECT_TOOL_ENABLED, isCheckable: true }); } setupModelMenus(); // do this when first running our script. @@ -594,6 +611,9 @@ function cleanupModelMenus() { Menu.removeMenuItem("File", "Export Models"); Menu.removeMenuItem("File", "Import Models"); Menu.removeMenuItem("Developer", "Debug Ryans Rotation Problems"); + + Menu.removeMenuItem("View", MENU_INSPECT_TOOL_ENABLED); + Menu.removeMenuItem("View", MENU_EASE_ON_FOCUS); } Script.scriptEnding.connect(function() { @@ -684,7 +704,11 @@ Controller.keyReleaseEvent.connect(function (event) { } else if (event.text == "TAB") { selectionDisplay.toggleSpaceMode(); } else if (event.text == "f") { - cameraManager.focus(); + if (isActive) { + cameraManager.focus(selectionManager.worldPosition, + selectionManager.worldDimensions, + Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + } } else if (event.text == '[') { if (isActive) { cameraManager.enable(); From af1b69d8a158ef89cb67e05251c833473702cce0 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 4 Nov 2014 09:01:45 -0800 Subject: [PATCH 4/9] removed some dead code --- interface/src/entities/EntityTreeRenderer.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/interface/src/entities/EntityTreeRenderer.h b/interface/src/entities/EntityTreeRenderer.h index 0a725c8294..b8acb28c3b 100644 --- a/interface/src/entities/EntityTreeRenderer.h +++ b/interface/src/entities/EntityTreeRenderer.h @@ -64,12 +64,6 @@ public: /// clears the tree virtual void clear(); - //Q_INVOKABLE Model* getModel(const ModelEntityItem* modelEntityItem); - - // renderers for various types of entities - void renderEntityTypeBox(EntityItem* entity, RenderArgs* args); - void renderEntityTypeModel(EntityItem* entity, RenderArgs* args); - static QThread* getMainThread(); /// if a renderable entity item needs a model, we will allocate it for them From fc977e21e60ce872d8434cae1a20493dc8706b6a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 4 Nov 2014 09:14:14 -0800 Subject: [PATCH 5/9] Remove print statements --- examples/libraries/entityCameraTool.js | 1 - examples/newEditEntities.js | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index 2f03cb28c8..c9757bde7d 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -339,7 +339,6 @@ CameraManager = function() { // Last mode that was first or third person var lastAvatarCameraMode = "first person"; Camera.modeUpdated.connect(function(newMode) { - print("Camera mode has been updated: " + newMode); if (newMode == "first person" || newMode == "third person") { lastAvatarCameraMode = newMode; that.disable(true); diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index ea1f69e15f..92c4b36a0b 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -820,7 +820,6 @@ function applyEntityProperties(data) { var properties = data.createEntities[i].properties; var newEntityID = Entities.addEntity(properties); DELETED_ENTITY_MAP[entityID.id] = newEntityID; - print(newEntityID.isKnownID); if (data.selectCreated) { selectedEntityIDs.push(newEntityID); } From fd8fb32190af8489b649678979b772f736d13bab Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 4 Nov 2014 09:33:39 -0800 Subject: [PATCH 6/9] Repopulate example models for "Upload URL" to better sized models --- examples/editModels.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/editModels.js b/examples/editModels.js index 7f4c27814c..d26a6e14b0 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -50,14 +50,14 @@ var SPAWN_DISTANCE = 1; var DEFAULT_DIMENSION = 0.20; var modelURLs = [ - HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", - HIFI_PUBLIC_BUCKET + "meshes/birarda/birarda_head.fbx", - HIFI_PUBLIC_BUCKET + "meshes/pug.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/2-Terrain:%20Alder.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/2-Terrain:%20Bush1.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/2-Terrain:%20Bush6.fbx", HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-purple.svo", - HIFI_PUBLIC_BUCKET + "meshes/minotaur/mino_full.fbx", - HIFI_PUBLIC_BUCKET + "meshes/Combat_tank_V01.FBX", - HIFI_PUBLIC_BUCKET + "meshes/orc.fbx", - HIFI_PUBLIC_BUCKET + "meshes/slimer.fbx" + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed2.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed4.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed7.fbx" ]; var jointList = MyAvatar.getJointNames(); From 4fdc00948f47fcd51da278dc5a44b8bd90c702a1 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 4 Nov 2014 09:39:37 -0800 Subject: [PATCH 7/9] Repopulate example models in newEditEnties.js too --- examples/newEditEntities.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index 64ccb556a9..22f4a6d71f 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -52,14 +52,14 @@ var SPAWN_DISTANCE = 1; var DEFAULT_DIMENSION = 0.20; var modelURLs = [ - HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", - HIFI_PUBLIC_BUCKET + "meshes/birarda/birarda_head.fbx", - HIFI_PUBLIC_BUCKET + "meshes/pug.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/2-Terrain:%20Alder.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/2-Terrain:%20Bush1.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/2-Terrain:%20Bush6.fbx", HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-purple.svo", - HIFI_PUBLIC_BUCKET + "meshes/minotaur/mino_full.fbx", - HIFI_PUBLIC_BUCKET + "meshes/Combat_tank_V01.FBX", - HIFI_PUBLIC_BUCKET + "meshes/orc.fbx", - HIFI_PUBLIC_BUCKET + "meshes/slimer.fbx" + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed2.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed4.fbx", + HIFI_PUBLIC_BUCKET + "models/entities/3-Buildings-1-Rustic-Shed7.fbx" ]; var mode = 0; From 573e6f119f13912b75d87fde5bd259d841024d7c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 4 Nov 2014 10:06:17 -0800 Subject: [PATCH 8/9] Add entity camera options to settings --- examples/newEditEntities.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index 92c4b36a0b..fd956fc95a 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -51,8 +51,11 @@ var wantEntityGlow = false; var SPAWN_DISTANCE = 1; var DEFAULT_DIMENSION = 0.20; -var MENU_INSPECT_TOOL_ENABLED = 'Inspect Tool'; -var MENU_EASE_ON_FOCUS = 'Ease Orientation on Focus'; +var MENU_INSPECT_TOOL_ENABLED = "Inspect Tool"; +var MENU_EASE_ON_FOCUS = "Ease Orientation on Focus"; + +var SETTING_INSPECT_TOOL_ENABLED = "inspectToolEnabled"; +var SETTING_EASE_ON_FOCUS = "cameraEaseOnFocus"; var modelURLs = [ HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", @@ -590,8 +593,10 @@ function setupModelMenus() { Menu.addMenuItem({ menuName: "File", menuItemName: "Import Models", shortcutKey: "CTRL+META+I", afterItem: "Export Models" }); Menu.addMenuItem({ menuName: "Developer", menuItemName: "Debug Ryans Rotation Problems", isCheckable: true }); - Menu.addMenuItem({ menuName: "View", menuItemName: MENU_INSPECT_TOOL_ENABLED, afterItem: "Edit Entities Help...", isCheckable: true }); - Menu.addMenuItem({ menuName: "View", menuItemName: MENU_EASE_ON_FOCUS, afterItem: MENU_INSPECT_TOOL_ENABLED, isCheckable: true }); + Menu.addMenuItem({ menuName: "View", menuItemName: MENU_INSPECT_TOOL_ENABLED, afterItem: "Edit Entities Help...", + isCheckable: true, isChecked: Settings.getValue(SETTING_INSPECT_TOOL_ENABLED) == "true" }); + Menu.addMenuItem({ menuName: "View", menuItemName: MENU_EASE_ON_FOCUS, afterItem: MENU_INSPECT_TOOL_ENABLED, + isCheckable: true, isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) == "true" }); } setupModelMenus(); // do this when first running our script. @@ -619,6 +624,9 @@ function cleanupModelMenus() { } Script.scriptEnding.connect(function() { + Settings.setValue(SETTING_INSPECT_TOOL_ENABLED, Menu.isOptionChecked(MENU_INSPECT_TOOL_ENABLED)); + Settings.setValue(SETTING_EASE_ON_FOCUS, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + progressDialog.cleanup(); toolBar.cleanup(); cleanupModelMenus(); From 2e8e31fce93d15a93b1c6aa09f361f2b84787037 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 4 Nov 2014 10:06:45 -0800 Subject: [PATCH 9/9] Update inspect tool behavior to pan correctly --- examples/newEditEntities.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index fd956fc95a..575541e9f0 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -500,10 +500,14 @@ function mousePressEvent(event) { } } else if (Menu.isOptionChecked(MENU_INSPECT_TOOL_ENABLED)) { var result = findClickedEntity(event); - if (result !== null && event.isRightButton) { - var currentProperties = Entities.getEntityProperties(result.entityID); - cameraManager.enable(); - cameraManager.focus(currentProperties.position, null, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + if (event.isRightButton) { + if (result !== null) { + var currentProperties = Entities.getEntityProperties(result.entityID); + cameraManager.enable(); + cameraManager.focus(currentProperties.position, null, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + cameraManager.mousePressEvent(event); + } + } else { cameraManager.mousePressEvent(event); } }